From 0591ad725e1e2d0bd34aa64e866f186882ed84f3 Mon Sep 17 00:00:00 2001 From: Leon Eifler Date: Sat, 27 Jan 2024 13:42:31 +0100 Subject: [PATCH] only look for MPFR if boost is available --- CHANGELOG | 1 + CMakeLists.txt | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 871ec415..4260c448 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -35,6 +35,7 @@ fixed bugs: - fix bugs in function definitions in soplex_interface.cpp: SoPlex_changeVarUpperReal(), SoPlex_getUpperReal() - fix bugs in LP file reader, concerning rational numbers as well as dynamic line length - fix bug printing solutions and statistics when running from the command line +- fix bug in cmake build system when MPFR is available but boost is not Upcoming Bugfix Release 6.0.4 ============================= diff --git a/CMakeLists.txt b/CMakeLists.txt index abc380a2..730dcd4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,19 +141,6 @@ if(GMP_FOUND) set(libs ${libs} ${GMP_LIBRARIES}) endif() -if(MPFR) - find_package(MPFR) -endif() -if(MPFR_FOUND) - message("SoPlex with Boost MPFR libraries.") - set(SOPLEX_WITH_MPFR on) - include_directories(${MPFR_INCLUDE_DIRS}) - set(libs ${libs} ${MPFR_LIBRARIES}) -else() - message("-- SoPlex with Boost CPP multiprecision libraries.") - set(SOPLEX_WITH_CPPMPF on) -endif() - if(QUADMATH) find_package(Quadmath) endif() @@ -196,6 +183,18 @@ if(BOOST) Found Boost version is ${Boost_VERSION_STRING}") endif() endif() + if(MPFR) # MPFR is used within boost multiprecision, so using it without Boost does not make sense + find_package(MPFR) + endif() + if(MPFR_FOUND) + message("SoPlex with Boost MPFR libraries.") + set(SOPLEX_WITH_MPFR on) + include_directories(${MPFR_INCLUDE_DIRS}) + set(libs ${libs} ${MPFR_LIBRARIES}) + else() + message("-- SoPlex with Boost CPP multiprecision libraries.") + set(SOPLEX_WITH_CPPMPF on) + endif() else() set(BOOST off) endif()