Try to support using system installed protobuf
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
For Fedora packages, need to use the system installed version of libraries. Attached is a hack to try to do that with 3.98.0. First step is to change:
-vtk_module_third_party(protobuf +vtk_module_third_party(Protobuf
in ParaView/ThirdParty/protobuf/CMakeLists.txt so that cmake finds FindProtobuf.cmake. Next I hacked out:
+#vtk_target_export(protobuf) +#vtk_target_export(protobuf-lite) +#vtk_compile_tools_target_export(protoc_compiler)
because they are not available in that configuration.
Finally, Fedora 18 has protobuf 2.4.1 and the compiler is named "protoc" so I changed the name in ParaView/ParaViewCore/ServerImplementation/Core/CMakeLists.txt and removed protoc_compiler as a build dependency.
Finally though I get the following link error:
/usr/lib64/ccache/g++ -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -g -Wl,--fatal-warnings -Wl,--no-undefined -lc -Wl,-z,relro -shared -Wl,-soname,libvtkPVServerImplementationCore-pv3.98.so.1 -o ../../../lib/libvtkPVServerImplementationCore-pv3.98.so.1 CMakeFiles/vtkPVServerImplementationCore.dir/vtkPVCatalystSessionCore.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkPVProxyDefinitionIterator.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkPVSessionBase.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkPVSessionCore.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkPVSessionCoreInterpreterHelper.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkPVSessionServer.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIArraySelectionProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSICollaborationManager.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSICompoundSourceProxy.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIDataArrayProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIDoubleVectorProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIFileSeriesReaderProxy.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIIdTypeVectorProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIInputProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIIntVectorProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIObject.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIProxy.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIProxyDefinitionManager.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIProxyProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSISILProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSISourceProxy.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIStringVectorProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSITimeLabelProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSITimeRangeProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSITimeStepsProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIVectorProperty.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSIWriterProxy.cxx.o CMakeFiles/vtkPVServerImplementationCore.dir/vtkSMMessage.cxx.o ../../../lib/libvtkPVClientServerCoreCore-pv3.98.so.1 -lprotobuf ../../../lib/libvtkFiltersProgrammable-pv3.98.so.1 ../../../lib/libvtkPVPythonSupport-pv3.98.so.1 -lpython2.7 ../../../lib/libvtkPVVTKExtensionsCore-pv3.98.so.1 ../../../lib/libvtkPVCommon-pv3.98.so.1 ../../../lib/libvtkClientServer-pv3.98.so.1 ../../../lib/libvtkIOXML-pv3.98.so.1 ../../../lib/libvtkIOGeometry-pv3.98.so.1 ../../../lib/libvtkIOXMLParser-pv3.98.so.1 -lexpat ../../../lib/libvtkImagingCore-pv3.98.so.1 ../../../lib/libvtkInfovisCore-pv3.98.so.1 ../../../lib/libvtkFiltersExtraction-pv3.98.so.1 ../../../lib/libvtkFiltersGeneral-pv3.98.so.1 ../../../lib/libvtkFiltersCore-pv3.98.so.1 ../../../lib/libvtkCommonComputationalGeometry-pv3.98.so.1 ../../../lib/libvtkParallelCore-pv3.98.so.1 ../../../lib/libvtkIOLegacy-pv3.98.so.1 ../../../lib/libvtkIOCore-pv3.98.so.1 ../../../lib/libvtkCommonExecutionModel-pv3.98.so.1 ../../../lib/libvtkCommonDataModel-pv3.98.so.1 ../../../lib/libvtkCommonSystem-pv3.98.so.1 ../../../lib/libvtkCommonTransforms-pv3.98.so.1 ../../../lib/libvtkCommonMisc-pv3.98.so.1 ../../../lib/libvtkCommonMath-pv3.98.so.1 ../../../lib/libvtkCommonCore-pv3.98.so.1 ../../../lib/libvtksys-pv3.98.so.1 -ldl -lz -Wl,-rpath,/export/home/orion/fedora/paraview/ParaView/fedora/lib:
CMakeFiles/vtkPVServerImplementationCore.dir/vtkSMMessage.cxx.o: In function protobuf_AssignDescriptorsOnce': CMakeFiles/vtkPVServerImplementationCore.dir/vtkSMMessage.cxx.o:/usr/include/google/protobuf/stubs/once.h:115: more undefined references to
pthread_once' follow
It's going to need to link against -lpthread but I don't know the best way to handle that.