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) http://www.cfd-online.com/Forums/blogs/wyldckat/385-automated-scripts-building-gcc-4-4-x-4-5-x-using-openfoam-1-7-series.html

(Link 2: discussion forum) http://www.cfd-online.com/Forums/openfoam-installation/73629-openfoam-installation-redhat-enterprise-linux-5-a.html

(Link 3: OpenFOAM in CentOS) http://sourceforge.net/apps/mediawiki/centfoam/index.php?title=Main_Page


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/libstdc++.so.6: 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

ThirdParty-1.7.1/platforms/linux64/gcc-4.3.3/lib64/libstdc++.so.6.0.10



So, I copied libstdc++.so.6.0.10 to /usr/lib/ and make a newer link

ln   -sf   libstdc++.so.6.0.10   libstdc++.so.6

(The file libstdc++.so.6.0.10 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: http://www.cfd-online.com/Forums/openfoam-installation/80787-missing-vtf3-h-bpatch-h-papi-h.html

vtf3 library problem can be solved. See
http://anirban.org/cs521/ass7/
Download VTF library and extract & copy to a convenient location.

For bfd.h, it is found at
 /home/albertsk/OpenFOAM/ThirdParty-1.7.1/platforms/build-linux64Gcc/binutils-2.20.1/bfd/bfd.h
/home/albertsk/OpenFOAM/ThirdParty-1.7.1/platforms/linux64/gcc-4.5.2/include/bfd.h
/home/usr/local/binutils-2.21/include/bfd.h
Perhaps, these directories should be included in "INCLUDE" environment.

For iberty package, it is because binutils-devel is not installed.
http://www.rootninja.com/configuring-and-making-oprofile-for-a-custom-kernel-on-fedora/
/home/albertsk/OpenFOAM/ThirdParty-1.7.1/binutils-2.20.1/include/libiberty.h
/home/albertsk/OpenFOAM/ThirdParty-1.7.1/gcc-4.5.2/include/libiberty.h

No comments:

Labels

Blog Archive