Skip to content

Fix linux build on branch 'itk'

Robin Caloudis requested to merge rcaloudis2v6/simopenpass:itk into itk

Background

Multiple errors popped up during linux build for the branch 'itk' with -D WITH_GUI=ON. The branch 'itk' was choosen because the build should include the newest features of the GUI under development. The issues were fixed straight away as part of the gui build test under linux. As https://gitlab.eclipse.org/eclipse/simopenpass/simopenpass/-/issues/32 has not been solved here, a complete linux and windows build fix should account for this. The harcoded paths have just been switched to linux paths. A complete solution should account for appropiate linux and windows path's. This merge request can only serve as starting point.

Probably other branches are affected as well.

Issues that have been fixed

  1. Linux case sensitivity
  2. -fPIC code
  3. undefined reference

List of issues

----- 1 -----

q499782@cmucw793555:/_dev/OpenPass_OSS$ ./configure_OP.sh 
-- The C compiler identification is GNU 9.0.1
-- The CXX compiler identification is GNU 9.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc-9 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-9 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Protobuf: /_dev/OpenPass_OSS/simopenpass/deps/thirdParty/linux64/protobuf/lib/libprotobuf.so;-lpthread (found version "3.11.4") 
-- Found OSI: /_dev/OpenPass_OSS/simopenpass/deps/thirdParty/linux64/osi/lib/osi3/libopen_simulation_interface.so  
-- Found Boost: /_dev/OpenPass_OSS/simopenpass/deps/thirdParty/linux64/boost/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found version "1.72.0") found components: filesystem 
-- Found FMILibrary: /_dev/OpenPass_OSS/simopenpass/deps/thirdParty/linux64/FMILibrary/lib/libfmilib_shared.so  
-- Found Sphinx: /home/q499782/.local/bin/sphinx-build  
-- Collecting runtime library paths...
-- Configuring done
CMake Error at cmake/HelperMacros.cmake:262 (add_library):
  Cannot find source file:

    dynamics_twoTrack.h

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++
  .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc
Call Stack (most recent call first):
  sim/src/components/Dynamics_TwoTrack/CMakeLists.txt:5 (add_openpass_target)


CMake Error at gui/application/Interfaces/CMakeLists.txt:18 (add_library):
  Cannot find source file:

    /_dev/OpenPass_OSS/simopenpass/gui/application/Interfaces/openPASS/IOPluginInterface.h

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++
  .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc


CMake Error at gui/plugins/pcmEvaluation/Models/CMakeLists.txt:47 (add_library):
  Cannot find source file:

    /_dev/OpenPass_OSS/simopenpass/gui/common/pcm/PCM_Importer/SceneryImporterPCM.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++
  .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc


CMake Error at gui/plugins/pcmEvaluation/Presenters/CMakeLists.txt:20 (add_library):
  Cannot find source file:

    /_dev/OpenPass_OSS/simopenpass/gui/plugins/pcmEvaluation/Presenters/PresenterPcm_eval.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++
  .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc


CMake Error at gui/plugins/pcmSimulation/Models/CMakeLists.txt:51 (add_library):
  Cannot find source file:

    /_dev/OpenPass_OSS/simopenpass/gui/common/pcm/PCM_Importer/SceneryImporterPCM.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++
  .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc


CMake Error at gui/plugins/window/Interfaces/CMakeLists.txt:19 (add_library):
  Cannot find source file:

    /_dev/OpenPass_OSS/simopenpass/gui/application/Interfaces/openPASS/IOPluginInterface.h

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++
  .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

----- 2 -----

[ 31%] Built target SignalPrioritizer
[ 31%] Automatic MOC for target World_OSI
[ 31%] Built target World_OSI_autogen
[ 31%] Building CXX object gui/application/Models/CMakeFiles/openPASS_Models.dir/openPASS_Models_autogen/mocs_compilation.cpp.o
<command-line>: warning: "SUBDIR_LIB_COMPONENTS" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "SUBDIR_LIB_GUI" redefined
<command-line>: note: this is the location of the previous definition
In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtGui/qevent.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtGui/QList:1,
                 from /_dev/OpenPass_OSS/build-simopenpass/gui/application/Models/openPASS_Models_autogen/EWIEGA46WW/../../../../../../simopenpass/gui/application/Models/PluginManagerModel.h:20,
                 from /_dev/OpenPass_OSS/build-simopenpass/gui/application/Models/openPASS_Models_autogen/EWIEGA46WW/moc_PluginManagerModel.cpp:9,
                 from /_dev/OpenPass_OSS/build-simopenpass/gui/application/Models/openPASS_Models_autogen/mocs_compilation.cpp:2:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1135:4: error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (-fPIE is not enough)."
 1135 | #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
      |    ^~~~~
