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

Build OpenFOAM on MacOSX

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 16, 2006, 05:47
Default Heya, Environment variables
  #61
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Heya,

Environment variables: the idea is that you copy the OpenFOAM-1.2/.OpenFOAM-1.2 directory into your home directorn and change and source it from there:

source ~/.OpenFOAM-1.2/cshrc

(as well as the apps stuff)

This will allow you to set up the additional environment variables (separating the installation and your own stuff) into separate places.

paraView script: I haven't seen problems (sorry, couldn't resist it). This is one of Mattijs's and I will defer the suggestions to him

Paraview: still causing trouble. If I build the release build, it fails as I have described earlier and I cannot help it (I will carry on playing with it...). However, the debug build runs fine and that's what I've got for the moment. The switch is under the basic cmake options when you build paraview and I'm still not happy about this. Have you tried bulding paraview locally?

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 16, 2006, 13:48
Default paraview, PATH and LD_LIBRARY_
  #62
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
paraview, PATH and LD_LIBRARY_PATH : we'll add them to the front, like the path to gcc and java.
mattijs is offline   Reply With Quote

Old   January 17, 2006, 04:43
Default Heya, After a lot of messin
  #63
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Heya,

After a lot of messing about, I have found out that paraview fails if it's compiled with more optimization than -O1. I 've got a working version without the debug symbols, it's much smaller and a bit faster. Everything else is rebuilding once more (switched to paraview-2.4.2) and I'll update the disk images in due course.

Thanks for your help everyone,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 18, 2006, 11:16
Default Hi Bernhard, I'm having a b
  #64
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Hi Bernhard,

I'm having a bit of trouble with this disk image stuff. I've set it up exactly as we've said (tried both the compressed and uncompressed disk image) and the environment looks good. I also have an external disk that has been used for the build.

When I try and run with the external disk attached, all is well. The paths and libraries point to the installation and I thought that would be it. However, if I unmount my external disk and try using the installation on its own, the apps don't run and complain that the external disk libraries could no be reached. This is in spite of the fact that the libraries are correct and present in the installation disk images.

This looks pretty crappy to me and I believe I've done something stupid (especially if you've managed to run off the disk images I have prepared). Any ideas?

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 18, 2006, 11:42
Default Hello Hrv The problem is, t
  #65
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
Hello Hrv

The problem is, that I tried to make your images work without making them writeable. I "emulated" your setup by mounting the images and then creating a directory "/Volumes/MacExternal/local" and creating a symbolic link in that to the image. So for the binaries it looks "just like Hrv's disk". And therefor I never had this problem.

If I interpret your problem correctly the paths to the dylibs are "hardcoded" in the library and the LD_LIBRARY_PATH is ignored. I never had this problem with my build because I built it on the image in the first place (so I might have the same problem).

I can't test this theory right now, but I'll get back to you tomorrow.
__________________
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   January 18, 2006, 11:47
Default I meant to say: hardcoded in t
  #66
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
I meant to say: hardcoded in the binaries
__________________
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   January 19, 2006, 06:21
Default Bernhard wrote: > If I inte
  #67
New Member
 
Markus Hitter
Join Date: Mar 2009
Location: Germany
Posts: 12
Rep Power: 17
traumflug is on a distinguished road
Bernhard wrote:

> If I interpret your problem correctly the paths to the dylibs
> are "hardcoded" in the library ...

You are right, it's an unfortunate requirement of mach-o (Mac OS X) libraries to have their own installation path compiled in. Either an absolute path or a path relative to the executable.

So, to move them around, you have to fix the installation path inside the dylib each time. See libtool's -installpath option and Xcode's documentation.

GNU/OpenSource software usually solves this problem by installing libraries into well known places, including compiling this well known path into the lib or changing the built in path at installation time.

Preferred Mac OS X way is, to put the libraries into the app's bundle and to compile a relative path into the lib. This makes applications moveable, no installer required.

I don't know enough about OpenFOAM to give an educated suggestion, yet (I didn't solve _any_ problem, yet *sigh*). Today I had a chance to download Hrvoje's "distribution", so I hopefully find some time over the weekend to get into the materia.

Bundling everything into a single app would be just great :-)


Markus
traumflug is offline   Reply With Quote

Old   January 19, 2006, 09:58
Default I think the easiest solution w
  #68
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
I think the easiest solution would be to decide on a directory where OpenFoam should exist on a Mac (For instance /OpenFOAM )
Inside of this directory should reside the directories: OpenFOAM-1.2, OpenFOAM-1.3, user-1.2 etc.
Whether these directories are there "for real" or just by symbolic linking to their real place (for instance inside a DiskImage: 'ln -s /Volumes/OpenFOAM-1.2readOnlyDist/OpenFOAM-1.2 /OpenFOAM/OpenFOAM-1.2') would make no difference.

