CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   Build OpenFOAM on MacOSX (

Mauro Augelli (Augelli) January 4, 2005 11:06

I'm trying to build OpenFOAM
I'm trying to build OpenFOAM on MacOSX. It is really hard to understand the building process and the documentation is really poor. Has someone succeded in compiling foam on MacOSX?



Henry Weller (Henry) January 4, 2005 11:19

We have been asked several ti
We have been asked several times to do a port to OSX but are unable to do so because we don't have a machine here to do it and maintain it on. We asked Apple if they would lend us a machine or give us access to a porting centre machine but they didn't even reply. I have told those people interested in an OSX port that if they club together and provide OpenCFD with a machine we will do the port and maintain it but we have not had a reply from them either.

Yes the build process is complicated, that's because FOAM is complicated containing a great many libraries both native and imported and an even larger number of applications. I think there is some interest from users for a simpler build system which I would be happy to include in the OpenFOAM release when it is supplied to us. In the meantime users will have to persevere with the wmwake-based system we supply or create there own. We will endevour to provide better documention for porting in the future but we are being asked to do a great many things free of charge and this is not top of the priority list so I am not sure when it will happen.

Pedro Giffuni (Giffuni) January 4, 2005 11:46

Hi Henry; I'm not sure, but
Hi Henry;

I'm not sure, but I think sourceforge offers an Apple and Linux cluster for their projects.
A better option, IMHO would be to get OpenDarwin for i386 on an ISO image:
(There's also a GNU-Darwin distribution somewhere).



Henry Weller (Henry) January 4, 2005 11:54

We are not part of sourceforg
We are not part of sourceforge yet and really I need local access to do all the pre/post processing stuff because doing that remotely is a right pain.

I am very happy with SuSE Linux on my machines and not directly interested in OSX at all so I don't want to go to all the trouble of installing OpenDarwin and even if I did I guess the binaries would not work on a real Mac OSX machine.

The bottom line is if the Mac community club together to get OpenCFD a machine we will do the port and maintain it, if not we won't.

Hrvoje Jasak (Hjasak) January 4, 2005 12:02

Hi All, I intend to do a M
Hi All,

I intend to do a Mac OS X port in the next month or two, so if you're not in a hurry I suggest you wait a bit. However, I don't intend to ship a binary release i.e. everyone will need to compile their own version.


Mauro Augelli (Augelli) January 5, 2005 10:17

Good!! we will wait impatient
Good!! we will wait impatiently for this. No problems in compiling it ourself; this is a quasi-rule in opensource developments.
Please, if possible, give us (if you prefer by private mail) a periodical status of your "porting"; just to know that it is going as you want.
In any case, if you need some help, let us know (at least let me know).

Do you intent to do the porting basing it on X11 or you will try the hard way to port it to cocoa?

Many many thanks.


Paul Wells (Wells) January 28, 2005 07:27

Hi I'm still fairly new to

I'm still fairly new to c++ and compiling, but learning. I too would like a version of OpenFoam on MacOSX and would be happy to help with the porting. I'll need plenty of guidance, I'm afraid, but if there's any 'Donkey Work' that needs more effort than ability then I'd be delighted to help.

In the meantime, I also have Yellow Dog Linux on my mac and will try to compile on that, at least this will give me the code on Apple hardware.

Paul Wells

Mauro Augelli (Augelli) February 19, 2005 06:34

Any news on the porting to OS
Any news on the porting to OSX?



Hrvoje Jasak (Hjasak) February 19, 2005 06:45

Yup, but not good. Got the
Yup, but not good.

Got the machine, got the compiler, I've set up the foam environment and compiled up a few basic things... and then hit a snag. HFS+, which is the filing system you get on your Mac is completely case-insensitive. This means that files like Dictionary.H and dictionary.H cannot be distinguished and that's a problem.

The number of such clashes in the whole of foam will be of the order of 50 or so and I would need to change them by hand (well, scriptable) and rename the files - I don't fancy doing that.

The second problem I've hit is that OS X seems to have a different system for handling shared libraries. As a consequence, g++ does not support the -shared option (producing .so files) and has some setup for producing .dylib files instead. Therefore, once the first problem is solved, there will potentially be trouble with this lot as well.

In short, reorganising the files will cause a divergence between two versions of foam and, together with the second lot, this is not worth my effort in the short term...

JLepolt (Jlepolt) February 21, 2005 15:48

I am working on a Mac OS X ve
I am working on a Mac OS X version of FOAM as well, and also have not had very much luck. Actually, I have not been able to succuessfully build anything...I keep hitting snags. Does anyone know if all of the script files (Makefiles, shell scripts, etc.) can be run on the Mac right away? Or do I need to tweak those first? I appreciate any help.

stonecp March 16, 2005 16:56

I just got into the Openfoam f
I just got into the Openfoam forum a few weeks ago and just decided to start a port to Mac OS. Looks like there's still a lot of work to be done. I'm pretty savvy with Mac OS and building. Maybe I can help out.

As for the HFS+ problem, you can get around this by creating a UFS (Unix File System which is case sensitive). That's how I handle all my porting problems (Fortran is notorious for this, too). If anyone's interested in this I'd be happy to post the instructions.

wells March 16, 2005 18:00

I'd be interested, sure! I act
I'd be interested, sure! I actually just set up dual boot with Yellow Dog Linux and was about to try to compile from source. Don't see why this shouldn't work. I'll post when I have results.

mattijs March 17, 2005 05:28

Just a few pointers: - in t
Just a few pointers:

- in the XXX/.OpenFOAM-1.1/bashrc add a check for your machine type and set WM_ARCH and WM_MPLIB. You can leave WM_MPLIB empty (which will link in the dummy/ Pstream (which saves you having to compile lam or mpich))

- in the XXX/.bashrc add your architecture and set all the relevant variables to access gcc and java and such

- make a copy of e.g. $WM_DIR/rules/linux to $WM_DIR/rules/$WM_ARCH and adapt the settings in these files.

- have a look at XXX/Allwmake script which compiles up some binaries needed by 'wmake' itself ('cd wmake ; ./makeWmake')

- have a look at XXX/src/Allwmake and compile in the same order (leaving out the lam and mico if you don't want to run parallel or FoamX)

good luck,


wells June 12, 2005 13:32

I've spent the day trying to c
I've spent the day trying to compile on my Powerbook running Ubuntu linux. Gcc 3.4.3 compiled fine, I also compiled the wmake binaries, that are included with the sources precompiled for the popular architectures. I tried various hacks in the makefiles, gcc flags, using flex instead of lex. Some of the shared libraries compile but it fails when trying to build object files.

Two questions:
1 Has anyone already successfully compiled under linuxPPC?
2 Can anyone tell me a organised procedure of what files I need to change or create and which ones I can leave alone to save me working through everything?

Many thanks in advance

PS I got Paraview2.0.2 to compile and can send details if it is any use to anyone.


henry June 12, 2005 15:10

I have compiled FOAM under lin
I have compiled FOAM under linuxPPC many years ago and we would consider porting to and supporting this platform again once we find sponsorship to do so.

hjasak June 12, 2005 16:13

I have had a go at compiling o
I have had a go at compiling on native OS X; however, there are problems with the default filing system and given up on it. Recently OS 10.4 came out and there are rumours of supporting the "proper" (case-sensitive) filing system. Also, I am told that OS X will mount external efs disks and that's the direction I am leaning towards (not ideal because I want the stuff to run on my laptop without the external disk).

As for the porting, I am interested in the native Mac OS X (for me, that's the point of having a Mac) and not in Mac flavours of linux.


mattamos June 13, 2005 07:41

Paul, I compiled on linuxPP

I compiled on linuxPPC (Gentoo) a few months ago and I had to hack around some of the build scripts to get things to go in the right places (or what I consider to be the "right places" ;-))


chris June 13, 2005 08:14

Why not post what you did to h
Why not post what you did to help others who want to run on LinuxPPC?

hjasak June 13, 2005 10:10

Here's some help on "right pla
Here's some help on "right places" to configure a new port. I am a tcsh person so all will be given in terms of .cshrc files; an equivalent bash setup also exists.

For starters, all configuration should be done through environment variables. Also, none of the existing build configurations should be tampered with :-)

The first place is in ~/.OpenFOAM-1.1/cshrc (a copy of thsi directory exists in the FOAM installation for the new users). Here, under the $machineTest you can set up the machine-specific setup that a user can configure. If your machine does not exist, add another "else if" into the command.

The second place is OpenFOAM-1.1/.cshrc. Here, the FOAM-distribution part of the installation is set up. Again, there are some machine-specific things, like JAVA and the parallel communications library.

Finally in wmake/rules, there is a bunch of directories for each architecture in which the compilaion and linkage flags are set, compiler is selected and similar.

For applications there is a bunch of sub-directories in .OpenFOAM-1.1/apps, where the setup for various external (post-processing) apps can be manipulated. By default, the ones in OpenFOAM-1.1/.OpenFOAM-1.1/apps are sourced, but that can be over-ridden in ~/.OpenFOAM-1.1/cshrc.

I think that's about it - if I've forgotten something, please feel free to add.



wells June 13, 2005 12:57

Thanks Hrv. What do we do a
Thanks Hrv.

What do we do about the Java SDK? I can't find 1.4 for ppclinux

What is it used for in Foam?


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