CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

OpenFOAM static build on Cray XT5

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   May 1, 2009, 21:10
Default OpenFOAM static build on Cray XT5
  #1
New Member
 
Join Date: May 2009
Location: Japan
Posts: 5
Rep Power: 17
asaijo is on a distinguished road
Hi, all.

I want to report the partiallly successful compilation of OpenFOAM on Cray XT5. As you know, Cray XT5
uses CNL for their node exectuion, so I had to compile the OpenFOAM statically. I could compile
almost all solvers and utilities (but some of them didn't work correctly.) I think it's easy to apply
these procedures to other static-linked only platforms.

Here is the recipe:

0. Switch to GNU compiler (for Cray XT5 module system)
$ module swap PrgEnv-pgi PrgEnv-gnu

1. Expand OpenFOAM-1.5.x.tar.gz (fetched from git repo) and ThirdParty.tar.gz into the CNL-accesible
directory and remove the needless libraries (malloc, zlib and openmpi) in ./ThirdParty. Edit
ThirdParty/Allwmake to comment out malloc and zlib build directives.

NOTE: if you want to use openmpi attached in ThirdParty.tar.gz, you must modify openmpi build
configure script in Allwmake.
Change "--enable-shared --disable-static" to "--disable-shared --enable-static",
and add "--without-memory-manager --without-libnuma".
cf. http://www.open-mpi.org/faq/?category=mpi-apps#static-mpi-apps

2. Edit etc/{bashrc,settings.sh}:
bashrc:
foamInstall=$YOUR_INSTALLED_DIR/$WM_PROJECT
WM_PROJECT_USER_DIR=$FOAM_INST_DIR/$USER-$WM_PROJECT_VERSION
WM_MPLIB=MPICH

settings.sh:
comilerInstall=OpenFOAM => System

case "$WM_MPLIB" in
...
MPICH) => MPICH_ORG)
....
MPI) => MPICH)
export MPI_ARCH_PATH=$MPICH_DIR
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN

Finally, read all configurations.
$ . etc/bashrc

3. Change libso to libo in all Allwmake:
$ cd $FOAM_INST_DIR
$ find -name Allwmake -exec ruby -p -i.bak -e"gsub(/libso/, 'libo')" {} \;
And make solvers not to link indivisual libraries:
$ find -name options -exec ruby -p -i.bak -e"gsub(/EXE_LIBS/, 'EXE_LIBS_ORG')" {} \;

4. Comment out all codes relevant with libdl functions:
You can find them by executing this on shell:
$ find -name "*.C" -exec grep -nH dlfcn {} \;
./src/OpenFOAM/db/dlLibraryTable/dlLibraryTable.C:29:#include <dlfcn.h>
./src/OSspecific/Unix/printStack.C:36:#include <dlfcn.h>

And in $WM_PROJECT_DIR/wmake/rules/$WM_ARCH$WM_COMPILER/general,
replace "-ldl" by "-lz".

5. Make all libraries:
$ cd $WM_PROJECT_DIR
Comment out "(cd applications ..." in Allwmake.
$ export WM_NCOMPPROCS=2; ./Allwmake

6. Make the whole OpenFOAM library:
$ cd $FOAM_LIBBIN
$ ar rcvs libOpenFOAM.a lib*.o

7. Make solvers & utilities Edit $WM_PROJECT_DIR/wmake/rules/$WM_ARCH$WM_COMPILER/c++ to change the compiler and environment
variable:
CC = g++ => CC (or mpiCC)
LINK_LIBS = $(c++DBUG) => -static -Wl,--allow-multiple-definition

$ cd $FOAM_APP
$ ./Allwmake

Known Problems:
* The "functionObjectLibs" directive doesn't work because it loads shared library.
* Linker option "--allow-multiple-definition" suppresses errors of multiple definition of the lexers. I
don't have any ideas about what side-effects it bring on.

Cheers,
asaijo
asaijo is offline   Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I build OpenFOAM in cygwin joywe OpenFOAM Installation 10 September 12, 2008 09:39
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07
Build OpenFOAM on MacOSX Mauro Augelli (Augelli) OpenFOAM Installation 101 July 21, 2008 06:42
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 14:25
OpenFOAM build from source instructions tj22 OpenFOAM Installation 7 April 6, 2006 16:15


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