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

OpenFOAM static build on Cray XT5

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
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: 7
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

Old   August 30, 2009, 22:32
Default
  #2
Member
 
David Hebert
Join Date: Mar 2009
Posts: 31
Rep Power: 7
dhebert is on a distinguished road
Hi Asaijo,

Can you clarify in step 4 how you comment out those codes? Did you put a double slash comment '//' in Make/files? I did this and after making libOpenFOAM.a I still get errors about undefined reference to dlLibaryTable and printStack.

Thanks,

David


u/home/dhebert/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.a(libOpenFOAM.o): In function `bool Foam::dlLibraryTable:pen<Foam::HashTable<Foam::a utoPtr<Foam::GAMGAgglomeration> (*)(Foam::lduMatrix const&, Foam::dictionary const&), Foam::word, Foam::string::hash>*>(Foam::dictionary const&, Foam::word const&, Foam::HashTable<Foam::autoPtr<Foam::GAMGAgglomerat ion> (*)(Foam::lduMatrix const&, Foam::dictionary const&), Foam::word, Foam::string::hash>* const&)':
(.text._ZN4Foam14dlLibraryTable4openIPNS_9HashTabl eIPFNS_7autoPtrINS_17GAMGAgglomerationEEERKNS_9ldu MatrixERKNS_10dictionaryEENS_4wordENS_6string4hash EEEEEbSB_RKSE_RKT_[bool Foam::dlLibraryTable:pen<Foam::HashTable<Foam::a utoPtr<Foam::GAMGAgglomeration> (*)(Foam::lduMatrix const&, Foam::dictionary const&), Foam::word, Foam::string::hash>*>(Foam::dictionary const&, Foam::word const&, Foam::HashTable<Foam::autoPtr<Foam::GAMGAgglomerat ion> (*)(Foam::lduMatrix const&, Foam::dictionary const&), Foam::word, Foam::string::hash>* const&)]+0x125): undefined reference to `Foam::dlLibraryTable:pen(Foam::fileName const&)'

/u/home/dhebert/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.a(libOpenFOAM.o): In function `Foam::IOerror::abort()':
(.text+0x1ded): undefined reference to `Foam::error:rintStack(Foam::Ostream&)'
dhebert is offline   Reply With Quote

Old   September 6, 2009, 21:46
Default
  #3
New Member
 
Join Date: May 2009
Location: Japan
Posts: 5
Rep Power: 7
asaijo is on a distinguished road
Hi, David

Quote:
Originally Posted by dhebert View Post
Can you clarify in step 4 how you comment out those codes? Did you put a double slash comment '//' in Make/files? I did this and after making libOpenFOAM.a I still get errors about undefined reference to dlLibaryTable and printStack.
You should comment out just only the part of the code which is relevant with dynamic library functions.

Code:
--- printStack.C~	2009-04-24 12:19:39.000000000 +0900
+++ printStack.C	2009-04-30 18:55:16.000000000 +0900
@@ -33,7 +33,7 @@
 
 #include <cxxabi.h>
 #include <execinfo.h>
