CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   OpenFOAM 1.6.x - CentOS 5.3 x86_64 (http://www.cfd-online.com/Forums/openfoam-installation/67676-openfoam-1-6-x-centos-5-3-x86_64-a.html)

linnemann August 23, 2009 11:02

OpenFOAM 1.6.x - CentOS 5.3 x86_64
 
Hello Foamers

Here is a prepackaged/precompiled version of OpenFOAM-1.6.x and the ThirdParty-1.6.x sources. Some extra mesh related programs have been put in the ThirdParty package.

All built from source, no prepackaged binaries, so optimal speed for CentOS.

This time I have retained the sources in the ThirdParty folder since it is needed for recompilation of the OpenFOAM source. When you have it all installed you should be able to go into the install dir and do:
git pull
./Allwmake
Now you should be updated with all the bugfixes etc.

---------------- Included ----------------

- OpenFOAM 1.6.x (flex, mpfr and gmp built from source)

- Paraview 3.6.1, Mpi support, ffmpeg support (export to avi), and parallezied support for decomposed cases.

- gmsh-2.3.1

- engrid-1.0.1

- meshlab-1.2.1

---------------- Install Instructions for the whole package ----------------

0. Next steps are all done as root

1. First you need to install the gcc and c++ compiler, bison and ncurses-devel (thx wersoe) which is shipped with CentOS 5.3, needed to compile/recompile OpenFOAM solvers/libraries, or your own solvers.
yum install gcc gcc-c++ bison ncurses-devel
2. Create a folder for OpenFOAM, the default in the bashrc is /usr/loal/OpenFOAM
mkdir /usr/local/OpenFOAM
3. unpack the content of OpenFOAM-1.6.x_CentOS-5.3_x86-64.tar.gz and ThirdParty-1.6.x_CentOS-5.3_x86-64.tar.gz, from sourceforge, to the folder
cd /usr/loal/OpenFOAM
tar -xvf /pathtothedownload/OpenFOAM-1.6.x_CentOS-5.3_x86-64.tar.gz
tar -xvf /pathtothedownload/ThirdParty-1.6.x_CentOS-5.3_x86-64.tar.gz

4. Fix any possibly wrong permissions
chmod -R 755 /usr/local/OpenFOAM
5. Next part is done as non-root (user)

6. Put this line in your .bashrc file.
. /usr/local/OpenFOAM/OpenFOAM-1.6.x/etc/bashrc
7. Restart console or source the bashrc.
. ~/.bashrc
there is a space between the dot and the tilde

8. Check that it works by doing
which gcc
this should output the following
/usr/local/OpenFOAM/ThirdParty-1.6.x/gcc-4.3.3/platforms/linux64/bin/gcc

------------------Install done-------------------

The Qt-4.5.2.tar.gz and vtk-5.4.2.tar.gz, in the non-essential folder at sourceforge, are extras. Only needed if you consider recompiling paraview, or some other app which depends on Qt/vtk.

It is possible to install to another location other than /usr/local, all you have to do is to modify you own .bashrc file, the bashrc in OpenFOAM (/usr/local/OpenFOAM/OpenFOAM-1.6.x/etc/bashrc) to point to the new location of the install, like in the regular OpenFOAM README.

---------------- Disclaimer ----------------
The package has been verified on a fresh minimal gnome install of CentOS 5.3 64bit (and a recompilation was done)

The package is "as is" and can only be guaranteed to work with a 64bit version of CentOS/RedHat/Scientific 5.3 (yum update is fine). Or if in a cluster environment Rocks 5.2 (based on CentOS 5.3).

If other distributions are used, I can't help you.

---------------- Download ----------------

I have made a sourceforge project for this which can be found at

https://sourceforge.net/projects/centfoam/

You can build your own OpenFOAM by only downloading the ThirdParty package and then doing:
git clone git://repo.or.cz/OpenFOAM-1.6.x.git
In the OpenFOAM-1.6.x/etc folder edit the bashrc file to contain the following at the end:
export PATH=$WM_THIRD_PARTY_DIR/gmsh-2.3.1/bin:$PATH
export PATH=$WM_THIRD_PARTY_DIR/meshlab-1.2.1:$PATH
export PATH=$WM_THIRD_PARTY_DIR/engrid-1.0.1:$PATH
export PATH=$WM_THIRD_PARTY_DIR/libraries/bin:$PATH

export LD_LIBRARY_PATH=$WM_THIRD_PARTY_DIR/paraview-3.6.1/platforms/linux64Gcc/bin:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$WM_THIRD_PARTY_DIR/libraries/lib:$LD_LIBRARY_PATH

after that do this
cd OpenFOAM-1.6.x
./Allwmake

And you should have your own compiled version (don't know why you would do that since I've compiled it already, but you have the possibility :))


