Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cope with Eigen 3.3.4 directly in cmake
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 14 Mar 2022 21:50:43 +0000 (22:50 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 14 Mar 2022 21:50:46 +0000 (22:50 +0100)
and remove the specific workaround for our robots. Also, move the
Eigen detection with the other external dependencies in the CMakeLists.

CMakeLists.txt
tools/jenkins/build.sh

index 8777020..77a986e 100644 (file)
@@ -67,11 +67,6 @@ endif()
 set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
 find_package(Threads)
 
-### Check for Eigen library
-find_package (Eigen3 3.3 REQUIRED NO_MODULE)
-message(STATUS "Found Eigen3: ${EIGEN3_INCLUDE_DIR}")
-include_directories(${EIGEN3_INCLUDE_DIR})
-
 ### Setup Options
 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Option.cmake)
 
@@ -244,6 +239,15 @@ if(enable_ns3)
   endif()
 endif()
 
+### Check for Eigen library
+find_package (Eigen3 3.3 REQUIRED NO_MODULE)
+message(STATUS "Found Eigen3: ${EIGEN3_INCLUDE_DIR}")
+include_directories(${EIGEN3_INCLUDE_DIR})
+if ("3.3.4" EQUAL EIGEN3_VERSION_STRING)
+  message(STATUS "Avoid build error of Eigen3 v3.3.4 using -Wno-error=int-in-bool-context")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=int-in-bool-context")
+endif()
+
 set(SIMGRID_HAVE_MSG 0)
 if(enable_msg)
   set(SIMGRID_HAVE_MSG 1)
index 8abe068..2f23a21 100755 (executable)
@@ -204,10 +204,6 @@ if [ "$os" = "CentOS" ]; then
     else
         MAY_DISABLE_LTO=
     fi
-    if [ "$(rpm -q eigen3-devel --qf '%{VERSION}')" = "3.3.4" ]; then
-        echo "Temporary avoid build error seen with eigen3 version 3.3.4"
-        export CXXFLAGS=-Wno-error=int-in-bool-context
-    fi
 fi
 
 cmake -G"$GENERATOR" ${INSTALL:+-DCMAKE_INSTALL_PREFIX=$INSTALL} \