CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   OpenFOAM-1.7.0 for CentOS/RHEL/SL 5.x 64bit released (https://www.cfd-online.com/Forums/openfoam-installation/77668-openfoam-1-7-0-centos-rhel-sl-5-x-64bit-released.html)

linnemann June 30, 2010 06:25

OpenFOAM-1.7.0 for CentOS/RHEL/SL 5.x 64bit released
 
Hi all

Just finished compiling/uploading 1.7.0 for CentOS/RHEL/SL 5.x 64bit based OS'es.

As usual it can be found here

Best
Linnemann

alberto July 1, 2010 14:04

Thank you!

bhh July 2, 2010 03:47

Hi Niels,

Any chance of making a 32 bit version?

rgds
Bjorn

linnemann July 2, 2010 05:43

Hi Bjorn

I don't use 32bit and I do not know how many CFD guys really use 32bit.

So I will have my focus on 64bit, but the manual instructions on the wiki page should apply to 32bit as well just strip the x86_64 from the yum packages.

To compile 1.7.0 you need to do the following.

as root

Code:

yum install gcc gcc-c++ bison ncurses-devel tix glibc-devel flex flex-devel zlib-devel libXt-devel
As user

Code:

cd $HOME

mkdir OpenFOAM

wget http://downloads.sourceforge.net/foam/ThirdParty-1.7.0.gtgz?use_mirror=mesh

wget http://downloads.sourceforge.net/foam/OpenFOAM-1.7.0.gtgz?use_mirror=mesh

cd OpenFOAM

tar -xvf ../ThirdParty-1.7.0.gtgz
tar -xvf ../OpenFOAM-1.7.0.gtgz

put this line in your .bashrc and source it

Code:

alias OF17=". $HOME/OpenFOAM/OpenFOAM-1.7.0/etc/bashrc"

. $HOME/.bashrc

Now the command OF17 should load the OpenFOAM environment

Then you need a couple of dependencies to compile gcc-4.4.4

Code:

mkdir $HOME/build
cd $HOME/build

GMP---

Code:

wget ftp://ftp.gmplib.org/pub/gmp-5.0.1/gmp-5.0.1.tar.bz2

tar -xvf gmp-5.0.1.tar.bz2

cd gmp-5.0.1

OF17

./configure --prefix=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-5.0.1

make -j2 (for two cpu cores, 4 if you have 4 cores)
make install

MPFR---

Code:

cd $HOME/build

wget http://ftp.gnu.org/gnu/mpfr/mpfr-2.4.2.tar.gz

tar -xvf mpfr-2.4.2.tar.gz

cd mpfr-2.4.2

OF17

./configure --prefix=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.2 --with-gmp=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-5.0.1

make -j2
make install

GCC---

Code:

cd $HOME/build

wget http://ftp.gnu.org/gnu/gcc/gcc-4.4.4/gcc-4.4.4.tar.gz

tar -xvf gcc-4.4.4.tar.gz

cd gcc-4.4.4

mkdir build (important to compile gcc out of source)

cd build

OF17

../configure --prefix=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.4.4 --with-gmp=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-5.0.1 --with-mpfr=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.2

make -j2
make install

Now you should be able to go into the ThirdParty-1.7.0 folder and issue

Code:

OF17
./Allwmake

and the same for OpenFOAM.

You will have to figure paraview out for yourself since I don't compile it in the ThirdParty folder.

Hope this will get you somewhere.

bhh July 2, 2010 07:26

1 Attachment(s)
Hi, Niels

I got stuck after the command:
../configure --prefix=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.4.4 --with-gmp=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-5.0.1 --with-mpfr=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.2

I got the error given in the attached screenshot. Any clue about what went wrong?

rgds
Bjorn

bhh July 2, 2010 07:35

Hi again,

Sorry, the above error came after the "make j2" command line

rgds
Bjorn

linnemann July 2, 2010 07:42

Hi

It seems gcc cant find mpfr according to this

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35577

Did you remember to run OF17 before configuring else the path for gmp and mpfr cant be found

You could try with the full path instead of

--with-gmp=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-5.0.1 --with-mpfr=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.2

use

--with-gmp=$HOME/OpenFOAM/ThirdParty-1.7.0/platforms/linux/gmp-5.0.1 --with-mpfr=$HOME/OpenFOAM/ThirdParty-1.7.0/platforms/linux/mpfr-2.4.2


Or add gmp and mpfr to your LD_LIBRARY_PATH

bhh July 2, 2010 08:08

Hi,
I tried your suggestion but the same error occurred.
rgds
Bjorn

niklas July 2, 2010 08:16

Hi Bjorn,

Hope you are well :)