---------------- BUGS ----------------

1 .User wesoe reported an issue where the geometry is not shown, Takuya proposed putting the following into your .bashrc or run the command before paraFoam is run.
export LC_ALL=C
This is apparently a locale issue when using Qt-4.5 to build paraview.

2. An error related to paraview, if its not installed in /usr/local/OpenFOAM and fails to start because is states a library is missing, do this as root.
mkdir $WM_THIRD_PARTY_DIR/paraview-3.6.1/platforms/linux64Gcc/lib

ln -s $WM_THIRD_PARTY_DIR/paraview-3.6.1/platforms/linux64Gcc/bin $WM_THIRD_PARTY_DIR/paraview-3.6.1/platforms/linux64Gcc/lib/paraview-3.6

PetSul September 7, 2009 05:29

Hi all,

I have OpenFOAM-1.6 installed on my computer. And I'm using Centos-5.3. Now if I want to update to OpenFOAM-1.6.x what are the exact steps that I should do to update succesfully? I have git installed.

Thank you!

Regards,

Petri Sulasalmi

linnemann September 7, 2009 06:30

Download the 1.6.x version from the sourceforge webpage and read what I posted above.

Regards
Linnemann

PetSul September 7, 2009 07:13

I try to run Allwmake in OpenFOAM-1.6.x directory and it gives me the following message

Error: Current directory in not $WM_PROJECT_DIR
The environment variable are not consistent with the installation.
Check the OpenFOAM entries in your dot-files and source them.

What should I do and where?

Regards,

Petri Sulasalmi

linnemann September 7, 2009 07:31

Hi

Have you edited the OpenFOAM bashrc to point to the right location/folder?

PetSul September 7, 2009 07:34

Quote:

Originally Posted by linnemann (Post 228723)
Hi

Have you edited the OpenFOAM bashrc to point to the right location/folder?


Yes I have edited .bashrc file but it still refuses to run the Allwmake.

PetSul September 7, 2009 07:39

Update!

I manage to run Allwmake but I gave a load of errors.

linnemann September 7, 2009 07:45

Hi

make sure that these lines are in the bottom of the OpenFOAM bashrc file.

export PATH=$PATH:$WM_THIRD_PARTY_DIR/gmsh-2.3.1/bin
export PATH=$PATH:$WM_THIRD_PARTY_DIR/meshlab-1.2.1
export PATH=$PATH:$WM_THIRD_PARTY_DIR/engrid-1.0.1
export PATH=$PATH:$WM_THIRD_PARTY_DIR/libraries/bin

export LD_LIBRARY_PATH=$WM_THIRD_PARTY_DIR/paraview-3.6.1/platforms/linux64Gcc/bin:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$WM_THIRD_PARTY_DIR/libraries/lib:$LD_LIBRARY_PATH

PetSul September 8, 2009 01:41

Hi,

yes I added those lines at the end of bashrc file in the OpenFOAM-1.6.x/etc directory. Then I tried again to run Allwmake but it still gives a lot of errors, for example

make[2]: *** [Make/linux64GccDPOpt/equilibriumFlameT.o] Error 1
make[2]: Target `/usr/local/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/equilibriumFlameT' not remade because of errors.
make[2]: Leaving directory `/usr/local/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/thermophysical/equilibriumFlameT'
make[1]: *** [equilibriumFlameT] Error 2
make[2]: Entering directory `/usr/local/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
/bin/sh: /usr/local/OpenFOAM/OpenFOAM-1.6.x/wmake/bin/linux64Gcc/wmkdep: No such file or directory
make[2]: Leaving directory `/usr/local/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
make[2]: Entering directory `/usr/local/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
SOURCE=mixtureAdiabaticFlameT.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/usr/local/OpenFOAM/OpenFOAM-1.6.x/src/thermophysicalModels/specie/lnInclude -IlnInclude -I. -I/usr/local/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/mixtureAdiabaticFlameT.o
/usr/local/OpenFOAM/ThirdParty-1.6.x/gcc-4.3.3/platforms/linux64/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.3.3/cc1plus: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory
make[2]: *** [Make/linux64GccDPOpt/mixtureAdiabaticFlameT.o] Error 1
make[2]: Target `/usr/local/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/mixtureAdiabaticFlameT' not remade because of errors.
make[2]: Leaving directory `/usr/local/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
make[1]: *** [mixtureAdiabaticFlameT] Error 2
make[1]: Target `application' not remade because of errors.
make[1]: Leaving directory `/usr/local/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/thermophysical'
make: *** [thermophysical] Error 2
make: Target `application' not remade because of errors.

