CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   2.0.x on Mac OSX (https://www.cfd-online.com/Forums/openfoam-installation/89752-2-0-x-mac-osx.html)

gschaider September 14, 2011 04:40

Quote:

Originally Posted by woodscn (Post 324022)
Perhaps unsurprisingly, the patch provided above doesn't work with ThirdParty-2.0.1, which is what's available now.

Is there a place I can find the old files? Is there a timeline for a new patch?

I wasn't aware of this problem (usually I don't touch ThirdParty). Can you tell me where it fails.

@old files: have you tried at the Sourceforge (the original foam project). Usually there is a history of all there is

@timeline: No. Once I know what the problem is I can assess how long it takes

woodscn September 14, 2011 09:56

It fails on hunk 4 at 200.
I'd give you an exact quote, but I don't have the disk image ready anymore. The error wasn't really much more than that, anyway.

gschaider September 14, 2011 14:07

Quote:

Originally Posted by woodscn (Post 324108)
It fails on hunk 4 at 200.
I'd give you an exact quote, but I don't have the disk image ready anymore. The error wasn't really much more than that, anyway.

If I hadn't miscounted that would be Allwmake:
Code:

@@ -206,7 +217,10 @@
 
    # this needs generalizing
    makeFile=../../etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM
-
+    if [ "$WM_ARCH_BASE" == "darwin" ]   
+      then
+      makeFile=../../etc/wmakeFiles/scotch/Makefile.inc.i686_mac_darwin.shlib-OpenFOAM
+    fi
    if [ -f $makeFile -a ! -f Makefile.inc ]
    then
        rm -f Makefile.inc

I guess that the promise "this needs generalizing" was fulfilled in the new version and therefore the patch doesn't find its place.

I currently don't have time to look at Thirdparty-2.0.1 (let alone recompile it).

But if only this chunk fails things are not that bad: The Makefile for Darwin should have been produced by the patch. Have a look at Allwmake how makeFile is set now and point it to the darwin file.

Bernhard

xtphgu September 19, 2011 08:04

Hi I'm new hire and first of all sorry for my bad english...

My problem is: I can not give openFOAM commands

-I installed OpenFOAM 2.0.1 with patches and Gcc46 on Lion 10.7.1, like sushant describes.
-After compile twice I had no error massage anymore.
-bashrc load if I start Terminal.

For example I tryed blockMesh in the tutorials but I always get the answer "command not found".

Do anyone have any idea?

Benny

sushant September 19, 2011 09:19

Quote:

Originally Posted by xtphgu (Post 324665)
Hi I'm new hire and first of all sorry for my bad english...

My problem is: I can not give openFOAM commands

-I installed OpenFOAM 2.0.1 with patches and Gcc46 on Lion 10.7.1, like sushant describes.
-After compile twice I had no error massage anymore.
-bashrc load if I start Terminal.

For example I tryed blockMesh in the tutorials but I always get the answer "command not found".

Do anyone have any idea?

Benny

Hi Benny, can you try these commands one at a time in a terminal (make sure bashrc is sourced in your ~/.profile) and share the output you get?

Code:

find $FOAM_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION/platforms | grep -w blockMesh

echo $FOAM_APPBIN

echo $PATH


xtphgu September 19, 2011 10:53

Thanks Sushant,

I added this in my ".profile":

hdiutil attach "$HOME/OpenFOAM/Mac-OF-2.0.dmg" -mountpoint "$HOME/OpenFOAM" > /dev/null
. ~/OpenFOAM/OpenFOAM-2.0.1/etc/bashrc

Locks like it works (no error message by starting Terminal)

The output from your Code:
bennyskiste:~ Benny$ find $FOAM_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION/platforms | grep -w blockMesh

bennyskiste:~ Benny$ echo $FOAM_APPBIN
/Users/Benny/OpenFOAM/OpenFOAM-2.0.1/platforms/darwinIntel64GccDPOpt/bin

bennyskiste:~ Benny$ echo $PATH
/Users/Benny/OpenFOAM/ThirdParty-2.0.1/platforms/darwinIntel64Gcc/paraview-3.10.1/bin:/Users/Benny/OpenFOAM/ThirdParty-2.0.1/platforms/darwinIntel64Gcc/openmpi-1.5.3/bin:/Users/Benny/OpenFOAM/Benny-2.0.1/platforms/darwinIntel64GccDPOpt/bin:/Users/Benny/OpenFOAM/site/2.0.1/platforms/darwinIntel64GccDPOpt/bin:/Users/Benny/OpenFOAM/OpenFOAM-2.0.1/platforms/darwinIntel64GccDPOpt/bin:/Users/Benny/OpenFOAM/OpenFOAM-2.0.1/bin:/Users/Benny/OpenFOAM/OpenFOAM-2.0.1/wmake:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin

???

xtphgu September 19, 2011 10:54

double post because my internet made some problems...

gschaider September 20, 2011 05:15

Quote:

Originally Posted by xtphgu (Post 324695)
Thanks Sushant,

I added this in my ".profile":

hdiutil attach "$HOME/OpenFOAM/Mac-OF-2.0.dmg" -mountpoint "$HOME/OpenFOAM" > /dev/null
. ~/OpenFOAM/OpenFOAM-2.0.1/etc/bashrc

Locks like it works (no error message by starting Terminal)

The output from your Code:
bennyskiste:~ Benny$ find $FOAM_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION/platforms | grep -w blockMesh

bennyskiste:~ Benny$ echo $FOAM_APPBIN
/Users/Benny/OpenFOAM/OpenFOAM-2.0.1/platforms/darwinIntel64GccDPOpt/bin

bennyskiste:~ Benny$ echo $PATH
/Users/Benny/OpenFOAM/ThirdParty-2.0.1/platforms/darwinIntel64Gcc/paraview-3.10.1/bin:/Users/Benny/OpenFOAM/ThirdParty-2.0.1/platforms/darwinIntel64Gcc/openmpi-1.5.3/bin:/Users/Benny/OpenFOAM/Benny-2.0.1/platforms/darwinIntel64GccDPOpt/bin:/Users/Benny/OpenFOAM/site/2.0.1/platforms/darwinIntel64GccDPOpt/bin:/Users/Benny/OpenFOAM/OpenFOAM-2.0.1/platforms/darwinIntel64GccDPOpt/bin:/Users/Benny/OpenFOAM/OpenFOAM-2.0.1/bin:/Users/Benny/OpenFOAM/OpenFOAM-2.0.1/wmake:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin

???

Is there ANYTHING in FOAM_APPBIN or FOAM_LIBBIN (check with "ls $FOAM_APPBIN"). My suspicion is that one crucial library was not built in the beginning and everything that links to it was not built

xtphgu September 20, 2011 06:55

Could be a problem that I built not just the Gcc46 but also Gcc45?

ls $FOAM_APPBIN
-> no answare

LS $FOAM_APPBIN
dummy libsolid.dylib
libODE.dylib libsolidMixtureProperties.dylib
libOSspecific.o libsolidProperties.dylib
libdistributionModels.dylib libspecie.dylib
libfileFormats.dylib libsurfMesh.dylib
libkineticTheoryModel.dylib libthermophysicalFunctions.dylib
libliquidMixtureProperties.dylib libtriSurface.dylib
libliquidProperties.dylib postCalc.o
libmolecularMeasurements.dylib

gschaider September 20, 2011 08:11

Quote:

Originally Posted by xtphgu (Post 324835)
Could be a problem that I built not just the Gcc46 but also Gcc45?

ls $FOAM_APPBIN
-> no answare

LS $FOAM_APPBIN
dummy libsolid.dylib
libODE.dylib libsolidMixtureProperties.dylib
libOSspecific.o libsolidProperties.dylib
libdistributionModels.dylib libspecie.dylib
libfileFormats.dylib libsurfMesh.dylib
libkineticTheoryModel.dylib libthermophysicalFunctions.dylib
libliquidMixtureProperties.dylib libtriSurface.dylib
libliquidProperties.dylib postCalc.o
libmolecularMeasurements.dylib

There are some very basic libraries missin (most notably libOpenFOAM.dylib). This means that ther is a problem at the beginning of the compilation. Try compiling with a log:

./Allwmake 2>&1 | tee compile.log

Then have a look at compile.log FROM THE TOP and report the first error you see (don't bother to post the whole log. I won't look at it)

xtphgu September 20, 2011 08:33

my first errors:

configure: error: in `/Users/Benny/OpenFOAM/ThirdParty-2.0.1/openmpi-1.5.3':
configure: error: C compiler cannot create executables

You can get the whole compile.log file by using this link:

https://dataexchange.hs-bremen.de/exchange?g=3fsdnh

gschaider September 20, 2011 11:24

Quote:

Originally Posted by xtphgu (Post 324855)
my first errors:

configure: error: in `/Users/Benny/OpenFOAM/ThirdParty-2.0.1/openmpi-1.5.3':
configure: error: C compiler cannot create executables

You can get the whole compile.log file by using this link:

