From: Martin Quinson Date: Mon, 14 Mar 2022 21:50:43 +0000 (+0100) Subject: Cope with Eigen 3.3.4 directly in cmake X-Git-Tag: v3.31~109 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/87089f2cac36e30a41d71a5b0dd0715e468a58ed Cope with Eigen 3.3.4 directly in cmake and remove the specific workaround for our robots. Also, move the Eigen detection with the other external dependencies in the CMakeLists. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 87770205e8..77a986e624 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/tools/jenkins/build.sh b/tools/jenkins/build.sh index 8abe068c62..2f23a21a79 100755 --- a/tools/jenkins/build.sh +++ b/tools/jenkins/build.sh @@ -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} \