Search This Blog

Wednesday, April 20, 2011

gcc and OpenFOAM

I also find a couple of links that may be useful to you to compile gcc and OpenFOAM. (by Shengmeng at Platform Inc.)

(Link 1)

(Link 2: discussion forum)

(Link 3: OpenFOAM in CentOS)

I followed the steps in link 1 and so far so good.

First, Using yum in RHEL, I downloaded and installed flex, texinfo, byacc, and bison.

$ yum install -y flex flex++ --downloadonly --downloaddir=/home/albertsk/packages/
$ rpm -i /home/albertsk/packages/flex-2.5.4a-41.fc6.x86_64.rpm

$ yum install -y bison --downloadonly --downloaddir=/home/albertsk/packages/$ rpm -i /home/albertsk/packages/bison-2.3-2.1.x86_64.rpm 

$ yum install -y byacc --downloadonly --downloaddir=/home/albertsk/packages/
$ rpm -i /home/albertsk/packages/byacc-1.9-29.2.2.x86_64.rpm

Second, I downloaded  File Type: gz build-gcc_v4.tar.gz (5.7 KB, 12 views) and used the script to install other utilities such as gcc, gmp, mpfr and mpc.  During this process, I defined set FOAM_INST_DIR under my $HOME directory, which is quite important to "source etc/bashrc" for compiling environment.

Third, I went to OpenFOAM/OpenFOAM-1.7.1 directory and execute
$ ./Allwmake

which is still going on for about a half day. 

Fourth, later on I found that not all the executable files are built and got error message that says "/usr/lib/ version `GLIBCXX_3.4.9' not found".  None of web information is directly useful, so I search the library and found an newer version at


So, I copied to /usr/lib/ and make a newer link

ln   -sf

(The file should be copied to all the compute nodes and the link should be updated once a serial OpenFOAM test is done in fractal.)

Fifth, I got 4 errors in config such as

configure: error: no vtf3.h found; check path for VTF3 package first...
configure: error: no bfd.h found; check path for BFD package first...
configure: error: no libiberty.h found; check path for LIBERTY package first...
configure: error: no papi.h found; check path for PAPI package first...

This link seems to have a solution:

vtf3 library problem can be solved. See
Download VTF library and extract & copy to a convenient location.

For bfd.h, it is found at
Perhaps, these directories should be included in "INCLUDE" environment.

For iberty package, it is because binutils-devel is not installed.

No comments:


Blog Archive