https://dataexchange.hs-bremen.de/exchange?g=3fsdnh

Are you sure that the compiler you configured exists? Or is in the path? Because it looks like the ThirdParty-stuff can't find it

xtphgu September 20, 2011 13:03

Quote:

Originally Posted by gschaider (Post 324896)
Are you sure that the compiler you configured exists? Or is in the path? Because it looks like the ThirdParty-stuff can't find it

The path exist. I`m doing all the compiling once again and I`m wondering why after I typed sudo port install openmpi +gcc46 I get
...
---> Building gcc44

A question about the patches:
I still use the path site/2.0.x for prefs.sh even though I'm unsung 2.0.1 ?

That's the result of the ThirdParty-patch:

patching file Allwmake
Hunk #3 succeeded at 199 with fuzz 1 (offset 3 lines).
Hunk #4 FAILED at 220.
1 out of 5 hunks FAILED -- saving rejects to file Allwmake.rej
patching file etc/wmakeFiles/scotch/Makefile.inc.i686_mac_darwin.shlib-OpenFOAM

gschaider September 21, 2011 05:44

Quote:

Originally Posted by xtphgu (Post 324909)
The path exist. I`m doing all the compiling once again and I`m wondering why after I typed sudo port install openmpi +gcc46 I get
...
---> Building gcc44

A question about the patches:
I still use the path site/2.0.x for prefs.sh even though I'm unsung 2.0.1 ?

That's the result of the ThirdParty-patch:

patching file Allwmake
Hunk #3 succeeded at 199 with fuzz 1 (offset 3 lines).
Hunk #4 FAILED at 220.
1 out of 5 hunks FAILED -- saving rejects to file Allwmake.rej
patching file etc/wmakeFiles/scotch/Makefile.inc.i686_mac_darwin.shlib-OpenFOAM

About OpenMPI. Why don't you use the one that comes with the system?

About the patch. I've been told that the patch doesn't work with 2.0.1 but I haven't got the time to look into it. I remembered discussing it elsewhere (I think even in this thread). Have a look

sushant September 21, 2011 07:34

Quote:

Originally Posted by xtphgu (Post 324909)
The path exist. I`m doing all the compiling once again and I`m wondering why after I typed sudo port install openmpi +gcc46 I get
...
---> Building gcc44

Last time I checked OpenMPI on MacPorts did not have a GCC46 variant. Are you sure there's one? The default variant depends on gcc44 and pulls it along. Since you're on Lion, you can easily build the openmpi-1.5.3 in ThirdParty (2.0.0!) and use it instead of the one from MacPorts.

As for your multiple compilers issue, I prefer to have ONE compiler, one text editor, one music player, one web browser, one girl, and so on and so forth; but I see that it makes sense for many people to need to have more than one. (compiler :p ). Sometimes it's easy to troubleshoot where there is only one possible culprit in each category, so if you don't really need it, you can do away with the multiple compilers.

If you're wondering if the site/prefs.sh is doing its job, you can use this alternative: put these lines in ~/.profile before you source bashrc:

export WM_MPLIB=OPENMPI #only for Lion; for SL stick to SYSTEMOPENMPI
export WM_COMPILER=Gcc46

