[vtkusers] Building vtkGraphics with -fPIC

Bill Lorensen bill.lorensen at gmail.com
Tue Feb 14 11:35:48 EST 2012


I don't think you should be setting -fPic directory. Try building your
vtk with SHARED_LIBS ON.

On Tue, Feb 14, 2012 at 10:53 AM, Bouchard, Andrew T CIV NSWC, PCD
<andrew.bouchard at navy.mil> wrote:
> 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
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
Unpaid intern in BillsBasement at noware dot com



More information about the vtkusers mailing list