I had the same problem when using gcc 4.1.2.
I switched to openfoam-1.7.0 and started to compile gcc-4.4.4 with
the system compiler and could not get it to work so before switching
environment from 1.6 to 1.7, compile gcc-4.4.4 with
the compiler from openfoam-1.6.x, which was gcc-4.3.3 for me.

Then no problemo.

N

bhh July 2, 2010 08:38

Hi Niklas & Niels,

I am not that good in linux commands, so I probably need a detailed cookbook recipe to get OF1.7 to work. Niels did a good job in doing so, but I got stuck. Niklas you also probably give good advise, but I am not able to use it (becuase of my lack of knowledge in linux).

rgds
Bjorn

niklas July 2, 2010 08:49

what does it say if you type

gcc -v

bhh July 2, 2010 08:56

1 Attachment(s)
Niklas,

the Attached screenshot show the result after gcc -v. This is however after I changed to 1.6.x
Bjorn

niklas July 2, 2010 10:04

right,
but Im guessing that you didnt use that version when compiling gcc-4.4.4.

However, if you stay in the 1.6.x environment you can compile gcc-4.4.4
with gcc-4.3.3 and that will probably work better

using
../configure --prefix=$HOME/OpenFOAM/ThirdParty-1.7.0/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.4.4 --with-gmp=$HOME/OpenFOAM/ThirdParty-1.7.0/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-5.0.1 --with-mpfr=$HOME/OpenFOAM/ThirdParty-1.7.0/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.2

make
make install

...assuming that the enviroment variables WM_ARCH and WM_COMPILER_ARCH are the same
in 1.7.0 and 1.6.x and that your installation is under $HOME/OpenFOAM

N

bhh July 5, 2010 03:14

Hi,
When I executed the command you propose I get the response:
bash: ../configure: No such file or directory

Any clue what might be wrong?

Bjorn

niklas July 5, 2010 03:40

go to the gcc-4.4.4 directory and create a dir called...for instance build with 'mkdir build'
'cd build' and execute the command from there
you should not run the configure script in the gcc-4.4.4 directory

bhh July 5, 2010 04:39

Niklas,
I feel stupid: in ThirdParty-1.6.x there is no gcc-4.4.4 only gcc-4.3.3. As I indicated in an earlier post I am not well adapted to linux commands.
Bjorn

niklas July 5, 2010 06:41

The gcc-4.4.4 should reside in the ThirdParty-1.7.0 directory.

Just 'cd ~/OpenFOAM/ThirdParty-1.7.0' while still in the 1.6.3 environment.

bhh July 5, 2010 08:28

Niklas,
In OpenFOAM-1.7.0 there is no gcc folder, only:
Allwmake bin doc README ReleaseNotes-1.7 src tutorials
applications COPYING etc README.html ReleaseNotes-1.7.html test wmake
Bjorn

bhh July 5, 2010 08:41

Niklas
I meant to say that in OpenFOAM ThirdParty-1.7.0 thre is no gcc flder, only:
[user@OpenFOAM ThirdParty-1.7.0]$ ls
Allclean makeParaView paraview-3.8.0 platforms wmakeFiles
Allwmake metis-5.0pre2 ParMetis-3.1 scotch_5.1
AllwmakeLibccmio openmpi-1.4.1 ParMGridGen-1.0 tools

Bjorn

bhh July 5, 2010 08:45

NIklas,
I found the gcc-4.4.4 under /home/user/OpenFOAM/ThirdParty-1.7.0/platforms/linux/gcc-4.4.4

But there were no files present. This is what I got when executing the command
bash: ../configure: No such file or directory

Bjorn

niklas July 5, 2010 09:17

OK, but then I dont understand from where you managed to run
the configure script when you got the error in the first place.