-#include <dlfcn.h>
+//#include <dlfcn.h>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -87,28 +87,28 @@
 {
     word myAddress = address;
 
-    if (filename.ext() == "so")
-    {
-        // Convert offset into .so into offset into executable.
+//     if (filename.ext() == "so")
+//     {
+//         // Convert offset into .so into offset into executable.
 
-        void *addr;
-        sscanf(myAddress.c_str(), "%p",&addr);
+//         void *addr;
+//         sscanf(myAddress.c_str(), "%p",&addr);
 
-        Dl_info info;
+//         Dl_info info;
 
-        dladdr(addr, &info);
+//         dladdr(addr, &info);
 
-        unsigned long offset = ulong(info.dli_fbase);
+//         unsigned long offset = ulong(info.dli_fbase);
 
-        IStringStream addressStr(address.substr(2));
-        label addressValue = readHexLabel(addressStr);
-        label relativeAddress = addressValue-offset;
+//         IStringStream addressStr(address.substr(2));
+//         label addressValue = readHexLabel(addressStr);
+//         label relativeAddress = addressValue-offset;
 
-        // Reconstruct hex word from address
-        OStringStream nStream;
-        nStream << "0x" << hex << relativeAddress;
-        myAddress = nStream.str();
-    }
+//         // Reconstruct hex word from address
+//         OStringStream nStream;
+//         nStream << "0x" << hex << relativeAddress;
+//         myAddress = nStream.str();
+//    }
 
     if (filename[0] == '/')
     {

--- dlLibraryTable.C~	2009-04-24 18:19:39.000000000 +0900
+++ dlLibraryTable.C	2009-04-30 20:33:28.000000000 +0900
@@ -26,7 +26,7 @@
 
 #include "dlLibraryTable.H"
 
-#include <dlfcn.h>
+//#include <dlfcn.h>
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
@@ -55,10 +55,10 @@
 
 Foam::dlLibraryTable::~dlLibraryTable()
 {
-     forAllIter(dlLibraryTable, *this, iter)
-     {
-         dlclose(iter.key());
-     }
+//     forAllIter(dlLibraryTable, *this, iter)
+//     {
+//         dlclose(iter.key());
+//     }
 }
 
 
@@ -69,14 +69,14 @@
     if (functionLibName.size())
     {
       void* functionLibPtr = NULL;
-      dlopen(functionLibName.c_str(), RTLD_LAZY|RTLD_GLOBAL);
+      //dlopen(functionLibName.c_str(), RTLD_LAZY|RTLD_GLOBAL);
 
         if (!functionLibPtr)
         {
             FatalErrorIn
             (
                 "dlLibraryTable::open(const fileName& functionLibName)"
-            )   << "could not load " << dlerror()
+             )   << "could not load " << functionLibName.c_str()
                 << endl;
 
             return false;
Regards,
asaijo
asaijo is offline   Reply With Quote

Old   September 7, 2009, 14:17
Default
  #4
Member
 
David Hebert
Join Date: Mar 2009
Posts: 31
Rep Power: 7
dhebert is on a distinguished road
Thanks Asaijo, this a big help!

I can compile fine, but when I go to compile an application (incompressible/pisoFoam in this case) I get warnings regarding getpwnam, getpwuid, gethostbyname...

/u/home/dhebert/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.a(libOSspecific.o): In function `Foam::home(Foam::word const&)':
(.text+0x4774): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/u/home/dhebert/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.a(libOSspecific.o): In function `Foam::home()':
(.text+0x46e8): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/u/home/dhebert/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.a(libOSspecific.o): In function `Foam:ing(Foam::word const&, int, int)':
(.text+0x433b): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

The issue now is when I try to run the pisoFoam tutorial with kEpsilon turbulence model there is an error and pisoFoam is only finding laminar turbulence model...

Unknown turbulenceModel type RASModel

Valid turbulenceModel types are :

1
(
laminar
)


From function turbulenceModel::New(const volVectorField&, const surfaceScalarField&, transportModel&)
in file turbulenceModel.C at line 102.

FOAM exiting


Have you come across this problem? My first thought is there is a problem linking to the src/tubulenceModels library. Any ideas if this is the case?

Thanks,

David
dhebert is offline   Reply With Quote

Old   September 9, 2009, 23:41
Default
  #5
New Member
 
Join Date: May 2009
Location: Japan
Posts: 5
Rep Power: 7
asaijo is on a distinguished road
David,

Yes I also came across similiar errors. As I wrote first, these
static-compilation processes are very partial and still have many
problems.

And I noticed you were using the 1.6 version of OpenFOAM. My
complication case is for version 1.5.x, so maybe there would be some
differences. (I haven't yet tried to compile the version 1.6.)

What I can say is that you should ensure all of object files (*.o) are
in $FOAM_LIBBIN.

Regards,
asaijo
asaijo is offline   Reply With Quote

Old   April 14, 2010, 08:07
Default
  #6
New Member
 
Join Date: Mar 2010
Posts: 10
Rep Power: 6
holand_us is on a distinguished road
Hi David
I have the same problem now this
+ aprun -n 64 ./pisoFoam -parallel
[2]
[2]
[2] Unknown turbulenceModel type LESModel

Valid turbulenceModel types are :

1
(
laminar
)
[2]
[2]
[2] From function turbulenceModel::New(const volVectorField&, const surfaceScalarField&, transportModel&)
[2] in file turbulenceModel.C at line 102.
[2]
FOAM parallel run exiting

Did u solve it
Thanks
holand_us is offline   Reply With Quote

Old   June 30, 2010, 17:15
Default errors with flex lexer
  #7
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 382
Rep Power: 8
gwierink is on a distinguished road
Dear all,

I followed the above advise (many thanks by the way!), but while compiling the the application I get lexer errors. Strangely enough, not for dnsFoam, laplacianFoam, potentialFoam, and scalarTransportFoam. Trouble starts when compiling combustion/PDRFoam. The system is Cray XT5 with gcc-4.4.3, flex 2.5.31, and zlib-1.2.3.

I also found this thread on yyFlexLexer issues, from where I changed a line in flex++ of wmake:
Code:
Ltoo = flex++ -f $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -DYY_SKIP_YYWRAP -c $*.C -o $@
The error:
Code:
/opt/cray/xt-asyncpe/3.7/bin/CC: INFO: linux target is being used
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::LexerOutput(char const*, int)':
(.text+0x10380): multiple definition of `yyFlexLexer::LexerOutput(char const*, int)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x6390): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_get_next_buffer()':
(.text+0xfb00): multiple definition of `yyFlexLexer::yy_get_next_buffer()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5ad0): first defined here
/usr/bin/ld: Warning: size of symbol `yyFlexLexer::yy_get_next_buffer()' changed from 844 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o) to 860 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o)
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyalloc(unsigned int)':
(.text+0xff40): multiple definition of `yyalloc(unsigned int)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5f10): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yypush_buffer_state(yy_buffer_state*)':
(.text+0x10080): multiple definition of `yyFlexLexer::yypush_buffer_state(yy_buffer_state*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x6050): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_flush_buffer(yy_buffer_state*)':
(.text+0xf700): multiple definition of `yyFlexLexer::yy_flush_buffer(yy_buffer_state*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x58e0): first defined here
/usr/bin/ld: Warning: size of symbol `yyFlexLexer::yy_flush_buffer(yy_buffer_state*)' changed from 85 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o) to 77 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o)
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_push_state(int)':
(.text+0xff60): multiple definition of `yyFlexLexer::yy_push_state(int)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5f20): first defined here
/usr/bin/ld: Warning: size of symbol `yyFlexLexer::yy_push_state(int)' changed from 150 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o) to 142 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o)
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_get_previous_state()':
(.text+0xf500): multiple definition of `yyFlexLexer::yy_get_previous_state()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5710): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yyinput()':
(.text+0xfe60): multiple definition of `yyFlexLexer::yyinput()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5e20): first defined here
/usr/bin/ld: Warning: size of symbol `yyFlexLexer::yyinput()' changed from 226 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o) to 217 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o)
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_pop_state()':
(.text+0xf7e0): multiple definition of `yyFlexLexer::yy_pop_state()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x59b0): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyrealloc(void*, unsigned int)':
(.text+0xfae0): multiple definition of `yyrealloc(void*, unsigned int)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5ac0): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_switch_to_buffer(yy_buffer_state*)':
(.text+0x10140): multiple definition of `yyFlexLexer::yy_switch_to_buffer(yy_buffer_state*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x6100): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yyensure_buffer_stack()':
(.text+0x10000): multiple definition of `yyFlexLexer::yyensure_buffer_stack()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5fc0): first defined here
/usr/bin/ld: Warning: size of symbol `yyFlexLexer::yyensure_buffer_stack()' changed from 141 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o) to 125 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o)
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_top_state()':
(.text+0xf820): multiple definition of `yyFlexLexer::yy_top_state()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x59f0): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yywrap':
(.text+0xf2e0): multiple definition of `yywrap'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5510): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yypop_buffer_state()':
(.text+0xf760): multiple definition of `yyFlexLexer::yypop_buffer_state()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5940): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yyFlexLexer(std::basic_istream<char, std::char_traits<char> >*, std::basic_ostream<char, std::char_traits<char> >*)':
(.text+0xf300): multiple definition of `yyFlexLexer::yyFlexLexer(std::basic_istream<char, std::char_traits<char> >*, std::basic_ostream<char, std::char_traits<char> >*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5520): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_try_NUL_trans(int)':
(.text+0xf580): multiple definition of `yyFlexLexer::yy_try_NUL_trans(int)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5790): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_load_buffer_state()':
(.text+0xf6c0): multiple definition of `yyFlexLexer::yy_load_buffer_state()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x58b0): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::~yyFlexLexer()':
(.text+0xf9e0): multiple definition of `yyFlexLexer::~yyFlexLexer()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x63f0): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::LexerError(char const*)':
(.text+0x10b40): multiple definition of `yyFlexLexer::LexerError(char const*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x6bd0): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::~yyFlexLexer()':
(.text+0xfa60): multiple definition of `yyFlexLexer::~yyFlexLexer()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x6460): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_init_buffer(yy_buffer_state*, std::basic_istream<char, std::char_traits<char> >*)':
(.text+0x101e0): multiple definition of `yyFlexLexer::yy_init_buffer(yy_buffer_state*, std::basic_istream<char, std::char_traits<char> >*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x61a0): first defined here
/usr/bin/ld: Warning: size of symbol `yyFlexLexer::yy_init_buffer(yy_buffer_state*, std::basic_istream<char, std::char_traits<char> >*)' changed from 148 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o) to 107 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o)
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::LexerInput(char*, int)':
(.text+0x103a0): multiple definition of `yyFlexLexer::LexerInput(char*, int)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x63a0): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_create_buffer(std::basic_istream<char, std::char_traits<char> >*, int)':
(.text+0x10260): multiple definition of `yyFlexLexer::yy_create_buffer(std::basic_istream<char, std::char_traits<char> >*, int)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x6240): first defined here
/usr/bin/ld: Warning: size of symbol `yyFlexLexer::yy_create_buffer(std::basic_istream<char, std::char_traits<char> >*, int)' changed from 171 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o) to 139 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o)
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::~yyFlexLexer()':
(.text+0xf960): multiple definition of `yyFlexLexer::~yyFlexLexer()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x64d0): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yyFlexLexer(std::basic_istream<char, std::char_traits<char> >*, std::basic_ostream<char, std::char_traits<char> >*)':
(.text+0xf3c0): multiple definition of `yyFlexLexer::yyFlexLexer(std::basic_istream<char, std::char_traits<char> >*, std::basic_ostream<char, std::char_traits<char> >*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x55d0): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yy_delete_buffer(yy_buffer_state*)':
(.text+0xf8e0): multiple definition of `yyFlexLexer::yy_delete_buffer(yy_buffer_state*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5a40): first defined here
/usr/bin/ld: Warning: size of symbol `yyFlexLexer::yy_delete_buffer(yy_buffer_state*)' changed from 117 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o) to 109 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o)
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yyunput(int, char*)':
(.text+0xf5c0): multiple definition of `yyFlexLexer::yyunput(int, char*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x57d0): first defined here
/usr/bin/ld: Warning: size of symbol `yyFlexLexer::yyunput(int, char*)' changed from 220 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o) to 236 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o)
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyfree(void*)':
(.text+0xf8c0): multiple definition of `yyfree(void*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5a30): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yylex()':
(.text+0x10420): multiple definition of `yyFlexLexer::yylex()'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x65e0): first defined here
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::yyrestart(std::basic_istream<char, std::char_traits<char> >*)':
(.text+0x10300): multiple definition of `yyFlexLexer::yyrestart(std::basic_istream<char, std::char_traits<char> >*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x62f0): first defined here
/usr/bin/ld: Warning: size of symbol `yyFlexLexer::yyrestart(std::basic_istream<char, std::char_traits<char> >*)' changed from 151 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o) to 119 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o)
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o): In function `yyFlexLexer::switch_streams(std::basic_istream<char, std::char_traits<char> >*, std::basic_ostream<char, std::char_traits<char> >*)':
(.text+0xf480): multiple definition of `yyFlexLexer::switch_streams(std::basic_istream<char, std::char_traits<char> >*, std::basic_ostream<char, std::char_traits<char> >*)'
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o):(.text+0x5680): first defined here
/usr/bin/ld: Warning: size of symbol `yyFlexLexer::switch_streams(std::basic_istream<char, std::char_traits<char> >*, std::basic_ostream<char, std::char_traits<char> >*)' changed from 133 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libreactionThermophysicalModels.o) to 105 in /users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libtriSurface.o)
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libOSspecific.o): In function `Foam::home(Foam::word const&)':
(.text+0x42ba): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libOSspecific.o): In function `Foam::userName()':
(.text+0x39c3): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.a(libOSspecific.o): In function `Foam::ping(Foam::word const&, int, int)':
(.text+0x375a): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: ld returned 1 exit status
make: *** [/users/gwierink/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/PDRFoam] Error 1
Would anyone have an idea? Many thanks in advance!
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   March 31, 2011, 13:49
Default Question about number "4" I'm trying to apply this to 1.7.x
  #8
