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

OF 1.9 (aka OF 2.1) on Mac OS X

Register Blogs Community New Posts Updated Threads Search

Like Tree25Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 29, 2012, 17:05
Default
  #1
qzt
New Member
 
Join Date: Aug 2012
Posts: 10
Rep Power: 13
qzt is on a distinguished road
Hello,

I just uploaded the disk image (dmg file) of OpenFOAM-2.1.0 compiled on my macbookpro running lion (os 10.7).
Maybe someone having difficulty to compile or want to save some time can just use it.

http://bit.ly/QzxHFG

I think after mounting the disk image, one can try to source the bashrc and run the foamInstallationTest to see if it works on your mac.
qzt is offline   Reply With Quote

Old   September 9, 2012, 11:53
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
For future reference and to complement qzt's post, I think the following instructions should help people use this image (personally I haven't tested them ):
__________________
wyldckat is offline   Reply With Quote

Old   September 19, 2012, 13:31
Default
  #3
BCD
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
BCD is on a distinguished road
Is it still necessary to install these patches when installing OF 2.1.1 on a Mac 10.6.8?
BCD is offline   Reply With Quote

Old   September 19, 2012, 16:26
Default
  #4
New Member
 
David Young
Join Date: Aug 2012
Posts: 3
Rep Power: 13
discodave is on a distinguished road
Bernhard / Bruno,

Sorry for the delay in getting back to you.

After trying many things and still failing and getting errors I installed mountain lion, latest version of Xcode and started again.

I am happy to say following all the instruction on this thread I now have a functional version of OpenFOAM.

Thank you for your help.
discodave is offline   Reply With Quote

Old   September 19, 2012, 16:30
Default
  #5
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 BCD View Post
Is it still necessary to install these patches when installing OF 2.1.1 on a Mac 10.6.8?
I'd think so. Yes (unless Mac support crept into the official release). They basically fix issues where headers are located differently on the Mac, the completely different dynamic linker and the completely different ABI (to allow tracebacks)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   September 24, 2012, 02:19
Default blockMesh but no icoFOAM
  #6
BCD
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
BCD is on a distinguished road
So, I've tried compiling a few times now with increasing success but something is still eluding me.
I can run blockMesh on a copy of a tutorial case but the icoFOAM command is not found.
Does any of this make you laugh?
Thanks.

here's what I've done so far:

Running Mac 10.6.8
OpenFOAM 2.1.1
ThirdParty 2.1.1
gcc4.2.1
Open MPI 1.5.3

I've edited the patch name to
ThirdParty-2.1.1-Mac.patch
and deleted the seven lines at the end preceding the
\ No newline at end of file
and applied it within the ThirdParty-2.1.1 directory

And applied these within the OpenFOAM-2.1.1 directory
OpenFOAM-2.1.x-Mac.patch
OpenFOAM-2.1.x-Mac-gcc46.patch

and finally I've edited the OpenFOAM-2.1.1>etc>bashrc file with:
export WM_COMPILER=Gcc46
ulimit -n 1024
export WM_NCOMPPROCS=2
and
just before the #-------- end of File
added
export WM_CC='gcc-mp-4.6'
export WM_CXX='g++-mp-4.6'
BCD is offline   Reply With Quote

Old   September 24, 2012, 10:13
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Did you check if gcc 4.6 is visible?
Code:
which gcc-mp-4.6
which g++-mp-4.6
__________________
wyldckat is offline   Reply With Quote

Old   September 24, 2012, 10:23
Default
  #8
BCD
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
BCD is on a distinguished road
Thanks Bruno,

from the prompt I get:

$ which gcc-mp-4.6
/opt/local/bin/gcc-mp-4.6


and


$ which g++-mp-4.6
/opt/local/bin/g++-mp-4.6


does this help?
BCD is offline   Reply With Quote

Old   September 24, 2012, 10:37
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Mmm... OK, so my hunch wasn't correct

OK, then I suggest following the instructions from section "2.6.1 Diagnosing problems ": http://openfoamwiki.net/index.php/Ho...osing_problems
__________________
wyldckat is offline   Reply With Quote

Old   September 24, 2012, 11:42
Default
  #10
BCD
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
BCD is on a distinguished road
here are some of the first error messages, which I read often hold the clues we need:

