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   November 10, 2012, 16:10
Default
  #161
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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 to all!

@norman1981: Norman, I hope I don't mind, I've adapted your instructions and placed them on the wiki: section 2.6.3 Permanent Installation

Last but not least, a reminder to all readers: feel free to edit the wiki page if you find anything wrong with the instructions!

Best regards,
Bruno
norman1981 likes this.
__________________
wyldckat is offline   Reply With Quote

Old   November 16, 2012, 19:45
Default
  #162
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, 12:21
Default
  #163
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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, 08:29
Default
  #164
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 10:21.
jollage is offline   Reply With Quote

Old   November 18, 2012, 11:24
Default
  #165
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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, 11:39
Default
  #166
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, 12:34
Default
  #167
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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, 19:10
Default
  #168
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

Old   November 18, 2012, 19:41
Default
  #169
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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,

It's somewhat simple: flex is used for pre-processing files of the type "*.L" into actual code "*.C".
For example, "Make/darwinIntel64Gcc46DPOpt/readSTLASCII.C" from the previous error, is a file that is generated by flex from the file "readSTLASCII.L".

Er... OK, that didn't explain much... here's a quote from flex's website http://flex.sourceforge.net/:
Quote:
Overview of Flex

Flex is a tool for generating scanners. A scanner, sometimes called a tokenizer, is a program which recognizes lexical patterns in text. The flex program reads user-specified input files, or its standard input if no file names are given, for a description of a scanner to generate. The description is in the form of pairs of regular expressions and C code, called rules. Flex generates a C source file named, "lex.yy.c", which defines the function yylex(). The file "lex.yy.c" can be compiled and linked to produce an executable. When the executable is run, it analyzes its input for occurrences of text matching the regular expressions for each rule. Whenever it finds a match, it executes the corresponding C code.
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   November 19, 2012, 06:09
Default
  #170
Member
 
Join Date: Feb 2011
Posts: 41
Rep Power: 15
jollage is on a distinguished road
Hi Bruno,

OK, I see, thanks a lot for your continuous help!!

Cheers,
Mq
jollage is offline   Reply With Quote

Old   November 23, 2012, 22:14
Default
  #171
New Member
 
Green Tea
Join Date: Nov 2012
Posts: 5
Rep Power: 14
igreentea is on a distinguished road
I installed the OpenFOAM 2.1.0 on Mac OS X Lion 10.7.5 according the instruction on the web OpenFOAM wiki, and had some problems when compiling it. Please see the attached, I really don't know how to resolve them.
Looking forward your advice, thanks in advance!

Regards,
greentea
Attached Files
File Type: gz make2.log.tar.gz (1.1 KB, 0 views)
igreentea is offline   Reply With Quote

Old   November 23, 2012, 22:33
Default
  #172
New Member
 
Green Tea
Join Date: Nov 2012
Posts: 5
Rep Power: 14
igreentea is on a distinguished road
sorry, they are the whole make.log, which I divided it into two parts.
Attached Files
File Type: gz make01.log.tar.gz (37.7 KB, 1 views)
File Type: gz make02.log.tar.gz (76.6 KB, 1 views)
igreentea is offline   Reply With Quote

Old   November 24, 2012, 05:03
Default
  #173
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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 Green Tea and welcome to the forum!

Two errors occurred because somehow the patch used didn't do the fix indicated here: http://www.cfd-online.com/Forums/ope...tml#post370256 post #89

Another was something about the missing "librt" library. From what I can gather, it looks like you didn't apply with success the patch for the ThirdParty folder.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   November 25, 2012, 07:06
Default
  #174
New Member
 
Green Tea
Join Date: Nov 2012
Posts: 5
Rep Power: 14
igreentea is on a distinguished road
Thanks for your quick reply,

I fixed the first problem according to your solution, but when I patched the ThirdParty patch, there is another error message:

Code:
Xus-MacBook-Pro:ThirdParty-2.1.0 Igreentea$ patch -p1 < ThirdParty-2.1.0-Mac.patch
patching file Allwmake
patching file etc/wmakeFiles/scotch/Makefile.inc.i686_mac_darwin.shlib-OpenFOAM
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 84:
What's wrong with my process in the patching?

It's seems a long road for me to the application of OF,

Thanks a lot!

Greentea
igreentea is offline   Reply With Quote

Old   November 25, 2012, 07:24
Default
  #175
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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 Greentea,

Download again the file ThirdParty-2.1.0-Mac.patch, because the one you got seems to be incomplete!

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   November 27, 2012, 19:59
Default
  #176
New Member
 
Green Tea
Join Date: Nov 2012
Posts: 5
Rep Power: 14
igreentea is on a distinguished road
Thanks for your quick and detailed reply, Bruno,

