[vtkusers] Building vtkGraphics with -fPIC

Bouchard, Andrew T CIV NSWC, PCD andrew.bouchard at navy.mil
Tue Feb 14 10:53:36 EST 2012


Hey everyone,

I'm trying to install the Point Cloud Library, and during the build I'm getting the following error:

Linking CXX shared library ../lib/libpcl_surface.so
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: /usr/local/lib/vtk-5.8/libvtkGraphics.a(vtkButterflySubdivisionFilter.cxx.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/vtk-5.8/libvtkGraphics.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [lib/libpcl_surface.so.1.4.0] Error 1
make[1]: *** [surface/CMakeFiles/pcl_surface.dir/all] Error 2
make: *** [all] Error 2

I got almost exactly the same error earlier, but it was for libvtkCommon rather than libvtkGraphics. I fixed it by modifying VTK/Common/CMakeLists.txt on line 546, adding -fPIC to the GET_TARGET_PROPERTY line, and had hoped to fix it the same way here, but I can't find a GET_TARGET_PROPERTY command for vtkGraphics. I've tried running ccmake and adding -fPIC to all the FLAGS variables to no avail. I also tried adding SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") to the main CMakeLists.txt, but that also didn't seem to have an effect. Can anyone tell me how to build this with fPIC?

V/R Andrew

Andrew Bouchard
Research Engineer
Code X22 Automation, Dynamics, and Special Projects
Naval Surface Warfare Center, Panama City
andrew.bouchard at navy.mil
850-636-6467


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5212 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120214/6bed0940/attachment.bin>


More information about the vtkusers mailing list