That's just some of it. Should I remove the 1.6 version of the OpenFOAM and ThirdParty or something..?

Regards,

Petri Sulasalmi

linnemann September 8, 2009 02:24

Hi

This is the error that ruins it for you

error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory

libmpfr.so.1 is located in the ThirdParty-1.6.x/libraries/lib folder and it seems it haven't sourced it correctly, so I suspect that its not sourcing the lines I suggested correctly. what is the output of:

echo $LD_LIBRARY_PATH

you can also try and put the lines I suggested below the sourcing of the OpenFOAM bashrc in the user .bashrc.

I really don't know why you get this error since I've tested it 3 times on newly installed CentOS and the instructions have worked for me every time.

Regards

PetSul September 8, 2009 02:35

This is the out put of echo $LD_LIBRARY_PATH:

/usr/local/OpenFOAM/ThirdParty-1.6.x/libraries/lib:/usr/local/OpenFOAM/ThirdParty-1.6.x/paraview-3.6.1/platforms/linux64Gcc/bin:/usr/local/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/openmpi-1.3.3:/usr/local/OpenFOAM/ThirdParty-1.6.x/openmpi-1.3.3/platforms/linux64GccDPOpt/lib:/usr/local/OpenFOAM/ThirdParty-1.6.x/gcc-4.3.3/platforms/linux64/lib64:/usr/local/OpenFOAM/ThirdParty-1.6.x/gcc-4.3.3/platforms/linux64/lib:/usr/local/OpenFOAM/ThirdParty-1.6.x/gmp-4.2.4/platforms/linux64/lib:/usr/local/OpenFOAM/ThirdParty-1.6.x/mpfr-2.4.1/platforms/linux64/lib:/home/petri/OpenFOAM/petri-1.6.x/lib/linux64GccDPOpt:/usr/local/OpenFOAM/site/1.6.x/lib/linux64GccDPOpt:/usr/local/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt:/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt

I tried to run Allwmake after adding the stuff to my user .bashrc but it's all the same.

Regards

linnemann September 8, 2009 03:19

Hi

As I can see /usr/local/OpenFOAM/ThirdParty-1.6.x/libraries/lib is in the LD_LIBRARY_PATH and I see no reason why it shouldn't work.

you have installed the dependencies from yum?

Regards

PetSul September 8, 2009 04:21

Do you mean this stuff:

yum install gcc gcc-c++ bison ncurses-devel

?

linnemann September 8, 2009 05:36

Hi

Yup I mean that stuff.

I've just tried installing it again and I get no errors.

Regards

PetSul September 8, 2009 05:51

Yes I have them installed and latest versions too.

PetSul September 14, 2009 03:45

Is it possible that the updating problems have something to do with the amount of processors? I'm using a Mac with 8 cores, os is (as mentioned) Centos-5.3.

linnemann September 14, 2009 05:58

Hi

I highly doubt it as I've done it on dual-core and quad-core systems.

linnemann September 14, 2009 06:41

Hi

Probably a stupid question, but you are using 64bit version of CentOS? :)

Regards

PetSul September 14, 2009 06:45

Quote:

Originally Posted by linnemann (Post 229433)
Hi

Probably a stupid question, but you are using 64bit version of CentOS? :)

Regards


Yes, 64bit Centos indeed.

PetSul September 14, 2009 07:54

I probably got it working, it's compiling atm but no errors, yet at least. I guess it takes some time to complete?

Anyway I didn't download ThirdParty-1.6.x just changed the name of ThirdParty-1.6 as someone suggested in another thread, otherwise I did as you instructed and no error messages yet. Quite strange.

Regards,

Petri


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