Hi,
I am building Slicer in ubuntu 18.04. I followed every step in https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions#Linux. But now I run into a build error: /usr/bin/ld: CMakeFiles/vtkParseJava.dir/vtkParseJava.c.o: relocation R_X86_64_32 against .rodata can not be used when making a PIE object; recompile with -fPIC.
/usr/bin/ld: …/…/lib/libvtkWrappingTools-8.2.a(vtkParseMain.c.o): relocation R_X86_64_32 against `.rodata’ can not be used when making a PIE object; recompile with -fPIC
…
My environment is:
gcc/g++ 7.3, qt5.12, cmake 3.14, python 2.17.
My cmake command is
cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DQt5_DIR:PATH=/home/me/Qt/5.12.0/gcc_64/lib/cmake/Qt5 -DSlicer_USE_SYSTEM_QT:BOOL=1 -DQT_QMAKE_EXECUTABLE=/home/me/Qt/5.12.0/gcc_64/bin/qmake …/Slicer
Could anyone please help me out? I tried to add -fPIC in CMakeLists.txt as this post, https://stackoverflow.com/questions/19364969/compilation-fails-with-relocation-r-x86-64-32-against-rodata-str1-8-can-not. But it still doesn’t work.
Thanks a lot.