It seems going on well when I Allwmake OF, and there is no errors appeared on the screen when compiling finished (I forget to write the make.log file), but when I try to edit my ~/.bashrc and ~/.alias files, I use the command
"cd"
and
"ls -al"
I found I could find neither of them.
I create a new ~/.bashrc by vim, and put the lines
Code:
alias of21='hdiutil attach "/PATH/TO/YOUR/DMG/OpenFOAM.dmg" -mountpoint "$HOME/OpenFOAM" > /dev/null ; . $HOME/OpenFOAM/OpenFOAM-2.1.0/etc/bashrc'
in the new file, then open a new terminal, the command "of21" doesn't work, the error info is "command not found".

I know it's a somehow foolish problem, but for a new to mac and linux, everything is a challenge,

Thanks a lot!
Greentea
igreentea is offline   Reply With Quote

Old   November 30, 2012, 14:12
Default
  #177
New Member
 
Green Tea
Join Date: Nov 2012
Posts: 5
Rep Power: 14
igreentea is on a distinguished road
Hi,Bruno

Thanks for your reference in wiki, and quick reply, now OpenFOAM can run on my mac, it's amazing!

Thanks again!

Have a nice weekend!

Greentea
igreentea is offline   Reply With Quote

Old   November 30, 2012, 18:47
Default Installing problems
  #178
New Member
 
Joan Subirats
Join Date: Nov 2012
Posts: 4
Rep Power: 14
joan.subirats is on a distinguished road
I installed OF following the installation guide on:http://openfoamwiki.net/index.php/Ho...t_Questions.3F

Apparently it is most current update, so will have to work, but OF does not work. I attached make.log file hoping you can help me.

Thanks

JS


Quote:
Originally Posted by gschaider View Post
Hi!

For those who haven't just applied the 2.0-patch to the shiny new OpenFOAM 2.1.x here comes a set of patches to get it to run.

This time you have the choice:
a) use the gcc 4.2 that comes with Apple XCode (advantage is: you'll only have to install one compiler)
b) use gcc 4.6 from MacPorts (advantage: supposedly faster)

Basically do the same as if you would install OF from sources on a Linux-Machine (so I'll be sketchy):

1. Download OF 2.1 (preferably via git) and Thirdparty-2.1 and unpack them on a case-sensitive filesystem (see elsewhere what this means)

2. Go to the ThirdParty-Directory and apply the first patch
patch -p1 <ThirdParty-2.1.0-Mac.patch

3. Go to the OpenFOAM-Directory and apply the base-patch
patch -p1 <OpenFOAM-2.1.x-Mac.patch
then make the script that helps with the tracedumps executable (if the patch-utilitiy didn't do it)
chmod a+x bin/addr2line4Mac.py

4. Now decide which compiler you're going to use (although you can also apply both patches if you want to)
a) gcc 4.2: apply the appropriate patch:
patch -p1 <OpenFOAM-2.1.x-gcc42.patch
(this patch fixes some places where gcc4.2 can't cope with advanced constructs)
b) gcc 4.6: apply
patch -p1 <OpenFOAM-2.1.x-Mac-gcc46.patch
and make sure that the WM_COMPILER environment variable is set to Gcc46 (preferably in site/2.1.x/prefs.sh)
c) other compiler: copy wmake/rules/darwinIntel.. that the patches create. Basically only the compiler name has to be changed in the c ant the c++-file if you use gcc

5. Now source etc/bashrc, grab some coffee and compile

As usual I didn't bother to get the PV3Reader (aka paraFoam) to compile. Use an up-to-date paraview from Kitware with the built in reader for OF

Bernhard

PS: comments on the procedure are welcome. If somebody feels like writing a step-by-step instruction on the Wiki this would be even more welcome
Attached Files
File Type: gz make.log.tar.gz (58.6 KB, 2 views)
joan.subirats is offline   Reply With Quote

Old   December 1, 2012, 08:38
Default
  #179
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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 Joan and welcome to the forum!

Looks like you've got one extra "6" that shouldn't be present in "Gcc466". Check again the section 2.3: http://openfoamwiki.net/index.php/Ho...hes_and_tweaks - in particular point #1 in that section.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   December 1, 2012, 19:10
Default OpenFoam 2.1.1 - Mac
  #180
New Member
 
Join Date: Dec 2012
Posts: 3
Rep Power: 14
ooznie is on a distinguished road
Hi everyone,

first of all, i'm sorry for my english (for sure, it's too bad ... ) There will be mistakes :/

So, I need to install OpenFoam for my studies on my computer (Mac). I used this procedure with succes until this point : 2.6 Building OpenFoam.

I achieved all the previous explanations but when i want to compile/build OpenFoam, the Terminal return me some errors.

I saved a log file.

Does anybody help me ?

Thank you
ooznie 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 17:50
Openfoam mac: Compiling custom libraries atareen64 OpenFOAM 3 April 14, 2011 12:01
OpenFOAM-1.6 on Mac OS X 10.6.1 elvisjohndowson OpenFOAM 6 October 21, 2009 16:45
Mac Simple Install Request or Processing Assistance Help sjohnson OpenFOAM Installation 4 December 12, 2008 08:46
MAC + SOLA for free surface T Main CFD Forum 1 April 11, 2001 14:43


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