In any case, gcc-mp-4.6 is not working on your system (that's what your log seems to say), so you can check with the commands:
gcc-mp-4.6 -v
g++-mp-4.6 -v

and also maybe make sure your disk image isn't read-only?

---
Others: while we're on this subject, what is the simplest way to tell wmake to use clang instead of the stock gcc? Does OF-2.0.x build successfully with the stock clang on OS X?


Regards,
Sushant

xtphgu September 21, 2011 12:30

Quote:

Originally Posted by sushant (Post 325048)
As for your multiple compilers issue, I prefer to have ONE compiler, one text editor, one music player, one web browser, one girl, and so on and so forth; but I see that it makes sense for many people to need to have more than one. (compiler :p ). Sometimes it's easy to troubleshoot where there is only one possible culprit in each category, so if you don't really need it, you can do away with the multiple compilers.

I thought I need this compiler because Lion isn't shipping with one:

Quote:

Originally Posted by sushant (Post 321949)
In ~/OpenFOAM/site/2.0.x/prefs.sh change Gcc45 to Gcc46. Comment out the WM_MPLIB line, or change SYSTEMOPENMPI to simply OPENMPI (have to build your own MPI, Lion isn't shipping with one)

How do I use openmpi-1.5.3 in ThirdParty? By comment out or using OPENMPI?

Quote:

Originally Posted by sushant (Post 325048)
In any case, gcc-mp-4.6 is not working on your system (that's what your log seems to say), so you can check with the commands:
gcc-mp-4.6 -v
g++-mp-4.6 -v

You are right. During the compiling gcc46 I get this Error:

Error: Target org.macports.build returned: shell command failed (see log for details)
Log for gcc46 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org _release_tarballs_ports_lang_gcc46/gcc46/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

Hier the whole Log:
https://dataexchange.hs-bremen.de/exchange?g=e5yr2l

Quote:

Originally Posted by sushant (Post 325048)
and also maybe make sure your disk image isn't read-only?

It is a sparseimage.

Thanks a lot for all your help!!!!
Benny

One More question: Why do I need Xcode, Gcc46 and compiling it if I just want to use the program OpenFOAM?

sushant September 22, 2011 01:23

Quote:

Originally Posted by xtphgu (Post 325105)
I thought I need this compiler because Lion isn't shipping with one:

I'm so sorry -- I meant this about multiple versions from MacPorts. about having both 4.5 and 4.6, etc.



Quote:

How do I use openmpi-1.5.3 in ThirdParty? By comment out or using OPENMPI?
export WM_MPLIB=OPENMPI
in the site/2.0.x/prefs.sh, or my nonstandard, possibly ugly way is to set that in ~/.profile itself. Either way, you can always 'echo $WM_MPLIB' before doing ./Allwmake to verify.


Quote:

During the compiling gcc46 I get this Error:
Error: Target org.macports.build returned: shell command failed (see log for details)...
Thats what happens with gcc44 and gcc45 on Lion but shouldn't happen with gcc46. To start afresh, do a 'sudo port uninstall installed' (use -force if need be) and start afresh. (assuming you don't use MacPorts for anything else)

Quote:

One More question: Why do I need Xcode, Gcc46 and compiling it if I just want to use the program OpenFOAM?
Because there isn't a readily usable "binary" version for Lion. In fact OF is not written with Mac OS in mind at all: any possibility of using it is largely due to patches churned out by muscle man bernhard.:)

For OS X 10.6, see the link in my signature for a binary image.

xtphgu September 22, 2011 10:27

Quote:

Originally Posted by sushant (Post 325163)
Thats what happens with gcc44 and gcc45 on Lion but shouldn't happen with gcc46. To start afresh, do a 'sudo port uninstall installed' (use -force if need be) and start afresh. (assuming you don't use MacPorts for anything else)

Strange... I've got always error during compiling Gcc46. Now I tested gcc45 and I could compile it. Then I did 'sudo port install openmpi +gcc45'
I downloaded the image from http://sourceforge.net/projects/macopenfoam/files/
and OF works :):):D

unfortunately the command 'mpirun' can not find???

Quote:

Originally Posted by sushant (Post 325163)
Because there isn't a readily usable "binary" version for Lion. In fact OF is not written with Mac OS in mind at all: any possibility of using it is largely due to patches churned out by muscle man bernhard.:)

For OS X 10.6, see the link in my signature for a binary image.

OK but if someone compile it (like in the link above), why I don't can I can just use this compiled version? Why do I need Xcode, gcc and openmpi on my system too?

sushant September 22, 2011 12:40

Quote:

unfortunately the command 'mpirun' can not find???
I've faced the same thing with the openmpi from MacPorts... :(

Quote:

OK but if someone compile it (like in the link above), why I don't can I can just use this compiled version? Why do I need Xcode, gcc and openmpi on my system too?
Binaries depend upon certain libraries to work (lookup 'dynamic linking' and/or 'dylib'). So you don't really need the compilers but just the libraries which are part of the development suite. If you want to free up some (a lot of!) space, just delete /Developer (yes, really). A copy of the basic dev tools is in / anyway: thats the useful one.

You need the newer gcc because stock apple gcc is too old to compile this.

xtphgu September 22, 2011 13:58

Quote:

Originally Posted by sushant (Post 325263)
I've faced the same thing with the openmpi from MacPorts... :(

Do you think that will change soon? You know CFD calculation needs a lot of computing resources ;)

Quote:

Originally Posted by sushant (Post 325263)
Binaries depend upon certain libraries to work (lookup 'dynamic linking' and/or 'dylib'). So you don't really need the compilers but just the libraries which are part of the development suite. If you want to free up some (a lot of!) space, just delete /Developer (yes, really). A copy of the basic dev tools is in / anyway: thats the useful one.

You need the newer gcc because stock apple gcc is too old to compile this.

Thanks, that's great :) /opt (2.4GB) I still need? I'm asking because I've got a SSD and not much space...


All times are GMT -4. The time now is 22:00.