New Member
 
James Dunlop
Join Date: Mar 2009
Posts: 3
Rep Power: 7
dunlopjp is on a distinguished road
Quote:
Originally Posted by asaijo View Post
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/?categor...tatic-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


It looks there are "*.c" files as well as "*.C" that contain the dlfcn.h header file. I just wanted to double check we want to comment out any functions dealing with libdl. This could get ugly.
dunlopjp is offline   Reply With Quote

Old   March 31, 2011, 14:53
Default
  #9
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 382
Rep Power: 8
gwierink is on a distinguished road
Hi James,

I tried the static build, but got stuck and built OpenFOAM dynamically. My notes live here, I hope it's of some help.
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   April 6, 2011, 12:21
Default
  #10
New Member
 
James Dunlop
Join Date: Mar 2009
Posts: 3
Rep Power: 7
dunlopjp is on a distinguished road
Quote:
Originally Posted by gwierink View Post
Hi James,

I tried the static build, but got stuck and built OpenFOAM dynamically. My notes live here, I hope it's of some help.
Hi Gijs

Thanks for the information, I am looking at your information now. I just wanted to let you know I had a problem with lexer also. I had a log of the build including errors and I traced it back to a missing header file located in "/app2/gnu/platforms/x86_64/include" what I did was add information to the Makefile located "~/OpenFOAM-1.7.x/wmake/Makefile" where the necessary header file could be found. Your location would be different.

here's a diff comparison

"
12:08:39$ diff Makefile_orig Makefile_new
74c74
< EXE_INC =
---
> EXE_INC =
142c142,143
< $(SYS_INC)
---
> $(SYS_INC) \
> -I/app2/gnu/platforms/x86_64/include
"

You also stated you did a dynamic build. On this cray in order to take advantage of parallel processing I think it's required I do a "Static" build.

Thanks for the response.

Jim
dunlopjp is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
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 on Windows, Mac and other Unsupported Platforms 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 07:21.