CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch (https://www.cfd-online.com/Forums/openfoam-installation/130113-compile-2-3-mac-os-x-patch.html)

alexeym March 28, 2015 06:38

Hi,

As the path in error is

Code:

/bin/tools/RunFunctions
I would suppose you did not set up environment variables, because this is the line in the script where it sources RunFunctions

Code:

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

as your environment was not set up, $WM_PROJECT_DIR is expanded into empty string.

KateEisenhower March 31, 2015 10:03

Hi,

I am not sure if I understand what you are trying to tell me. Has it something to do with the post-configuration part of the Hopscotch Building OpenFOAM on OS X guide (http://matveichev.blogspot.fr/2014/0...on-os-x.html)?
I didn't understand this part and I guess it didn't work on my machine.

How do I set up environment variables?
Quote:

Originally Posted by alexeym (Post 538674)
Hi,

As the path in error is

Code:

/bin/tools/RunFunctions
I would suppose you did not set up environment variables, because this is the line in the script where it sources RunFunctions

Code:

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

as your environment was not set up, $WM_PROJECT_DIR is expanded into empty string.


alexeym March 31, 2015 10:12

Hi,

Maybe here it is written clearer - https://github.com/mrklein/openfoam-...-configuration.

If you were able to build OpenFOAM, then once you have set up environment variables. In general it is done with 'source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc' command. But before issuing this command you have to mount disk image with case sensitive file system you have created.

KateEisenhower March 31, 2015 10:20

Hi,

everytime I reboot my mac I am typing the following:
Code:

hdiutil attach -mountpoint $HOME/OpenFOAM OpenFOAM.sparsebundle
source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc

So I guess that is not the problem. Am I wrong?

p.s.: Thank you for the post configuration guide. I will try this!

alexeym March 31, 2015 10:28

Well, commands seems to be OK. What is the output of the commands?

Post-configuration guide is just trying to automate the commands you are entering. If they do not work then re-reading the guide in general will not help.

KateEisenhower March 31, 2015 10:37

The output is:

Code:

Kates-MacBook-Pro:~ kateeisenhower$ hdiutil attach -mountpoint $HOME/OpenFOAM OpenFOAM.sparsebundle
/dev/disk2                  GUID_partition_scheme                 
/dev/disk2s1                EFI                                   
/dev/disk2s2                Apple_HFS                              /Users/kateeisenhower/OpenFOAM
Kates-MacBook-Pro:~ kateeisenhower$ source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc
Using paraview in directory /Applications/paraview.app


alexeym March 31, 2015 10:39

And then you open new terminal and try to run tutorial case? You have to do 'source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc' every time you open new terminal session.

KateEisenhower March 31, 2015 10:40

I never close terminal.

alexeym March 31, 2015 10:42

And you always work in one tab/window? You never open new windows/tabs?

KateEisenhower March 31, 2015 10:46

Not within the terminal app.

Ah, now I got it. When I double click on the Allrun script, it opens in a new window automatically. I will try to follow the guide you recommended me for automating the process of mounting disk image and setup environment variables. This will solve the problem, right?

Thank you very much for your help!

KateEisenhower April 1, 2015 03:50

Quote:

Originally Posted by alexeym (Post 539258)
Hi,

Maybe here it is written clearer - https://github.com/mrklein/openfoam-...-configuration.

If you were able to build OpenFOAM, then once you have set up environment variables. In general it is done with 'source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc' command. But before issuing this command you have to mount disk image with case sensitive file system you have created.

Hello,

I tried to follow the default version approach but I have two questions:

1) In which directory do I have to be when I make the directory .OpenFOAM?

2) Where is my ~/.profile?

Thanks in advance

alexeym April 1, 2015 04:08

Hi,

1. Really, I have omitted this in guide. You should be in $HOME folder (/Users/kateeisenhower).

2. In general on Unices ~ refers to home folder, so your ~/.profile is /Users/kateeisenhower/.profile.

