CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   Building OpenFOAM-2.2.x with Gcc-4.7.3 from scratch (

FerdiFuchs May 16, 2013 09:40

Building OpenFOAM-2.2.x with Gcc-4.7.3 from scratch

Im trying to install OpenFOAM with the gcc-4.7.3. Everything is done on scratch, i also dont have su/sudo permissions.

I changed the following lines in the ../OpenFOAM/etc/bashrc:

export WM_COMPILER_DIR =/disk1/users/fpfender/OF/bin/gcc-4.7.3
export WM_NCOMPROCS=48
export WM_COMPILER=Gcc47

everything else is set on standard values.

When i start with ./Allwmake everything works fine, excepting a few errors, but my real problem is, it is still building with the (systemwide installed) Gcc-4.4.5 instead of my Gcc-4.7.3 from scratch.

Does anyone know how to solve this? If you need certain information, please let me know.


wyldckat May 16, 2013 17:12

Greetings FerdiFuchs and welcome to the forum!

From your description, I would guess that you are using CentOS or RHEL or SL 6.x.

A few weeks ago I wrote about how to build OpenFOAM 2.2.0 on CentOS 6.4, including instructions on how to build a custom Gcc 4.5:

You'll have to adapt the instructions accordingly to the version of Gcc you are trying to build, along with taking into account you're trying to build OepnFOAM 2.2.x ;).

edit: this thread may help you a bit as well:

Best regards,

FerdiFuchs May 16, 2013 17:23

hi wyldckat,

thanks for your help; but i think i already found a walkthrough.
im not quite sure, i think its a debian system.
the gcc-4.7.3 is already built, but ./Allwmake doesnt accept it from bashrc. i changed paths and version of the gcc in the OpenFOAM-2.2.x/etc/config/ and it works. Im also not sure if this was the right way to solve the problem. but it works.

edit: something is still strange: compiling takes very long, also with 48 processors.

Thanks a lot!

wyldckat May 16, 2013 17:47

Hi FerdiFuchs,

I forgot to mention that you should scale down to using only 8 cores, instead of 48. Otherwise, your machine is spending more time playing around with files, than doing actual compiling work ;)

With 8 cores, it should take around 30-40 minutes. If it's taking longer than that, make sure you run the script to send (pipe) the output into a single file, like this:

./Allwmake > make.log 2>&1
This way it wont loose (as much) time outputting stuff onto the screen, which can get slow on machines with (very) old graphics card GPUs.

Another detail is that if I remember correctly, building OpenFOAM 2.2 with Gcc 4.7 gives a lot more warnings than building with Gcc 4.6 or 4.5. It might have been psychological on my part, but the warnings were so many, that it seemed to take longer to build...

Best regards,

All times are GMT -4. The time now is 08:49.