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)

ajmas March 15, 2015 15:57

I am going to see if we can get some of these Mac related changes merged into the main repository, on the condition they don't break the main Linux build.

Petru March 16, 2015 04:58

Quote:

Originally Posted by ajmas
Quote:
Originally Posted by ajmas View Post
Current status update on my efforts:
- https://github.com/ajmas/OpenFOAM-2.3.x master branch includes most of the changes available in this thread
- I have created a build script, attached to this post that should make building much easier. Doing the following:
-- Creating and mounting case-sensitive HFS+ disk image
-- Getting the necessary MacPorts (if you use another tool, please contribute changes)
-- Cloning the git repository (uses mine, since it is already patched)
-- Configuring bashrc
-- initiating the build
-- Ensuring the build is outputted to log
For anyone using MacPorts be sure to check your PATH environment variable. Be sure to put /opt/local/bin at the start, to avoid MacOS X versions of commands taking precedence.

I found this due issues resulting from the using of the version of flex at /usr/bin/flex. The MacOS X default version will fail in certain cases.

I have also now put the script for the build script on GitHub: https://github.com/ajmas/scripts-et-...sx-macports.sh

And with all this it all builds

Hi,
Thank you for your help.
It is finally working!!!!!
After some hours of building, the installation is now complete without any error...now I have just a question:
Is the installation permanent?
I mean, now I think everything is inside the volume, if I remove it, what is going to happen? Will I lose everything (the installation)? How can I make it permanent?
Sorry but I am not very good in this kind of things.
Thank you again,
it was very useful, specially for who is not good enough as me!!!

All the best,
Paolo

ajmas March 16, 2015 10:21

Quote:

Originally Posted by Petru (Post 536434)
Hi,
Thank you for your help.
It is finally working!!!!!
After some hours of building, the installation is now complete without any error...now I have just a question:
Is the installation permanent?
I mean, now I think everything is inside the volume, if I remove it, what is going to happen? Will I lose everything (the installation)? How can I make it permanent?
Sorry but I am not very good in this kind of things.
Thank you again,
it was very useful, specially for who is not good enough as me!!!

All the best,
Paolo

Unmounting the drive will not delete the data. Just remount the drive any time you need to use OpenFOAM. Just be sure to use a bash prompt at the command line and source the etc/bashrc provided with OpenFOAM. BTW from a bash prompt you can source the file by (that is a full-stop at the start):

Code:

. [path to OpenFOAM]/etc/bashrc
Of course be sure to replace '[path to OpenFOAM]' with the appropriate path. You can move the disk image to where you want to keep it, but when mounted the volume path should always be the same.

maCrobo March 16, 2015 19:03

Quote:

Originally Posted by ajmas (Post 530626)
Current status update on my efforts:
- https://github.com/ajmas/OpenFOAM-2.3.x master branch includes most of the changes available in this thread
- I have created a build script, attached to this post that should make building much easier. Doing the following:
-- Creating and mounting case-sensitive HFS+ disk image
-- Getting the necessary MacPorts (if you use another tool, please contribute changes)
-- Cloning the git repository (uses mine, since it is already patched)
-- Configuring bashrc
-- initiating the build
-- Ensuring the build is outputted to log

Please let me know if this helps you and please provide any pull-requests or change suggestions.

Note, I still waiting for my current build to finish, so will see if it is successful.

Thanks for the effort. What patches are you using? I'm asking that because it appears that defining paraview as a function avoids some issues with paraFoam. In fact, the user Alexejm did that in his patch and it seems pretty easy and quick a change. I'm advising it because lately on 3 different macs (1 with Mavericks, 2 with Yosemite) I met the same issue: everything installed smoothly, but paraFoam calls gives an error, which seems related to the alias definition used in Bernhard Gschaider's patch (using a function definition solves the problem).

ajmas March 16, 2015 22:56

Quote:

Originally Posted by maCrobo (Post 536632)
Thanks for the effort. What patches are you using? I'm asking that because it appears that defining paraview as a function avoids some issues with paraFoam. In fact, the user Alexejm did that in his patch and it seems pretty easy and quick a change. I'm advising it because lately on 3 different macs (1 with Mavericks, 2 with Yosemite) I met the same issue: everything installed smoothly, but paraFoam calls gives an error, which seems related to the alias definition used in Bernhard Gschaider's patch (using a function definition solves the problem).

I used a number of patches from the thread. You can see the source code in GitHub.

