recompiling with -fPIC

Hi all,

I'm compiling an open source software on Centos7 GPU with gcc-6.0.1, does anyone know how to solve the follosing error? Thanks.


[ 67%] Linking CXX executable ../bin/test_grid_cu
/data/program/conda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: warning: libz.so.1, needed by /lib64/libopenbabel.so, not found (try using -rpath or -rpath-link)
/data/program/conda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: CMakeFiles/test_gridmaker_cu.dir/test_gridmaker.cu.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/data/program/conda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../lib64/libmolgrid.a(grid_maker.cu.o): relocation R_X86_64_32S against symbol `_ZTVN6thrust6system12system_errorE' can not be used when making a PIE object; recompile with -fPIC
/data/program/conda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../lib64/libmolgrid.a(coordinateset.cu.o): relocation R_X86_64_32 against symbol `_ZN10libmolgrid20sum_vector_types_gpuENS_4GridIfLm2ELb1EEENS0_IfLm1ELb1EEE' can not be used when making a PIE object; recompile with -fPIC
/data/program/conda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../lib64/libmolgrid.a(transform.cu.o): relocation R_X86_64_32 against symbol `_ZN10libmolgrid26transform_translate_kernelIfEEvj6float3NS_4GridIT_Lm2ELb1EEES4_' can not be used when making a PIE object; recompile with -fPIC
/data/program/conda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[5]: *** [bin/test_grid_cu] Error 1
make[4]: *** [test/CMakeFiles/test_grid_cu.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [grid-prefix/src/grid-stamp/grid-build] Error 2
make[1]: *** [CMakeFiles/grid.dir/all] Error 2
make: *** [all] Error 2
Last edited on
recompiling with -fPIC

and check for the missing file libz.so.1
Topic archived. No new replies allowed.