mkdir /Users/User7/OpenFOAM/ThirdParty-2.1.1/platforms/darwinIntel64Gcc46/scotch_5.1.11/include/openmpi-1.5.3
cp -f ../bin/[agm]* /Users/User7/OpenFOAM/ThirdParty-2.1.1/platforms/darwinIntel64Gcc46/scotch_5.1.11/bin
cp: ../bin/[agm]*: No such file or directory
make: [install] Error 1 (ignored)


Undefined symbols for architecture x86_64:
"Foam::incompressible::turbulenceModel::typeNa me", referenced from:
Foam::calc(Foam::argList const&, Foam::Time const&, Foam::fvMesh const&) in R.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[3]: *** [/Users/User7/OpenFOAM/OpenFOAM-2.1.1/platforms/darwinIntel64Gcc46DPOpt/bin/R] Error 1
make[2]: *** [R] Error 2
BCD is offline   Reply With Quote

Old   September 24, 2012, 11:47
Default
  #11
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
See post #87: http://www.cfd-online.com/Forums/ope...tml#post370219
__________________
wyldckat is offline   Reply With Quote

Old   September 24, 2012, 12:06
Default
  #12
BCD
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
BCD is on a distinguished road
Thanks Bruno,
I really appreciate your wisdom & tenacity here.

wmake failed, here's the log,
Attached Files
File Type: zip wmake log.txt.zip (1.1 KB, 9 views)
BCD is offline   Reply With Quote

Old   September 24, 2012, 12:10
Default
  #13
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
BCD, you should have kept reading
See post #89: http://www.cfd-online.com/Forums/ope...tml#post370256 - and see #90 as well, just in case...
__________________
wyldckat is offline   Reply With Quote

Old   November 16, 2012, 18:45
Default
  #14
Member
 
Join Date: Feb 2011
Posts: 41
Rep Power: 15
jollage is on a distinguished road
Hi All,
Thanks to your guys for this awesome thread!

I have a question in compiling. Things seem to be fine in the beginning, but then it stops due to missing libraries. There are a lot similar messages, one of them is like

g++-mp-4.6 -m64 -fsignaling-nans -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2 -DNoRepository -ftemplate-depth-100 -IphaseModel/lnInclude -ImultiphaseSystem/lnInclude -ImultiphaseFixedFluxPressure -IinterfacialModels/lnInclude -I/Users/user/OpenFOAM/OpenFOAM-2.1.0/src/transportModels -I/Users/user/OpenFOAM/OpenFOAM-2.1.0/src/transportModels/incompressible/lnInclude -I/Users/user/OpenFOAM/OpenFOAM-2.1.0/src/transportModels/interfaceProperties/lnInclude -I/Users/user/OpenFOAM/OpenFOAM-2.1.0/src/transportModels/incompressible/lnInclude -I/Users/user/OpenFOAM/OpenFOAM-2.1.0/src/transportModels/incompressible/singlePhaseTransportModel -I/Users/user/OpenFOAM/OpenFOAM-2.1.0/src/turbulenceModels -I/Users/user/OpenFOAM/OpenFOAM-2.1.0/src/turbulenceModels/incompressible/LES/LESModel -I/Users/user/OpenFOAM/OpenFOAM-2.1.0/src/turbulenceModels/LES/LESdeltas/lnInclude -I/Users/user/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude -IlnInclude -I. -I/Users/user/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude -I/Users/user/OpenFOAM/OpenFOAM-2.1.0/src/OSspecific/POSIX/lnInclude -fPIC -Ddarwin -lpthread -L/Users/user/OpenFOAM/OpenFOAM-2.1.0/platforms/darwinIntel64Gcc46DPOpt/lib/openmpi-1.5.3 -lPstream Make/darwinIntel64Gcc46DPOpt/multiphaseEulerFoam.o Make/darwinIntel64Gcc46DPOpt/multiphaseFixedFluxPressureFvPatchScalarField.o -L/Users/user/OpenFOAM/OpenFOAM-2.1.0/platforms/darwinIntel64Gcc46DPOpt/lib \
-lmultiphaseSystem -lcompressibleMultiPhaseModel -linterfaceProperties -lincompressibleTransportModels -lcompressibleMultiphaseEulerianInterfacialModels -lincompressibleTurbulenceModel -lincompressibleLESModels -lfiniteVolume -lOpenFOAM -ldl -lpthread -lm -o /Users/user/OpenFOAM/OpenFOAM-2.1.0/platforms/darwinIntel64Gcc46DPOpt/bin/multiphaseEulerFoam
ld: library not found for -lmultiphaseSystem
collect2: ld returned 1 exit status
make[2]: *** [/Users/user/OpenFOAM/OpenFOAM-2.1.0/platforms/darwinIntel64Gcc46DPOpt/bin/multiphaseEulerFoam] Error 1
make[1]: *** [multiphaseEulerFoam] Error 2