I encountered some issue using the paraFoam command too, since paraview.app doesn't support the .openFoam extension. If anyone has this working I'll integrate this into my fork.

maCrobo March 17, 2015 08:01

Quote:

Originally Posted by ajmas (Post 536648)
I used a number of patches from the thread. You can see the source code in GitHub.

I encountered some issue using the paraFoam command too, since paraview.app doesn't support the .openFoam extension. If anyone has this working I'll integrate this into my fork.

The paraview.sh file can be changed so that from line 147 to 161 it looks like the following code.

Code:

147 if [ $WM_ARCH_BASE=="darwin" ]
148 then
149    : ${PARAVIEW_APP_DIR:="/Applications/paraview.app"}; export PARAVIEW_APP_DIR
150    if [ -d "$PARAVIEW_APP_DIR" ]; then
151        echo "Using paraview in directory $PARAVIEW_APP_DIR"
152        paraview () {
153            $PARAVIEW_APP_DIR/Contents/MacOS/paraview "$@"
154        }
155
156        export -f paraview
157    else
158        echo "Please install Paraview into /Applications."
159        return
160    fi
161 fi

If you look at your patch changes (etc/config/paraview.sh), you can see that you used an alias definition:

Code:

+if [ $WM_ARCH_BASE=="darwin" ]
+then
+    : ${PARAVIEW_APP_DIR:="/Applications/paraview.app"}; export PARAVIEW_APP_DIR
+    if [ -d $PARAVIEW_APP_DIR -a ! -r $ParaView_DIR ]
+    then
+        echo "Using paraview in directory $PARAVIEW_APP_DIR"
+        unset ParaView_VERSION ParaView_MAJOR ParaView_DIR
+        # needs to be an alias because if it is in the path the Python Shell does not work
+        alias paraview=$PARAVIEW_APP_DIR/Contents/MacOS/paraview
+        export PATH=$PARAVIEW_APP_DIR/Contents/bin:$PATH
+    fi
+fi
+

That's it.
I haven't tried your script yet, so I can't give feedback on that.

NB: All that was suggested to me by the user alexeym, and it proved to solve an issue I met after building OpenFoam on some Mavericks and Yosemite OS. In fact, the issue consists of getting the following answer when calling paraFoam -builtin

Code:

/Volumes/OpenFoam-v2.3.x/openfoam-mac-install/OpenFOAM-2.3.x/bin/paraFoam: line 265: paraview: command not found

ajmas March 18, 2015 22:44

Thanks @maCrobo for the suggestions, I have now applied them.

Using 'paraFoam -builtin' seems to help, though should we be trying to do anything with PV4Readers (request if param is not specified)?

maCrobo March 19, 2015 14:13

Quote:

Originally Posted by ajmas (Post 537081)
Thanks @maCrobo for the suggestions, I have now applied them.

Using 'paraFoam -builtin' seems to help, though should we be trying to do anything with PV4Readers (request if param is not specified)?

Hello, you should thank alexeym, not me.
As far as your doubt goes, I got the impression that those PV4Readers are used for the Linux distribution of Paraview. In fact, it seems that if you want Paraview on Linux you have to compile it, and those PV4 files are there to modify some features (i.e. some buttons and panels) and have Paraview directly handle OpenFoam file format. So, I would say we won't be needing those PV4Readers files on Mac OS (where the conditional is to say there can be something I'm missing about that).
Finally, the simple paraFoam command (without any options) doesn't work on MacOS.

alexeym March 20, 2015 03:40

Hi,

Quote:

Originally Posted by maCrobo (Post 537243)
As far as your doubt goes, I got the impression that those PV4Readers are used for the Linux distribution of Paraview. In fact, it seems that if you want Paraview on Linux you have to compile it, and those PV4 files are there to modify some features (i.e. some buttons and panels) and have Paraview directly handle OpenFoam file format.

Not exactly. You can install Paraview binary package on Linux and use 'paraFoam -builtin'. Built-in OpenFOAM reader has certain problems (it does not understand uniformFixedValue boundary conditions for example) and certain advantages (it can read decomposed cases). Also you can build Paraview from sources on OS X (http://www.paraview.org/Wiki/ParaView:Build_And_Install) and after you can try to build PV4Readers. As from time to time people can not follow short OpenFOAM's installation guide, Paraview & PV4Readers build will be overkill.

Quote:

Originally Posted by maCrobo (Post 537243)
Finally, the simple paraFoam command (without any options) doesn't work on MacOS.

For paraFoam command to work without '-builtin' option, you have to patch it (or create an alias paraFoam='paraFoam -builtin' ;)). -builtin flag basically does the following:

