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] Mac-patch for OpenFOAM 2.4 (https://www.cfd-online.com/Forums/openfoam-installation/153410-mac-patch-openfoam-2-4-a.html)

gschaider May 25, 2015 16:35

Mac-patch for OpenFOAM 2.4
 
1 Attachment(s)
Hi!

Attached you'll find the patch that makes OF 2.4 (I used the git-repository, but the source tarball should work too) compile on a Mac.

Instructions at http://openfoamwiki.net/index.php/In...OpenFOAM_2.3.x should work.

The patch is almost the same as for 2.3. Major difference is that the stack-trace is now delegated to lldb (which does a better job). The old stack-trace is done in addition

Bernhard

Attachment 39711

CFX_CFD June 4, 2015 05:03

Installation OF 2.4 on Mac OS X
 
Hi!

I'm new to OpenFOAM and working with a terminal. I want to install the latest version of OF (2.4) on my Mac OS X Yosemite version 10.10.3. I followed the instructions you provided on http://openfoamwiki.net/index.php/In...OpenFOAM_2.3.x but now applied on the 2.4.x version.

I installed all the necessary ports as you can see below
Code:

$ port select --summary
Name    Selected              Options
====    ========              =======
db      db48                  db48 none
gcc      mp-gcc48              mp-gcc48 mp-gcc49 none
llvm    mp-llvm-3.5            mp-llvm-3.5 none
mpi      openmpi-gcc48-fortran  openmpi-gcc48-fortran openmpi-mp-fortran none
python  python27              python26-apple python27 python27-apple none
python2  none                  python26-apple python27 python27-apple none

After going through all the instructions, I tried to run the blockMesh command in the terminal while being in the OpenFOAM/OpenFOAM-2.4.x/tutorials/incompressible/icoFoam/cavity directory but I was unsuccessful.

I got the following message:
Code:

$ blockMesh
-bash: blockMesh: command not found

I checked the other threads for tips, reinstalled all the necessary ports, tried to install other versions as well but I was not able to install OF on my computer. Could you please help me figuring out what went wrong in the installation of OF?
Thanks in advance!

patrick June 22, 2015 16:15

I am running 10.10.4 and also failed to install both 2.3 and 2.4 version. With previous system version (10.10.2 I think) installation of 2.3 went nice and easy this time I get plenty of errors when building.

Anyone succeeded installing OF 2.4 on Yosemite 10.10.4? :confused:

patrick June 22, 2015 17:24

1 Attachment(s)
Tried again with OF 2.4.0 and instructions (they worked on previous OS X version) from this website. Build failed again...

My ports config:

Code:

Name    Selected              Options
====    ========              =======
db      db48                  db48 none
gcc      mp-gcc48              mp-gcc48 mp-gcc49 none
llvm    mp-llvm-3.5            mp-llvm-3.5 none
mpi      openmpi-gcc48-fortran  openmpi-gcc48-fortran openmpi-mp-fortran none
pip      none                  pip27 none
python  python27              python26-apple python27 python27-apple none
python2  none                  python26-apple python27 python27-apple none

Log already begins with errors:
Code:

gcc-mp-4.8 -m64 -fsignaling-nans  -ftrapping-math -fdiagnostics-color=always  -Wall -O2  -fPIC -Ddarwin dirToString.c -o /Users/Patryk/OpenFOAM/OpenFOAM-2.4.0/wmake/platforms/darwinIntel64Gcc48/dirToString
gcc-mp-4.8: error: unrecognized command line option '-fdiagnostics-color=always'
make: *** [/Users/Patryk/OpenFOAM/OpenFOAM-2.4.0/wmake/platforms/darwinIntel64Gcc48/dirToString] Error 1
no ThirdParty sources found - skipping
+ wmakePrintBuild -check
no git description found
+ /bin/rm -f 'OpenFOAM/Make/*/global.?'
+ wmakeLnInclude OpenFOAM
+ wmakeLnInclude OSspecific/POSIX
+ Pstream/Allwmake
+ wmake libso dummy
wmakeLnInclude: linking include files to ./lnInclude
/bin/sh: /Users/Patryk/OpenFOAM/OpenFOAM-2.4.0/wmake/platforms/darwinIntel64Gcc48/wmkdep: No such file or directory
/bin/sh: /Users/Patryk/OpenFOAM/OpenFOAM-2.4.0/wmake/platforms/darwinIntel64Gcc48/wmkdep: No such file or directory
/bin/sh: /Users/Patryk/OpenFOAM/OpenFOAM-2.4.0/wmake/platforms/darwinIntel64Gcc48/wmkdep: No such file or directory
SOURCE=UIPread.C ;  g++-mp-4.8 -m64 -fsignaling-nans  -ftrapping-math -fdiagnostics-color=always -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100  -IlnInclude -I. -I/Users/Patryk/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude -I/Users/Patryk/OpenFOAM/OpenFOAM-2.4.0/src/OSspecific/POSIX/lnInclude  -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc48DPOpt/UIPread.o
SOURCE=UOPwrite.C ;  g++-mp-4.8 -m64 -fsignaling-nans  -ftrapping-math -fdiagnostics-color=always -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100  -IlnInclude -I. -I/Users/Patryk/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude -I/Users/Patryk/OpenFOAM/OpenFOAM-2.4.0/src/OSspecific/POSIX/lnInclude  -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc48DPOpt/UOPwrite.o
SOURCE=UPstream.C ;  g++-mp-4.8 -m64 -fsignaling-nans  -ftrapping-math -fdiagnostics-color=always -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100  -IlnInclude -I. -I/Users/Patryk/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude -I/Users/Patryk/OpenFOAM/OpenFOAM-2.4.0/src/OSspecific/POSIX/lnInclude  -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc48DPOpt/UPstream.o
g++-mp-4.8: error: unrecognized command line option '-fdiagnostics-color=always'
g++-mp-4.8: error: unrecognized command line option '-fdiagnostics-color=always'
g++-mp-4.8: error: unrecognized command line option '-fdiagnostics-color=always'
make: *** [Make/darwinIntel64Gcc48DPOpt/UIPread.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Make/darwinIntel64Gcc48DPOpt/UPstream.o] Error 1
make: *** [Make/darwinIntel64Gcc48DPOpt/UOPwrite.o] Error 1
+ case "$WM_MPLIB" in
+ set +x


jjstickel August 5, 2015 18:02

OpenFOAM-2.4.x-Mac.patch works for me
 
Thanks for the patch. Works for me on 10.10.4 with MacPorts providing dependencies and gcc-4.9 compiler.

Some hints for those having trouble. Install the following via Macports:
scotch +gcc49 -mpich +openmpi
cgal
flex
metis +gcc49
ccache
bison
boost
qt4-mac

Make sure to create and use properly the case-sensitive journaled sparse image (documented elsewhere). I link the image mountpoint (usually in /Volume) to $HOME.

Edit ~/OpenFOAM/OpenFOAM-2.4.0/etc/bashrc as follows:

export WM_NCOMPPROCS=N # add this line, N from: "sysctl -n hw.ncpu"
export WM_COMPILER=Gcc49 # change compiler you want
export WM_MPLIB=SYSTEMOPENMPI # check this, should be OK

Then,

Code:

cd ~/OpenFOAM/OpenFOAM-2.4.0/
source etc/bashrc
./Allwmake 2>&1 | tee build.log


ali.m.1 August 13, 2015 11:25

Hi

Do you know how to install db 48 separately? I have it on my mac (10.10.4), but when I try to set it to a port, it says
Quote:

Selecting 'db48' for 'db' failed: The configuration file '/opt/local/etc/select/db/base' could not be opened.
It's like when it was installed, it never installed properly. Do you know how I can install it again?

Thanks for the help.

jjstickel August 13, 2015 11:48

Quote:

Originally Posted by ali.m.1 (Post 559461)
Hi

Do you know how to install db 48 separately? I have it on my mac (10.10.4), but when I try to set it to a port, it says
It's like when it was installed, it never installed properly. Do you know how I can install it again?

Thanks for the help.

I think this is a macports question. You would probably have better luck asking on the macports-users email list.

Roskiki August 13, 2015 22:34

openfoam error
 
2 Attachment(s)
the error message is obtained by compiling OpenFOAM on Mac YosemiteAttachment 41406

Attachment 41407


-lfiniteVolume -lmeshTools -lOpenFOAM -ldl -lpthread -lm -o /Users/Mowa/OpenFOAM23/OpenFOAM-2.4.x/platforms/darwinIntel64Gcc49DPOpt/bin/solidEquilibriumDisplacementFoam
ld: library not found for -lfiniteVolume
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/Mowa/OpenFOAM23/OpenFOAM-2.4.x/platforms/darwinIntel64Gcc49DPOpt/bin/solidEquilibriumDisplacementFoam] Error 1
make[1]: *** [solidEquilibriumDisplacementFoam] Error 2
make[1]: Target `application' not remade because of errors.
make: *** [stressAnalysis] Error 2
make: Target `application' not remade because of errors.

