CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

2.0.x on Mac OSX

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 14, 2011, 05:40
Default
  #21
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by woodscn View Post
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
gschaider is offline   Reply With Quote

Old   September 14, 2011, 10:56
Default
  #22
New Member
 
Nathan Woods
Join Date: Sep 2011
Posts: 2
Rep Power: 0
woodscn is on a distinguished road
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.
woodscn is offline   Reply With Quote

Old   September 14, 2011, 15:07
Default
  #23
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by woodscn View Post
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
gschaider is offline   Reply With Quote

Old   September 19, 2011, 09:04
Default
  #24
New Member
 
Benjamin Stanke
Join Date: Sep 2011
Posts: 18
Rep Power: 15
xtphgu is on a distinguished road
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
xtphgu is offline   Reply With Quote

Old   September 19, 2011, 10:19
Default
  #25
Member
 
sushant's Avatar
 
Join Date: Mar 2009
Location: Switzerland
Posts: 40
Rep Power: 17
sushant is on a distinguished road
Quote:
Originally Posted by xtphgu View Post
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
__________________
If you only have a hammer, you tend to see every problem as a nail.
sushant is offline   Reply With Quote

Old   September 19, 2011, 11:53
Default
  #26
New Member
 
Benjamin Stanke
Join Date: Sep 2011
Posts: 18
Rep Power: 15
xtphgu is on a distinguished road
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 is offline   Reply With Quote

Old   September 19, 2011, 11:54
Default
  #27
New Member
 
Benjamin Stanke
Join Date: Sep 2011
Posts: 18
Rep Power: 15
xtphgu is on a distinguished road
double post because my internet made some problems...
xtphgu is offline   Reply With Quote

Old   September 20, 2011, 06:15
Default
  #28
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by xtphgu View Post
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
gschaider is offline   Reply With Quote

Old   September 20, 2011, 07:55
Default
  #29
New Member
 
Benjamin Stanke
Join Date: Sep 2011
Posts: 18
Rep Power: 15
xtphgu is on a distinguished road
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
xtphgu is offline   Reply With Quote

Old   September 20, 2011, 09:11
Default
  #30
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by xtphgu View Post
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)
gschaider is offline   Reply With Quote

Old   September 20, 2011, 09:33
Default
  #31
New Member
 
Benjamin Stanke
Join Date: Sep 2011
Posts: 18
Rep Power: 15
xtphgu is on a distinguished road
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
xtphgu is offline   Reply With Quote

Old   September 20, 2011, 12:24
Default
  #32
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by xtphgu View Post
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
gschaider is offline   Reply With Quote

Old   September 20, 2011, 14:03
Default
  #33
New Member
 
Benjamin Stanke
Join Date: Sep 2011
Posts: 18
Rep Power: 15
xtphgu is on a distinguished road
Quote:
Originally Posted by gschaider View Post
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

Last edited by xtphgu; September 20, 2011 at 14:50.
xtphgu is offline   Reply With Quote

Old   September 21, 2011, 06:44
Default
  #34
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by xtphgu View Post
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
gschaider is offline   Reply With Quote

Old   September 21, 2011, 08:34
Smile
  #35
Member
 
sushant's Avatar
 
Join Date: Mar 2009
Location: Switzerland
Posts: 40
Rep Power: 17
sushant is on a distinguished road
Quote:
Originally Posted by xtphgu View Post
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 ). 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
__________________
If you only have a hammer, you tend to see every problem as a nail.
sushant is offline   Reply With Quote

Old   September 21, 2011, 13:30
Default
  #36
New Member
 
Benjamin Stanke
Join Date: Sep 2011
Posts: 18
Rep Power: 15
xtphgu is on a distinguished road
Quote:
Originally Posted by sushant View Post
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 ). 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 View Post
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 View Post
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 View Post
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?
xtphgu is offline   Reply With Quote

Old   September 22, 2011, 02:23
Wink
  #37
Member
 
sushant's Avatar
 
Join Date: Mar 2009
Location: Switzerland
Posts: 40
Rep Power: 17
sushant is on a distinguished road
Quote:
Originally Posted by xtphgu View Post
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.
__________________
If you only have a hammer, you tend to see every problem as a nail.
sushant is offline   Reply With Quote

Old   September 22, 2011, 11:27
Default
  #38
New Member
 
Benjamin Stanke
Join Date: Sep 2011
Posts: 18
Rep Power: 15
xtphgu is on a distinguished road
Quote:
Originally Posted by sushant View Post
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

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

Quote:
Originally Posted by sushant View Post
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?
xtphgu is offline   Reply With Quote

Old   September 22, 2011, 13:40
Default
  #39
Member
 
sushant's Avatar
 
Join Date: Mar 2009
Location: Switzerland
Posts: 40
Rep Power: 17
sushant is on a distinguished road
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.
__________________
If you only have a hammer, you tend to see every problem as a nail.
sushant is offline   Reply With Quote

Old   September 22, 2011, 14:58
Default
  #40
New Member
 
Benjamin Stanke
Join Date: Sep 2011
Posts: 18
Rep Power: 15
xtphgu is on a distinguished road
Quote:
Originally Posted by sushant View Post
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 View Post
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...
xtphgu is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fluent @ Mac OSx ignazio FLUENT 12 July 25, 2017 08:03
foamToTecplot360 on mac osx 10.6 SL mohanamuraly OpenFOAM 0 April 27, 2011 01:26
Mac OSX and Homebrew egp OpenFOAM Installation 1 February 15, 2011 11:21
OpenFOAM13 for Mac OSX Darwin 104 hjasak OpenFOAM Installation 70 September 24, 2010 06:06
OpenFOAM on mac OSX Nick Colam Main CFD Forum 3 January 27, 2009 01:06


All times are GMT -4. The time now is 02:52.