Code:

# parse options
while [ "$#" -gt 0 ]
do
    case "$1" in
    ...
    -builtin)
        extension=foam
        requirePV=0
        shift
        ;;
...

You can permanently change lines above this while loop to

Code:

# reader extension
extension=foam

requirePV=0

and paraFoam will use built-in OpenFOAM reader by default.

maCrobo March 21, 2015 11:56

Quote:

Originally Posted by alexeym (Post 537323)
Not exactly. You can install Paraview binary package on Linux and use 'paraFoam -builtin'. Built-in OpenFOAM reader has certain problems (it does not understand uniformFixedValue boundary conditions for example) and certain advantages (it can read decomposed cases). Also you can build Paraview from sources on OS X (http://www.paraview.org/Wiki/ParaView:Build_And_Install) and after you can try to build PV4Readers. As from time to time people can not follow short OpenFOAM's installation guide, Paraview & PV4Readers build will be overkill.

Is there a way to get rid of the uniformFixedValue "misunderstanding" ?

Would compiling paraview and PV4Readers take interesting features?

alexeym March 21, 2015 12:52

Hi,

Quote:

Originally Posted by maCrobo (Post 537577)
Is there a way to get rid of the uniformFixedValue "misunderstanding" ?

I don't know any.

Quote:

Would compiling paraview and PV4Readers take interesting features?
It depends on the meaning of "interesting features". As you are compiling everything yourself, it is you who controls set of features that will be in the final application bundle.

KateEisenhower March 23, 2015 12:23

Quote:

Originally Posted by totalart (Post 487069)
I have successfully installed OF 2.3.0 following the instruction in Alexey Matveichev's blog. Everything's okay except snappyHexMesh. Following error occurs with SHM(I'm not running parallel).

dyld: Symbol not found: __SCOTCHbgraphbipartststratab
Referenced from: /Users/totalart/OpenFOAM/OpenFOAM-2.3.0/platforms/darwinIntel64ClangDPOpt/lib/openmpi-system/libptscotchDecomp.so
Expected in: flat namespace
in /Users/totalart/OpenFOAM/OpenFOAM-2.3.0/platforms/darwinIntel64ClangDPOpt/lib/openmpi-system/libptscotchDecomp.so
Trace/BPT trap: 5


In the Allwmake log, there was no error but warnings only. Anyone can advise what the problem is?

Many Thanks,
Young-kook

Hello everyone,

I got a very similar error when running snappyHexMesh on the motorBike tutorial:

Code:

dyld: Symbol not found: __SCOTCHbgraphbipartststratab
  Referenced from: /usr/local/opt/scotch/lib/libptscotch.dylib
  Expected in: flat namespace
 in /usr/local/opt/scotch/lib/libptscotch.dylib
Trace/BPT trap: 5

The difference is, I am not running 2.3.0, but OpenFOAM 2.3.1 with the 2.3.1 patch from here (https://github.com/mrklein/openfoam-...AM-2.3.1.patch).

Has anybody experienced this problem as well?

Quote:

Originally Posted by alexeym (Post 487368)
Hi,

well, it appeared that previous patch had more problems than I though. So here is a new patch for 2.3.0 - https://bitbucket.org/mrklein/openfo...20140421.patch.

Unfortunately, due to the problems with dynamicCode in previous patch, you need to rebuild everything. The list of bugs in previous patch that was fixed in the new one:
- mess with DYLD_LIBRARY_PATH, now I think it is finally correct
- error in Allwmake for ptscotch decomposition method (this was the reason for the error)
- error in wmake/Makefile (OpenFOAM code expected dynamic library to have extension .dylib while in Makefile it was .so, and that breaks dynamicCode functionality)
- Clang over-optimization of limited schemes that lead to FPE

I am thinking about installing OpenFOAM 2.3.0 with this updated patch. The link doesn't work anymore, unfortunately. Is this one (https://github.com/mrklein/openfoam-...AM-2.3.0.patch) the same?
And can anyone please tell me how to uninstall/remove OpenFOAM from my hard drive?

I really appreciate your help,

Kate

alexeym March 23, 2015 14:48

Hi,

Quote:

Originally Posted by KateEisenhower (Post 537851)
Has anybody experienced this problem as well?

I have tried to reproduce the error you posted. OS X 10.10.2, OpenFOAM 2.3.1, patch from github. Unfortunately I was not successful. On my laptop everything runs perfectly well.

Quote:

I am thinking about installing OpenFOAM 2.3.0 with this updated patch. The link doesn't work anymore, unfortunately. Is this one (https://github.com/mrklein/openfoam-...AM-2.3.0.patch) the same?
Not quite sure they are the same. I think patch on Github contains certain additional corrections.

Quote:

And can anyone please tell me how to uninstall/remove OpenFOAM from my hard drive?
You can just remove (delete) disk image you have created during installation.

KateEisenhower March 23, 2015 14:53

Quote:

Originally Posted by alexeym (Post 537874)
Hi,



I have tried to reproduce the error you posted. OS X 10.10.2, OpenFOAM 2.3.1, patch from github. Unfortunately I was not successful. On my laptop everything runs perfectly well.



Not quite sure they are the same. I think patch on Github contains certain additional corrections.



You can just remove (delete) disk image you have created during installation.

Thank you for the quick answer. I'll try to install again and will report afterwards. Mayhaps I did something wrong.

KateEisenhower March 25, 2015 06:13

Quote:

Originally Posted by alexeym (Post 537874)
Hi,



I have tried to reproduce the error you posted. OS X 10.10.2, OpenFOAM 2.3.1, patch from github. Unfortunately I was not successful. On my laptop everything runs perfectly well.



Not quite sure they are the same. I think patch on Github contains certain additional corrections.



You can just remove (delete) disk image you have created during installation.

I reinstalled OpenFOAM 2.3.1 and had a look at the log.Allwmake file afterwards. I was quite surprised to find many warnings and "could not open file" outputs. Is this normal? It is 11.7 MB big. So unfortunately I can't upload it here.
After that, I tried the cavity tutorial and it worked fine, just for the record.
Then I performed the following steps in the motorBike directory:
1) I built the initial mesh with blockMesh and viewed it in ParaView. This worked.
2) Then I entered snappyHexMesh. I got the following output:
Code:

dyld: Symbol not found: __SCOTCHbgraphbipartststratab
  Referenced from: /usr/local/opt/scotch/lib/libptscotch.dylib
  Expected in: flat namespace
 in /usr/local/opt/scotch/lib/libptscotch.dylib
Trace/BPT trap: 5

Is this the proper way of proceeding? Does anyone know which point I am missing here?

Moreover, it strikes me that I have an "0.org" folder in the motorBike directory. Why isn't it just called "0"?

alexeym March 25, 2015 06:37

Hi,

Quote:

Originally Posted by KateEisenhower (Post 538098)
I reinstalled OpenFOAM 2.3.1 and had a look at the log.Allwmake file afterwards. I was quite surprised to find many warnings and "could not open file" outputs. Is this normal? It is 11.7 MB big. So unfortunately I can't upload it here.

You can use Dropbox to share the file. You can use Github to share the file. You can use Bitbucket to share the file. Surely you will need account on one of these services. The first is user-friendly, the second and the third are developer-friendly.

Quote:

Code:

dyld: Symbol not found: __SCOTCHbgraphbipartststratab
  Referenced from: /usr/local/opt/scotch/lib/libptscotch.dylib
  Expected in: flat namespace
 in /usr/local/opt/scotch/lib/libptscotch.dylib
Trace/BPT trap: 5


If you are talking about tutorials/mesh/snappyHexMesh/motorBike tutorial case, you can look inside Allrun script to see how it is intended to run. Purpose of 0.org is to keep original initial and boundary conditions files (as the name suggests). Tutorial uses potentialFoam to initialize flow, the solver will overwrite files in 0 folder. So Allrun script copies 0.org to 0 and then runs solvers.

The error is quite suspicious, can you, please, post output of the following commands ($ is shell prompt, you don't need to copy it):

Code:

$ sw_vers
$ gcc --version
$ clang --version


KateEisenhower March 25, 2015 08:31

Quote:

Originally Posted by alexeym (Post 538106)
Hi,



You can use Dropbox to share the file. You can use Github to share the file. You can use Bitbucket to share the file. Surely you will need account on one of these services. The first is user-friendly, the second and the third are developer-friendly.

Here you go: https://www.dropbox.com/s/8d1x7njf4h..._copy.txt?dl=0


Quote:

If you are talking about tutorials/mesh/snappyHexMesh/motorBike tutorial case, you can look inside Allrun script to see how it is intended to run. Purpose of 0.org is to keep original initial and boundary conditions files (as the name suggests). Tutorial uses potentialFoam to initialize flow, the solver will overwrite files in 0 folder. So Allrun script copies 0.org to 0 and then runs solvers.
Thank you very much for the explanation.
There was quite a missunderstanding. I was talking about the tutorials/incompressible/simpleFoam/motorBike tutorial. I will try to run the motorBike from the tutorials/mesh/snappyHexMesh/motorBike directory now and will report back to you later

Quote:

The error is quite suspicious, can you, please, post output of the following commands ($ is shell prompt, you don't need to copy it):

Code:

$ sw_vers
$ gcc --version
$ clang --version


Code:

$ sw_vers
:
Code:

ProductName:        Mac OS X
ProductVersion:        10.10.2
BuildVersion:        14C1514

Code:

$ gcc --version
:
Code:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix

Code:

$ clang --version
:
Code:

Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix


alexeym March 25, 2015 08:53

Hi,

1. Warnings about missing files that is in your log are expected

Code:

Note: ignore spurious warnings about missing mpicxx.h headers

wclean mpi
wmake libso mpi
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file UOPwrite.C
could not open file omp.h for source file UOPwrite.C due to No such file or directory
could not open file ompi/mpi/cxx/pmpicxx.h for source file UOPwrite.C due to No such file or directory
...

2. In fact these tutorial cases are similar (or even identical). And you should better use Allrun script to run the case.

3. And finally I have found that currently Homebrew installs Scotch as a set of *.dylib files. Scotch of my laptop was build from sources and is a set of *.a files. I will install new Scotch version and try to release a fix for your error.

alexeym March 26, 2015 14:46

@KateEisenhower

I have reproduced your error (finally) and it was really due to change in Homebrew's Scotch build process (i.e. they moved from static library to dynamic library and ptscotch now needs -lscotch during linking). Fortunately the fix is rather simple. You have two possibilities:

1. If you still have OpenFOAM installed, do the following

Code:

$ cd $HOME/OpenFOAM/OpenFOAM-2.3.1
$ curl -L https://raw.githubusercontent.com/mrklein/openfoam-os-x/master/OpenFOAM-2.3.1-scotch.patch > OpenFOAM-2.3.1-scotch.patch
$ git apply OpenFOAM-2.3.1-scotch.patch
$ cd src/parallel/decompose
$ ./Allwmake

2. If you removed OpenFOAM. Start from the beginning. Now patch is adapted for the new version of Scotch.

KateEisenhower March 28, 2015 05:23

Quote:

Originally Posted by alexeym (Post 538437)
@KateEisenhower

I have reproduced your error (finally) and it was really due to change in Homebrew's Scotch build process (i.e. they moved from static library to dynamic library and ptscotch now needs -lscotch during linking). Fortunately the fix is rather simple. You have two possibilities:

1. If you still have OpenFOAM installed, do the following

Code:

$ cd $HOME/OpenFOAM/OpenFOAM-2.3.1
$ curl -L https://raw.githubusercontent.com/mrklein/openfoam-os-x/master/OpenFOAM-2.3.1-scotch.patch > OpenFOAM-2.3.1-scotch.patch
$ git apply OpenFOAM-2.3.1-scotch.patch
$ cd src/parallel/decompose
$ ./Allwmake

2. If you removed OpenFOAM. Start from the beginning. Now patch is adapted for the new version of Scotch.

Thank you! This worked. I don't get this error anymore.
However, I tried to run the motorBike tutorial by running the Allrun script. I got the following output:
Code:

kates-mbp:~ kateeisenhower$ /Users/kateeisenhower/OpenFOAM/kateeisenhower-2.3.1/run/tutorials/incompressible/simpleFoam/motorBike/Allrun ; exit;
/Users/kateeisenhower/OpenFOAM/kateeisenhower-2.3.1/run/tutorials/incompressible/simpleFoam/motorBike/Allrun: line 5: /bin/tools/RunFunctions: No such file or directory
logout

Of course I could source the RunFunctions by myself, but isn't the Allrun script supposed to do this?

alexeym March 28, 2015 07: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 11: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 11: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 11: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 11: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 11: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 11: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 11:40

I never close terminal.

alexeym March 31, 2015 11:42

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

KateEisenhower March 31, 2015 11: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 04: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 05: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 06: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 06:31

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

KateEisenhower April 1, 2015 06: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 06:45

And you can not create it? Even with just

Code:

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

KateEisenhower April 1, 2015 06: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 06:52

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

KateEisenhower April 1, 2015 06: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 07: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 19:37.