It says library libmultiphaseSystem.dylib can not be found. I checked /Users/user/OpenFOAM/OpenFOAM-2.1.0/platforms/darwinIntel64Gcc46DPOpt/lib and no such library is there.

I stick pretty much to the tutorial. Could you help me on this? Thanks a lot in advance.

My configuration is OS X 10.7.5, Macport Gcc46, mpirun 1.6.3.

Mq
jollage is offline   Reply With Quote

Old   November 17, 2012, 11:21
Default
  #15
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Jollage,

Not enough information to work with
Please read the following section, since I don't feel like copy-pasting the whole section : 2.6.1 Diagnosing problems

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   November 18, 2012, 07:29
Default
  #16
Member
 
Join Date: Feb 2011
Posts: 41
Rep Power: 15
jollage is on a distinguished road
Hi Bruno,

thanks for your reply. The log file of make in my case is attached. Please change the file make.log1.zip to make.log.zip.001 and likewise for make.log2.zip. And unzip them in a same folder. The original log file is too big for the maximum filesize of uploaded files. Please have a look, thank you very much!

Cheers,
Mq
Attached Files
File Type: zip make.log1.zip (95.0 KB, 1 views)
File Type: zip make.log2.zip (45.1 KB, 1 views)

Last edited by jollage; November 18, 2012 at 09:21.
jollage is offline   Reply With Quote

Old   November 18, 2012, 10:24
Default
  #17
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Mq,

The problem is this:
Code:
Make/darwinIntel64Gcc46DPOpt/readSTLASCII.C:5963:8: error: prototype for 'size_t yyFlexLexer::LexerInput(char*, size_t)' does not match any in class 'yyFlexLexer'
/usr/include/FlexLexer.h:133:14: error: candidate is: virtual int yyFlexLexer::LexerInput(char*, int)
Make/darwinIntel64Gcc46DPOpt/readSTLASCII.C:5990:6: error: prototype for 'void yyFlexLexer::LexerOutput(const char*, size_t)' does not match any in class 'yyFlexLexer'
/usr/include/FlexLexer.h:134:15: error: candidate is: virtual void yyFlexLexer::LexerOutput(const char*, int)
Make/darwinIntel64Gcc46DPOpt/readSTLASCII.C: In member function 'int yyFlexLexer::yy_get_next_buffer()':
Looks like something is wrong with your flex version... To check which version of flex you have, run:
Code:
flex --version
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   November 18, 2012, 10:39
Default
  #18
Member
 
Join Date: Feb 2011
Posts: 41
Rep Power: 15
jollage is on a distinguished road
Hi Bruno,

The result is flex 2.5.35 Apple(flex-31). Which version should I use? Thanks.

Mq
jollage is offline   Reply With Quote

Old   November 18, 2012, 11:34
Default
  #19
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Mq,

Strange... flex 2.5.35 should do the trick... I suppose you should try the latest one from macports instead!

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   November 18, 2012, 18:10
Default
  #20
Member
 
Join Date: Feb 2011
Posts: 41
Rep Power: 15
jollage is on a distinguished road
Hi Bruno,

Indeed, I should use flex in Macport. Thanks a lot!!!

I don't have a clear clue about what is going on here (i'm new to linux), could you tell me what's the procedure of the compilation? What rule does flex play here?

It's awesome I finally have it running on my Mac. Thanks again.

Mq
jollage is offline   Reply With Quote

Reply

Tags
compilation error


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
Extend Project 1.6-ext Binary Release for Mac OS X hjasak OpenFOAM Announcements from Other Sources 26 November 5, 2013 16:50
Openfoam mac: Compiling custom libraries atareen64 OpenFOAM 3 April 14, 2011 11:01
OpenFOAM-1.6 on Mac OS X 10.6.1 elvisjohndowson OpenFOAM 6 October 21, 2009 15:45
Mac Simple Install Request or Processing Assistance Help sjohnson OpenFOAM Installation 4 December 12, 2008 07:46
MAC + SOLA for free surface T Main CFD Forum 1 April 11, 2001 13:43


All times are GMT -4. The time now is 09:29.