gui/application/Models/CMakeFiles/openPASS_Models.dir/build.make:75: recipe for target 'gui/application/Models/CMakeFiles/openPASS_Models.dir/openPASS_Models_autogen/mocs_compilation.cpp.o' failed
make[2]: *** [gui/application/Models/CMakeFiles/openPASS_Models.dir/openPASS_Models_autogen/mocs_compilation.cpp.o] Error 1
CMakeFiles/Makefile2:4445: recipe for target 'gui/application/Models/CMakeFiles/openPASS_Models.dir/all' failed
make[1]: *** [gui/application/Models/CMakeFiles/openPASS_Models.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 31%] Building CXX object sim/src/core/slave/modules/Observation_LogAgent/CMakeFiles/Observation_LogAgent.dir/observation_logImplementation.cpp.o
[ 31%] Linking CXX shared library libSensor_Driver.so
[ 31%] Built target Sensor_Driver
[ 31%] Building CXX object sim/src/core/slave/modules/Observation_LogAgent/CMakeFiles/Observation_LogAgent.dir/runStatistic.cpp.o
[ 31%] Building CXX object sim/src/core/slave/modules/BasicDataStore/CMakeFiles/BasicDataStore.dir/basicDataStoreImplementation.cpp.o
[ 31%] Linking CXX shared library libStochastics.so
[ 31%] Built target Stochastics
[ 32%] Building CXX object sim/src/core/slave/modules/Observation_Log/CMakeFiles/Observation_Log.dir/observation_log.cpp.o
[ 33%] Building CXX object sim/src/core/slave/modules/Observation_EntityRepository/CMakeFiles/Observation_EntityRepository.dir/observation_entityRepositoryImplementation.cpp.o
[ 34%] Linking CXX shared library libBasicDataStore.so
[ 34%] Built target BasicDataStore
[ 34%] Building CXX object sim/src/core/slave/modules/Observation_Log/CMakeFiles/Observation_Log.dir/observation_logImplementation.cpp.o
[ 34%] Building CXX object sim/src/core/slave/modules/Observation_LogAgent/CMakeFiles/Observation_LogAgent.dir/runStatisticCalculation.cpp.o
[ 34%] Building CXX object sim/src/core/slave/modules/Observation_Log/CMakeFiles/Observation_Log.dir/runStatistic.cpp.o
[ 34%] Building CXX object sim/src/core/slave/modules/Observation_Log/CMakeFiles/Observation_Log.dir/runStatisticCalculation.cpp.o
[ 34%] Linking CXX shared library libObservation_LogAgent.so
[ 34%] Built target Observation_LogAgent
[ 34%] Linking CXX shared library libObservation_EntityRepository.so
[ 34%] Built target Observation_EntityRepository
[ 34%] Linking CXX shared library libObservation_Log.so
[ 34%] Built target Observation_Log
Makefile:155: recipe for target 'all' failed
make: *** [all] Error 2

----- 3 -----