You can check if installation succeeded by executing Allrun in Terminal instead of Finder. I.e. in the terminal, where you have mounted disk image and then executed 'source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc', you write (text starting from # is a commentary)

Code:

tut # will got to tutorials folder
cd incompressible/simpleFoam/motorBike # go to motorBike tutorial
./Allrun # run tutorial


KateEisenhower April 1, 2015 05:17

Quote:

Originally Posted by alexeym (Post 539405)
Hi,

1. Really, I have omitted this in guide. You should be in $HOME folder (/Users/kateeisenhower).

2. In general on Unices ~ refers to home folder, so your ~/.profile is /Users/kateeisenhower/.profile.

You can check if installation succeeded by executing Allrun in Terminal instead of Finder. I.e. in the terminal, where you have mounted disk image and then executed 'source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc', you write (text starting from # is a commentary)

Code:

tut # will got to tutorials folder
cd incompressible/simpleFoam/motorBike # go to motorBike tutorial
./Allrun # run tutorial


1) I read the guide another time but I couldn't find it. However I tried to create a file with the version inside:
Code:

Kates-MacBook-Pro:~ kateeisenhower$ mkdir -p .OpenFOAM
Kates-MacBook-Pro:~ kateeisenhower$ echo '2.3.1' > .OpenFOAM/OpenFOAM-release
Kates-MacBook-Pro:~ kateeisenhower$

2) I know that, but in my home folder there is no such file. So I asked again.

alexeym April 1, 2015 05:31

And the result of these operations? Do you still have problems with tutorial execution or it started to work?

KateEisenhower April 1, 2015 05:33

There was no result. I have posted everything which I could see in terminal.
I did not try the tutorials because I was not able to do step two of the post configuration guide because of the missing .profile.

alexeym April 1, 2015 05:45

And you can not create it? Even with just

Code:

echo 'source $HOME/openfoam-env-setup.sh' > $HOME/.profile

KateEisenhower April 1, 2015 05:50

No, it doesn't work. I looked again, but there are only my documents, music, pictures... folders as well as my OpenFOAM image and OpenFOAM.sparsebundle.

alexeym April 1, 2015 05:52

How did you do 'I looked again...'? With Finder? Or with 'ls -la' in Terminal?

KateEisenhower April 1, 2015 05:56

Okay, this worked. I can see the file now. Yes, I looked with the Finder. I don't know why but I really can't see all the files there. I am trying to complete the post configuration now.

Thank you for your help!

KateEisenhower April 1, 2015 06:54

Okay, I managed to change the .profile. It looks like this now:

Code:

Kates-MacBook-Pro:~ kateeisenhower$ cat .profile
source $HOME/openfoam-env-setup.sd
if [ -f "$HOME/.OpenFOAM/OpenFOAM-release" ]; then
    FOAM_DISK_IMAGE=$HOME/OpenFOAM.sparsebundle
    FOAM_MOUNT_POINT=$HOME/OpenFOAM
    FOAM_VERSION=$(cat $HOME/.OpenFOAM/OpenFOAM-release)
    if [ ! -f "$HOME/OpenFOAM/OpenFOAM-$FOAM_VERSION/etc/bashrc" ]; then
        hdiutil attach -quiet -mountpoint "$FOAM_MOUNT_POINT" "$FOAM_DISK_IMAGE" &&
                . "$HOME/OpenFOAM/OpenFOAM-$FOAM_VERSION/etc/bashrc"
    else
        source "$HOME/OpenFOAM/OpenFOAM-$FOAM_VERSION/etc/bashrc"
    fi
fi

The first line already existed. I guess I was not supposed to delete this file.

After rebooting my mac and starting Terminal I got the following:

Code:

-bash: /Users/kateeisenhower/openfoam-env-setup.sd: No such file or directory
Using paraview in directory /Applications/paraview.app

I think the error relates to the first line in my .profile. Do I have to worry about it?

Also i ran the motorBike tutorial and snappyHexMesh worked fine.


All times are GMT -4. The time now is 06:19.