That way libraries would always be found at a "standard"-path (/OpenFOAM/OpenFOAM-1.2/lib/darwin/libOpenFOAM.dylib for instance).

User installation would be 'ln -s /OpenFOAM ~/OpenFOAM'.

@"a single app": that would be FoamX ;-)
__________________
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   January 22, 2006, 16:05
Default Easy. Embarassingly easy:
  #69
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Easy. Embarassingly easy:

setenv DYLD_LIBRARY_PATH $LD_LIBRARY_PATH

and all is well.

I think this concludes matters. I have re-packed the disk images for nicer links and you can even run off compressed images. I'm really happy with this. If someone want to have a go at replacing MICO with another Corba implementation, please give me a shout. I'll cross the port off my development list :-)

Thanks for you help everyone,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 14, 2006, 09:08
Default Hello, I am a newbie to Ope
  #70
New Member
 
Ganesan Subramanian
Join Date: Mar 2009
Location: Rouen, France
Posts: 11
Rep Power: 17
ganesan is on a distinguished road
Hello,

I am a newbie to OpenFOAM. I installed it on my MacOSX thanks to Hrvoje Jasak (from his disk img and instructons).

Now what i see is that i am not able to run FoamX. But i have mico, flex and bison....

Is there any one succeeded to use FoamX on Mac OS X or anyone help me on this issue?
ganesan is offline   Reply With Quote

Old   February 21, 2006, 06:29
Default Hi Hrvoje Jasak, Could you
  #71
New Member
 
Ganesan Subramanian
Join Date: Mar 2009
Location: Rouen, France
Posts: 11
Rep Power: 17
ganesan is on a distinguished road
Hi Hrvoje Jasak,

Could you please help me on the following point.

I took a image of your Mac based OpenFOAM. I tried to compile it with your darwin options.

I get error message :

/usr/bin/libtool : ld external link command failed

like this.

COuld you help how to compile myself to take into account the small modifs if i would do in src...especially in combustion..

Regards
Ganesan
ganesan is offline   Reply With Quote

Old   February 21, 2006, 06:47
Default For which application/lib does
  #72
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
For which application/lib does the link fail? And is the error message of ld also available?

Just one guess: is the MACOSX_DEPLOYMENT_TARGET environment variable set? At least that's the cause for some linkage-failures on my installation (it should be set to the version of your OS X - "10.3" or "10.4"). It's not set by the OF-scripts but some of the compilation targets need it.
__________________
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   February 21, 2006, 12:14
Default Bernhard Thanks, here is th
  #73
New Member
 
Ganesan Subramanian
Join Date: Mar 2009
Location: Rouen, France
Posts: 11
Rep Power: 17
ganesan is on a distinguished road
Bernhard

Thanks, here is the error :

/usr.bin/ld: can't locate file for : -lcombustionThermophysicalModels it is just an example. But most of the applications were failed.

Concerning MACOSX_DEPLOYMENT_TARGET it was not set bcos i commented it as it was 10.1 by default. I will try and let you by putting 10.4.

thanks
ganesan is offline   Reply With Quote

Old   February 21, 2006, 12:29
Default See above: do setenv DYLD_L
  #74
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
See above: do

setenv DYLD_LIBRARY_PATH $LD_LIBRARY_PATH

or the bash equivalent and all should be well. I'll add it to the setup when I rebuild the installation.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 22, 2006, 03:38
Default Hello Thanks for helping me
  #75
New Member
 
Ganesan Subramanian
Join Date: Mar 2009
Location: Rouen, France
Posts: 11
Rep Power: 17
ganesan is on a distinguished road
Hello

Thanks for helping me. I did both. DYLD_LIBRARY_PATH setting and MACOSX_DEPLOYMENT_TARGET as well.

i get still /usr/bin/ld: can't locate file for for: -lcfdTools
similar to some other libraries.

What i did : i took the source from you. i used wcleanAll, wcleanAlmostAll and wcleanMachine. so cleaned the objetc files.

i started ./Allwmake... problem is some libraries like cfdTools and -lincompressibleTurbulenceModels etc.. are not there in in the lib/darwinOpt/
my bashrc is exactly the same available in your image disk. DYLD_LIBRARY_PATH i set it in my ~/.bashrc...

i don't understand why it does making dynamic libraries in part....


Thanks
Ganesan
ganesan is offline   Reply With Quote