Consolidate compiler generated dependencies of target System
Consolidate compiler generated dependencies of target TimePlot
[ 84%] Linking CXX shared library Project.so
[ 84%] Linking CXX shared library Statistics.so
[ 84%] Linking CXX shared library Pcm_sim.so
[ 84%] Linking CXX shared library System.so
[ 84%] Linking CXX shared library TimePlot.so
[ 88%] Built target World_OSI
Consolidate compiler generated dependencies of target Window
[ 88%] Built target Window
CMakeFiles/Statistics.dir/PluginStatistics.cpp.o: In function `ServiceInterface<WindowInterface, 304050u>::instance()':
PluginStatistics.cpp:(.text._ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv[_ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv]+0x5e): undefined reference to `typeinfo for WindowInterface'
collect2: error: ld returned 1 exit status
gui/plugins/statistics/CMakeFiles/Statistics.dir/build.make:119: recipe for target 'gui/plugins/statistics/Statistics.so' failed
make[2]: *** [gui/plugins/statistics/Statistics.so] Error 1
CMakeFiles/Makefile2:5461: recipe for target 'gui/plugins/statistics/CMakeFiles/Statistics.dir/all' failed
make[1]: *** [gui/plugins/statistics/CMakeFiles/Statistics.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/Project.dir/ProjectPlugin.cpp.o: In function `ServiceInterface<WindowInterface, 304050u>::instance()':
ProjectPlugin.cpp:(.text._ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv[_ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv]+0x5e): undefined reference to `typeinfo for WindowInterface'
collect2: error: ld returned 1 exit status
gui/plugins/project/CMakeFiles/Project.dir/build.make:119: recipe for target 'gui/plugins/project/Project.so' failed
make[2]: *** [gui/plugins/project/Project.so] Error 1
CMakeFiles/Makefile2:5194: recipe for target 'gui/plugins/project/CMakeFiles/Project.dir/all' failed
make[1]: *** [gui/plugins/project/CMakeFiles/Project.dir/all] Error 2
CMakeFiles/Pcm_eval.dir/PluginPcm_Eval.cpp.o: In function `ServiceInterface<WindowInterface, 304050u>::instance()':
PluginPcm_Eval.cpp:(.text._ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv[_ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv]+0x5e): undefined reference to `typeinfo for WindowInterface'
collect2: error: ld returned 1 exit status
gui/plugins/pcmEvaluation/CMakeFiles/Pcm_eval.dir/build.make:120: recipe for target 'gui/plugins/pcmEvaluation/Pcm_eval.so' failed
make[2]: *** [gui/plugins/pcmEvaluation/Pcm_eval.so] Error 1
CMakeFiles/Makefile2:4660: recipe for target 'gui/plugins/pcmEvaluation/CMakeFiles/Pcm_eval.dir/all' failed
make[1]: *** [gui/plugins/pcmEvaluation/CMakeFiles/Pcm_eval.dir/all] Error 2
CMakeFiles/TimePlot.dir/PluginTimePlot.cpp.o: In function `ServiceInterface<WindowInterface, 304050u>::instance()':
PluginTimePlot.cpp:(.text._ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv[_ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv]+0x5e): undefined reference to `typeinfo for WindowInterface'
collect2: error: ld returned 1 exit status
gui/plugins/timePlot/CMakeFiles/TimePlot.dir/build.make:119: recipe for target 'gui/plugins/timePlot/TimePlot.so' failed
make[2]: *** [gui/plugins/timePlot/TimePlot.so] Error 1
CMakeFiles/Makefile2:5941: recipe for target 'gui/plugins/timePlot/CMakeFiles/TimePlot.dir/all' failed
make[1]: *** [gui/plugins/timePlot/CMakeFiles/TimePlot.dir/all] Error 2
CMakeFiles/System.dir/SystemPlugin.cpp.o: In function `ServiceInterface<ComponentInterface, 372524u>::instance()':
SystemPlugin.cpp:(.text._ZN16ServiceInterfaceI18ComponentInterfaceLj372524EE8instanceEv[_ZN16ServiceInterfaceI18ComponentInterfaceLj372524EE8instanceEv]+0x5e): undefined reference to `typeinfo for ComponentInterface'
CMakeFiles/System.dir/SystemPlugin.cpp.o: In function `ServiceInterface<WindowInterface, 304050u>::instance()':
SystemPlugin.cpp:(.text._ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv[_ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv]+0x5e): undefined reference to `typeinfo for WindowInterface'
CMakeFiles/System.dir/SystemPlugin.cpp.o: In function `ServiceInterface<ProjectInterface, 322520u>::instance()':
SystemPlugin.cpp:(.text._ZN16ServiceInterfaceI16ProjectInterfaceLj322520EE8instanceEv[_ZN16ServiceInterfaceI16ProjectInterfaceLj322520EE8instanceEv]+0x5e): undefined reference to `typeinfo for ProjectInterface'
collect2: error: ld returned 1 exit status
gui/plugins/system/CMakeFiles/System.dir/build.make:118: recipe for target 'gui/plugins/system/System.so' failed
make[2]: *** [gui/plugins/system/System.so] Error 1
CMakeFiles/Makefile2:5727: recipe for target 'gui/plugins/system/CMakeFiles/System.dir/all' failed
make[1]: *** [gui/plugins/system/CMakeFiles/System.dir/all] Error 2
CMakeFiles/Pcm_sim.dir/PluginPcm.cpp.o: In function `ServiceInterface<WindowInterface, 304050u>::instance()':
PluginPcm.cpp:(.text._ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv[_ZN16ServiceInterfaceI15WindowInterfaceLj304050EE8instanceEv]+0x5e): undefined reference to `typeinfo for WindowInterface'
collect2: error: ld returned 1 exit status
gui/plugins/pcmSimulation/CMakeFiles/Pcm_sim.dir/build.make:121: recipe for target 'gui/plugins/pcmSimulation/Pcm_sim.so' failed
make[2]: *** [gui/plugins/pcmSimulation/Pcm_sim.so] Error 1
CMakeFiles/Makefile2:4927: recipe for target 'gui/plugins/pcmSimulation/CMakeFiles/Pcm_sim.dir/all' failed
make[1]: *** [gui/plugins/pcmSimulation/CMakeFiles/Pcm_sim.dir/all] Error 2
[ 98%] Built target CoreSlave
Makefile:155: recipe for target 'all' failed
make: *** [all] Error 2
Edited by Robin Caloudis

Merge request reports