bvangelis August 30, 2015 08:53

Hi,
I followed the instructions and everything compiled with no errors on OS X 10.10.5 with mp-gcc52. However, when running blockmesh for the cavity tutorial I am getting "Segmentation fault: 11". Any clues?

kubabanana75 September 23, 2015 14:43

Installation works without selecting db48
 
Quote:

Originally Posted by ali.m.1 (Post 559461)
Selecting 'db48' for 'db' failed: The configuration file '/opt/local/etc/select/db/base' could not be opened.

Hi everyone,

first of all thanks for the patch!

I had the same issue with selecting db48. But I was able to install OpenFOAM 2.4.x on OX 10.10.5 by simply ignoring that error message :D.

I also used the "hints" from post #5

j_moulton June 1, 2016 14:55

Hi. Following your hints and the only step I don't follow is this one.
Quote:

Originally Posted by jjstickel (Post 558511)
export WM_NCOMPPROCS=N # add this line, N from: "sysctl -n hw.ncpu"

I don't have a line in my bashrc file with "sysctl -n hw.ncpu". Can I insert the line you provided as is-and where would that be?-or is there any additional work that must be included?

jjstickel June 1, 2016 17:49

Quote:

Originally Posted by j_moulton (Post 602890)
Hi. Following your hints and the only step I don't follow is this one.

I don't have a line in my bashrc file with "sysctl -n hw.ncpu". Can I insert the line you provided as is-and where would that be?-or is there any additional work that must be included?

You add the line

Code:

export WM_NCOMPPROCS=N
Where 'N' is the number of cpus on your computer. You can determine that by running "sysctl -n hw.ncpu" in a terminal. I added it to the top section where it says "USER EDITABLE PART", but it can go anywhere.


All times are GMT -4. The time now is 11:41.