N

niklas July 5, 2010 09:24

I just checked your error message and saw that its located in

/home/user/build/gcc-4.4.4/build

which makes me wonder if your foam intallation is located under your home-catalog,
because if it isnt the configure script needs to be adjusted accordingly.

N

bhh July 5, 2010 09:43

Niklas,
Yes the gcc.4.4.4 is located as you saw also confirmed below. This became so after following the recipe from Niels. The OpenFOAM is located in:
[user@OpenFOAM OpenFOAM]$ ls
OpenFOAM-1.6 OpenFOAM-1.7.0.gtgz.1 ThirdParty-1.7.0 user-1.6
OpenFOAM-1.6.x OpenFOAM-1.7.x ThirdParty-1.7.0.gtgz
OpenFOAM-1.7.0 ThirdParty-1.6 ThirdParty-1.7.0.gtgz.1
OpenFOAM-1.7.0.gtgz ThirdParty-1.6.x ThirdParty-1.7.x
[user@OpenFOAM OpenFOAM]$ pwd
/home/user/OpenFOAM
Bjorn




___________________________________
checking for suffix of object files... configure: error: in `/home/user/build/gcc-4.4.4/build/i686-pc-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/user/build/gcc-4.4.4/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/user/build/gcc-4.4.4/build'
make: *** [all] Error 2
[user@OpenFOAM build]$ pwd
/home/user/build/gcc-4.4.4/build
[user@OpenFOAM build]$

linnemann July 6, 2010 05:37

Hi

adding these lines to your $HOME/.bashrc file should make it possible to compile gcc-4.4.4

Code:

export LD_LIBRARY_PATH=$HOME/OpenFOAM/ThirdParty-1.7.0/platforms/linux/gmp-5.0.1/lib:$LD_LIBRARY_PATH

export  LD_LIBRARY_PATH=$HOME/OpenFOAM/ThirdParty-1.7.0/platforms/linux/mpfr-2.4.2/lib:$LD_LIBRARY_PATH

Please make sure these paths exists by doing

Code:

ls -l $HOME/OpenFOAM/ThirdParty-1.7.0/platforms/linux/gmp-5.0.1/lib
ls -l $HOME/OpenFOAM/ThirdParty-1.7.0/platforms/linux/mpfr-2.4.2/lib

If these directories do exists go into the $HOME/build/gcc-4.4.4/build folder and issue

Code:

. $HOME/.bashrc
make -j2

This worked for me in 64bit getting the same error you posted.

bhh July 6, 2010 07:11

Niels,
I tried your new scheme and it did not give any errors. I take that I should execute 'make install ' and follow your instructions from before.

When I came to OpenFOAM OpenFOAM-1.7.0] and execute ./Allwmake I got these errors:
+ wmake libso OpenFOAM
SOURCE=global/global.Cver ; sed -e 's/VERSION_STRING/1.7.0/' -e 's/BUILD_STRING/1.7.0-21131bcbd876/' $SOURCE > Make/linuxGccDPOpt/global.C; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/user/OpenFOAM/ThirdParty-1.7.0/zlib-1.2.3 -IlnInclude -I. -I/home/user/OpenFOAM/OpenFOAM-1.7.0/src/OpenFOAM/lnInclude -I/home/user/OpenFOAM/OpenFOAM-1.7.0/src/OSspecific/POSIX/lnInclude -fPIC -c Make/linuxGccDPOpt/global.C -o Make/linuxGccDPOpt/global.o
SOURCE=global/argList/argList.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/user/OpenFOAM/ThirdParty-1.7.0/zlib-1.2.3 -IlnInclude -I. -I/home/user/OpenFOAM/OpenFOAM-1.7.0/src/OpenFOAM/lnInclude -I/home/user/OpenFOAM/OpenFOAM-1.7.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/argList.o
lnInclude/dictionaryTemplates.C: In member function ‘T Foam::dictionary::lookupOrDefault(const Foam::word&, const T&, bool, bool) const [with T = Foam::Switch]’:
global/argList/argList.C:396: instantiated from here
lnInclude/dictionaryTemplates.C:44: error: call of overloaded ‘Switch(Foam::pTraits<Foam::Switch>)’ is ambiguous
lnInclude/Switch.H:140: note: candidates are: Foam::Switch::Switch(int)
lnInclude/Switch.H:134: note: Foam::Switch::Switch(bool)
lnInclude/Switch.H:62: note: Foam::Switch::Switch(const Foam::Switch&)
make: *** [Make/linuxGccDPOpt/argList.o] Error 1

Any guide for what went wrong?
rgds
Bjorn

linnemann July 6, 2010 07:40

Hi

Did you remember to run Allwmake in the Thirdparty folder first?

What is the output of

Code:

OF17
which gcc

This should list gcc as located in $HOME/OpenFOAM/ThirdParty-1.7.0/platforms/linux/gcc-4.4.4/bin/gcc

If this is the case I have no idea what should be going on.

bhh July 6, 2010 07:47

Niels,
Yes, I did the procedure as you mention.
When I issue the command
which gcc I get
/usr/bin/gcc

This is not what you would expect? Any clue what is wrong?
Bjorn

linnemann July 6, 2010 07:54

Hi is there anything in the folder

$HOME/OpenFOAM/ThirdParty-1.7.0/platforms/linux/gcc-4.4.4

if not then the make install step did not install gcc-4.4.4 the right place.

as a side note open the openFOAM/etc/settings and check that the compiler version is as below

Code:

# Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# compilerInstall = OpenFOAM | system
: ${compilerInstall:=OpenFOAM}

I'm guessing this is set to system and it will fail.

After changing run

Code:

OF17
which gcc

again and check the output

bhh July 6, 2010 08:09

Niels,

That seemed to do the trick!

I changed the settings.sh file to (in red):

# compilerInstall = OpenFOAM | system
: ${compilerInstall:=OpenFOAM}
case "${compilerInstall:-OpenFOAM}" in
OpenFOAM)
case "$WM_COMPILER" in
Gcc)
# gcc_version=gcc-4.4.3
gcc_version=gcc-4.4.4

Now it compiles and probably will generate OF1.7.0

Bjorn

bhh July 6, 2010 09:44

Niels,

It compiled and passed the cavity check! Thank you very much for your help!
My next task will be to tray to install paraFoam.

Bjorn

PS! There were some warnings during the compilation (unused variables). Is this something that you also found? Will it be a problem?

bhh July 7, 2010 09:00

Hi,

Following the successfull installation of OF1.7.0 on my 32 bit CentOS linux maschine I have now moved over to install paraFoam. The following error comes at the very end after the command ./makeParaView:
________________________________________
Linking CXX executable ../../../../bin/GraphicsCxxTests
../../../../bin/libvtkRendering.so.pv3.8: undefined reference to `QPainter::drawImage(QPointF const&, QImage const&)'
../../../../bin/libvtkRendering.so.pv3.8: undefined reference to `QTextDocument::setDocumentMargin(double)'
collect2: ld returned 1 exit status
make[2]: *** [bin/GraphicsCxxTests] Error 1
make[1]: *** [VTK/Graphics/Testing/Cxx/CMakeFiles/GraphicsCxxTests.dir/all] Error 2
make: *** [all] Error 2
---
Installation complete for paraview-3.8.0
Set environment variables:

export ParaView_DIR=/home/user/OpenFOAM/ThirdParty-1.7.0/platforms/linuxGcc/paraview-3.8.0
export PATH=$ParaView_DIR/bin:$PATH
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-3.8
---

Done
_____________________________

Anybody out there that migth help me?

rgds
Bjorn

sahm August 13, 2010 17:09

Didn't work at all.
 
Hi everyone
I tried to compile OF17, but got problems, then I saw this thread. I want to install it on a RHEL 5.0 64bit.
I don't have access to root, so I couldn't run the Yum command in post #4.
Then I went through gcc part, and got the same error as post #5 and #6.
Right now I have gcc 4.3.3 under OpenFoam 1.6 third parties, and my OF16 works perfectly.
But when I want to make gcc 4.4.4 I get error.
under OF17 environment, My Gcc is
/usr/bin/gcc
and under 1.6 its
~/OpenFOAM/ThirdParty-1.6/gcc-4.3.3/platforms/linux64/bin/gcc

Ti_Pago_Da_Bere August 14, 2010 13:41

question
 
Guys, I have a question:
I have a cluster with 64bit RHEL 5.0, and previously I have installed OpenFoam 1.6 on it.
Can I replace all the source code for 1.7 with all the source code for 1.6 and wmake it?
does this work?

linnemann August 16, 2010 01:26

Hi

@ SAHM

you need to edit the OpenFOAM settings.sh file to reflect where gcc is installed lige Bjorn did. With the compilation of GCC try and export the library path for mpfr and gmp in your .bashrc file like so.

Code:

export LD_LIBRARY_PATH=/pathToGmp/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/pathToMpfr/lib:$LD_LIBRARY_PATH

Source the .bashrc file

Code:

. $HOME/.bashrc
and try and compile gcc again.

Quote:

I changed the settings.sh file to (in red):

# compilerInstall = OpenFOAM | system
: ${compilerInstall:=OpenFOAM}
case "${compilerInstall:-OpenFOAM}" in
OpenFOAM)
case "$WM_COMPILER" in
Gcc)
# gcc_version=gcc-4.4.3
gcc_version=gcc-4.4.4

Now it compiles and probably will generate OF1.7.0

Bjorn
@ Ti_Pago_Da_Bere

I do not think that is possible. you can use the ThirdParty stuff from my binary release and then get the sources for OF and then do wmake. If you do it this way remember to change the settings.sh file like above.

Otherwise download both my packages and you are ready to run.

1.6 and 1.7 will live happily alongside each other on the same system and a good way to keep them seperate is to use aliases for them in your $HOME/.bashrc file like so.

Code:

alias OF16=". $HOME/OpenFOAM/OpenFOAM-1.6.x/etc/bashrc"
alias OF17=". $HOME/OpenFOAM/OpenFOAM-1.7/etc/bashrc"

Then if you run OF16 from terminal you will use OF 1.6 and if you type OF17 you will switch to OF 1.7.

dhoom September 14, 2010 01:57

Hello Linneman,

I am trying to install CentFOAM and I am getting the following errors when

./centFOAMInstall yum all

"
No package ncurses-devel available.
No package libXt-devel available.
Nothing to do"

Thanks

D

dhoom September 14, 2010 09:01

Quote:

Originally Posted by dhoom (Post 275070)
Hello Linneman,

I am trying to install CentFOAM and I am getting the following errors when

./centFOAMInstall yum all

"
No package ncurses-devel available.
No package libXt-devel available.
Nothing to do"

Thanks

D

Phew!!! got the script to work.

sometimes I wish I could just disappear into one of those cracks on the walls.

anfho September 15, 2010 12:26

Dear All,
is it possible to install the here cited version of CentFOAM on RHEL 4.1.2-46 (I do not know what SL 5.x stands for) on a cluster to which I do not have the root rights? I know the installation requires the "yum" command, which needs root rights that I do not have... Thanks!
Andreas

linnemann September 15, 2010 13:10

Hi

No that will not be possible. It is possible to get OF working on RHEL 4.x releases it will although take some time and will be somewhat more difficult if you cant install packages as root.

SL-5.x is Scientific Linux 5.x where x can be 0,1,2,3,4 or 5.

Best

anfho September 15, 2010 17:47

Hi Linnemann,
thanks for the quick reply. More difficult but thankfully not impossible. According to other threads (http://www.cfd-online.com/Forums/ope...linux-5-a.html) it is possible to install gcc4.3.3 from OF1.6ThridParty and then use OF1.7.1 ... do you agree with that?
Thanks, Andreas

linnemann September 16, 2010 07:40

Hi

If only you were that lucky, I've installed OF-1.5 on a RHEL 4 release and it was not the most trivial task :-) and 1.6 and 1.7 are most likely not easier.

There are some libraries in rhel 4 that are to old for gcc-4.3.x so you need to compile new ones of those and a whole lot of other stuff I cant remember.

But again Google is your friend
http://cheminsilico.blogspot.com/200...-on-rhel4.html

From here on you are on your own I'm afraid, unless some other member has a cluster/workstation with rhel/centos 4 on it.


All times are GMT -4. The time now is 06:52.