Old   February 22, 2006, 04:00
Default Try this (assuming your using
  #76
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
Try this (assuming your using bash):

./Allwmake 2>&1 | tee Allwmake.out

Open the file Allwmake.out with a text editor and look for the first error. Post the first error AND the command that caused it. When we find a way to fix that first error chances are good that the other stuff is fixed too.
__________________
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   February 22, 2006, 06:37
Default Hi here is the first error :
  #77
New Member
 
Ganesan Subramanian
Join Date: Mar 2009
Location: Rouen, France
Posts: 11
Rep Power: 17
ganesan is on a distinguished road
Hi here is the first error :
SOURCE=yylex.c ; gcc -ggdb -Ddarwin -Wall -O0 -I/Users/ganesan/OpenFOAM/OpenFOAM-1.2/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -c $SOURCE -o Make/darwinOpt/yylex.o
/Users/ganesan/OpenFOAM/OpenFOAM-1.2/wmake/bashScripts/mkObjectDir /Users/ganesan/OpenFOAM/OpenFOAM-1.2/applications/bin/darwinOpt/foamFlex++
g++ -Ddarwin -Wall -W -Wno-unused-parameter -Wold-style-cast -O3 -ffast-math -DNoRepository -ftemplate-depth-30 -I/Users/ganesan/OpenFOAM/OpenFOAM-1.2/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -lpthread Make/darwinOpt/foamSkel.o Make/darwinOpt/parse.o Make/darwinOpt/tblcmp.o Make/darwinOpt/misc.o Make/darwinOpt/scan.o Make/darwinOpt/nfa.o Make/darwinOpt/main.o Make/darwinOpt/gen.o Make/darwinOpt/dfa.o Make/darwinOpt/sym.o Make/darwinOpt/ecs.o Make/darwinOpt/ccl.o Make/darwinOpt/yylex.o \
-lpthread -L/Users/ganesan/OpenFOAM/OpenFOAM-1.2/lib/darwinOpt/dummy -lPstream -o /Users/ganesan/OpenFOAM/OpenFOAM-1.2/applications/bin/darwinOpt/foamFlex++
/usr/bin/ld: warning -L: directory name (/Users/ganesan/OpenFOAM/OpenFOAM-1.2/lib/darwinOpt/dummy) does not exist
/usr/bin/ld: can't locate file for: -lPstream
collect2: ld returned 1 exit status
make: *** [/Users/ganesan/OpenFOAM/OpenFOAM-1.2/applications/bin/darwinOpt/foamFlex++] Error 1



------

Do you think i do not have some libraries not installed on my Mac??

Thanks for help
ganesan is offline   Reply With Quote

Old   February 22, 2006, 07:13
Default No. Libraries should be all th
  #78
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
No. Libraries should be all there. The problem is that the the Library libPstream.dylib that is supposed to reside in /Users/ganesan/OpenFOAM/OpenFOAM-1.2/lib/darwinOpt/dummy (==$FOAM_LIBBIN/dummy) isn't there.

The problem seems to be that Pstream is made after flex. Normally this should work anyway when running Allwmake twice (without cleaning). The other way would be to

1. cd to src/Pstream
2. build the library with 'wmake libso dummy'
3. go back to OpenFOAM-1.2
4. do the Allwmake-tango there

(but I can't try this out because I don't want to wclean my installation)

The bottom-line is: never clean out the libraries unless you want to boot-strap your installation from scratch.
__________________
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   February 22, 2006, 07:26
Default Thanks a lot. I did clean bcos
  #79
New Member
 
Ganesan Subramanian
Join Date: Mar 2009
Location: Rouen, France
Posts: 11
Rep Power: 17
ganesan is on a distinguished road
Thanks a lot. I did clean bcos i did not installed the image disk as external... i formatted my Mac to get UFS. then i copied the source. Most of the applications did not work bcos:

binary file wmkdep generated by hrv is having /Volumes/etc.. path while compiling using flex to generate wmkdep...

so i was supposed to do clean..anyway i will try your idea...

Thanks again..
ganesan is offline   Reply With Quote

Old   February 22, 2006, 08:16
Default how should i compile if i add
  #80
New Member
 
Ganesan Subramanian
Join Date: Mar 2009
Location: Rouen, France
Posts: 11
Rep Power: 17
ganesan is on a distinguished road
how should i compile if i add a model in Combustion module....could you suggest me
ganesan 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
OpenFOAM 15 icc build mschoenberg OpenFOAM Installation 4 October 2, 2008 00:09
How can I build OpenFOAM in cygwin joywe OpenFOAM Installation 10 September 12, 2008 09:39
OpenFOAM 14 Parallel build mplongjr OpenFOAM Installation 3 May 15, 2007 03:32
OpenFOAM build from source instructions tj22 OpenFOAM Installation 7 April 6, 2006 16:15
Build OpenFOAM on Tru64 francois OpenFOAM Installation 18 April 4, 2006 05:45


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