AnsweredAssumed Answered

Compiling shared libraries for PETSc

Question asked by yurtesen on Jun 5, 2012
Latest reply on Jun 27, 2012 by yurtesen

I am trying to build PETSc with shared libraries. I have given --sharedLibraryFlags="-fPIC -shared" option yet I am getting the error below. Is it possible that open64 is accidentally using libopen64rt.a instead of libopen64rt_shared.a ? (I am not sure at what point PETSc is passing -fPIC -shared options. This compiles fine on GCC. Any ideas?

 

 

Completed building libraries

=========================================

making shared libraries in /export/tmp/petsc-3.2-p7/arch-linux2-c-opt/lib

building libpetsc.so

/usr/bin/ld:

/export/modules/compilers/amd/x86_open64/4.5.1/lib/gcc-lib/x86_64-open64-linux/4.5.1/libopen64rt.a(cacheinfo.o):

relocation R_X86_64_32S against `.rodata'

a shared object; recompile with -fPIC

/export/modules/compilers/amd/x86_open64/4.5.1/lib/gcc-lib/x86_64-open64-linux/4.5.1/libopen64rt.a:

could not read symbols: Bad value 

collect2: ld returned 1 exit status

=========================================

Now to install the libraries do:

make PETSC_DIR=/export/tmp/petsc-3.2-p7 PETSC_ARCH=arch-linux2-c-opt

install

=========================================

Outcomes