Topic: Error linking PETSc
Hi, Borek
We compiled the solver PETSc and generated some static library files. The following error occurred when installing OOFEM.
How to make OOFEM run PETSc static library compilation?
We are looking forward to your help. Thank you very much my friends
****************************************************************************
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(cdf.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(or.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(and.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(bipartite.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(degree.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(dasub.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(bitmask.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(dmlocalsnes.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(vi.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(dmlocalts.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(dmplexts.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(simple.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /public/home/WL/petsc-3.14.0/arch-linux-cxx-debug/lib/libpetsc.a(andor.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/liboofem.dir/build.make:1241: liboofem.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:1121: CMakeFiles/liboofem.dir/all] Error 2
make: *** [Makefile:147: all] Error 2
**********************************************************************************