Changeset 365 in flair-src


Ignore:
Timestamp:
Oct 5, 2020, 9:32:31 AM (8 months ago)
Author:
Sanahuja Guillaume
Message:

change simu apps compilation to avoid problem with mixing host and toolchain libs
(log2@glibc_2.29 error when compiling on ubuntu 20.05 or mint 20)
now compile with host g++ and libs (except filelib, irrlicht, quat, udt and vrpn) for simu apps using the macro: FLAIR_DEMO_HOST_CXX

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/cmake-modules/FlairUseFile.cmake

    r342 r365  
    102102        IF (FLAIR_USE_SIMULATOR_GL)
    103103                ADD_DEFINITIONS("-DGL")
    104                 SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSimulator_gl.a GL ${FLAIR_LIBRARIES} Irrlicht Xxf86vm)
     104                SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSimulator_gl.a GL ${FLAIR_LIBRARIES} Irrlicht)
    105105        else()
    106106                SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSimulator_nogl.a ${FLAIR_LIBRARIES})
  • trunk/cmake-modules/GlobalCmakeFlair.cmake

    r305 r365  
    151151        endforeach()
    152152    endif()
     153
     154endfunction()
     155
     156#create a demo using host cxx and libs
     157#usefull for simulator app when there are graphical lib incompatibilities (eg log2@glibc_2.29)
     158function(FLAIR_DEMO_HOST_CXX PROJECT_NAME SRC_FILES)
     159   
     160    set(CMAKE_CXX_FLAGS "" PARENT_SCOPE)
     161    set(CMAKE_CXX_COMPILER "g++" PARENT_SCOPE)
     162    set(CMAKE_CXX_LINK_FLAGS "-Wl,-unresolved-symbols=ignore-in-shared-libs -Wl,-rpath=/home/gsanahuj/flair/flair-install/lib/${ARCH_DIR}/ -Wl,--disable-new-dtags" PARENT_SCOPE)
     163    ADD_DEFINITIONS("-D_GLIBCXX_USE_CXX11_ABI=0")
     164
     165    set(LIB_LIST libudt libvrpn libFileLib libIrrlicht libquat)
     166
     167    foreach(LIB_NAME IN LISTS LIB_LIST) #all libs
     168        FILE(GLOB LIB_FILES "${CMAKE_SYSROOT}/usr/lib/${LIB_NAME}*")
     169        foreach(item IN LISTS LIB_FILES) #all files and symlinks of a lib
     170            get_filename_component(filename ${item} NAME)             
     171            INSTALL(CODE "
     172                    if (NOT EXISTS \"$ENV{FLAIR_ROOT}/flair-install/lib/${ARCH_DIR}/${filename}\")
     173                        file(INSTALL \"${item}\" DESTINATION \"$ENV{FLAIR_ROOT}/flair-install/lib/${ARCH_DIR}\" USE_SOURCE_PERMISSIONS)
     174                    else()
     175                        message(\"-- Not installing \" $ENV{FLAIR_ROOT} \"/flair-install/lib/\" ${ARCH_DIR} \"/\" ${filename} \" (file already exists)\")
     176                    endif()
     177                ")
     178             
     179        endforeach()
     180    endforeach()
     181
     182    FLAIR_DEMO(${ARGV})
    153183
    154184endfunction()
  • trunk/demos/CircleFollower/simulator/CMakeLists.txt

    r302 r365  
    1111)
    1212
    13 FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
     13FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
    1414           DEST_DIR CircleFollower
    1515           COPY_RESOURCES
  • trunk/demos/Gps/simulator/CMakeLists.txt

    r302 r365  
    1111)
    1212
    13 FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
     13FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
    1414           DEST_DIR Gps
    1515           COPY_RESOURCES
  • trunk/demos/MixedReality/real/simulator/CMakeLists.txt

    r302 r365  
    1313)
    1414
    15 FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
     15FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
    1616           DEST_DIR MixedReality_real
    1717           COPY_RESOURCES
  • trunk/demos/MixedReality/virtual/simulator/CMakeLists.txt

    r302 r365  
    1414)
    1515
    16 FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
     16FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
    1717           DEST_DIR MixedReality_virtual
    1818           COPY_RESOURCES
  • trunk/demos/OpticalFlow/simulator/CMakeLists.txt

    r302 r365  
    1111)
    1212
    13 FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
     13FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
    1414           DEST_DIR OpticalFlow
    1515           COPY_RESOURCES
  • trunk/demos/PidStandalone/simulator/CMakeLists.txt

    r302 r365  
    1111)
    1212
    13 FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
     13FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
    1414           DEST_DIR PidStandalone
    1515           COPY_RESOURCES
  • trunk/demos/SimpleFleet/simulator/CMakeLists.txt

    r302 r365  
    1111)
    1212
    13 FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
     13FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
    1414           DEST_DIR SimpleFleet
    1515           COPY_RESOURCES
  • trunk/lib/FlairSimulator/src/Gui_impl.cpp

    r294 r365  
    8585  this->scene_height = scene_height;
    8686
    87   device = createDevice(driver_type, dimension2d<u32>(app_width, app_height),
    88                         16, false, false, false);
     87  device = createDevice(driver_type, dimension2d<u32>(app_width, app_height),16, false, false, false);
     88  if(device==NULL) self->Err("Irrlicht failed to create video device\n");
    8989  receiver = new MyEventReceiver();
    9090  device->setEventReceiver(receiver);
  • trunk/scripts/distribution_specific_hack.sh

    r360 r365  
    2626fi
    2727
    28 if [ _$DISTRIB_ID = _Ubuntu ]; then
     28#also needed in mint, but for different reason?
     29#if not in sudo in mint, simlator does not work cause of:
     30#libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/iris_dri.so: /usr/lib/x86_64-linux-gnu/dri/iris_dri.so: failed to map segment from shared object
     31
     32#if [ _$DISTRIB_ID = _Ubuntu ]; then
    2933  #tested on Ubuntu 17.10
    3034  #we must run as root
     
    3842  fi
    3943
    40 fi
     44#fi
    4145
    4246#special actions if we use 3D
  • trunk/tools/FlairGCS/CMakeLists.txt

    r305 r365  
    7474SET(SRC_FILES ${PROJECT_SOURCE_FILES} ${MOC_SOURCES} ${RCC_SOURCES})
    7575FLAIR_NRT_TOOL(${PROJECT_NAME} "${SRC_FILES}" COPY_RESOURCES)
    76 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${QT_LIBRARIES} GL qwt QwtDataViewer udt QtLocation FileLib z)
     76TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${QT_LIBRARIES} qwt QwtDataViewer udt QtLocation FileLib z)
    7777
    7878
Note: See TracChangeset for help on using the changeset viewer.