pcl
pcl copied to clipboard
Fix `pcl_cc_tool_interface` library build configuration
- Set
PICproperty forpcl_cc_tool_interfacetarget in CMake
Current build configuration produces the following error on my linux platform:
[ 49%] Automatic MOC and UIC for target pcl_cc_tool_fpfh_estimation
[ 49%] Built target pcl_cc_tool_fpfh_estimation_autogen
[ 49%] Building CXX object apps/cloud_composer/CMakeFiles/pcl_cc_tool_fpfh_estimation.dir/pcl_cc_tool_fpfh_estimation_autogen/mocs_compilation.cpp.o
[ 49%] Building CXX object apps/cloud_composer/CMakeFiles/pcl_cc_tool_fpfh_estimation.dir/tools/fpfh_estimation.cpp.o
[ 49%] Linking CXX shared library ../../lib/cloud_composer_plugins/libpcl_cc_tool_fpfh_estimation.so
/usr/bin/ld: ../../lib/libpcl_cc_tool_interface.a(cloud_item.cpp.o): warning: relocation against `_ZN3pcl6traits4nameINS_12_PointXYZRGBENS_6fields1yELi0EE5valueE' in read-only section `.text._ZN3pcl13createMappingINS_11PointXYZRGBEEEvRKSt6vectorINS_13PCLPointFieldESaIS3_EERS2_INS_6detail12FieldMappingESaIS9_EE[_ZN3pcl13createMappingINS_11PointXYZRGBEEEvRKSt6vectorINS_13PCLPointFieldESaIS3_EERS2_INS_6detail12FieldMappingESaIS9_EE]'
/usr/bin/ld: ../../lib/libpcl_cc_tool_interface.a(mocs_compilation.cpp.o): relocation R_X86_64_PC32 against symbol `_ZN3pcl14cloud_composer15PropertiesModel16staticMetaObjectE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [apps/cloud_composer/CMakeFiles/pcl_cc_tool_fpfh_estimation.dir/build.make:209: lib/cloud_composer_plugins/libpcl_cc_tool_fpfh_estimation.so.1.15.1.99] Error 1
make[1]: *** [CMakeFiles/Makefile2:9741: apps/cloud_composer/CMakeFiles/pcl_cc_tool_fpfh_estimation.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
At the moment I can not confirm neither necessity, neither the lack of necessity of pcl_cc_tool_interface to be a static library in recent versions of PCL. But these changes will fix the error.