Change CMakelist to acommodate newer SCIP#2
Open
ArvellLeoputra wants to merge 4 commits into
Open
Conversation
- Update fmt to 11.1.4 (for CMake 4.0) - Replace deprecated std::unary/binary_function, random_shuffle - Make STLRandGen compatible with std::shuffle - Fix empty if bodies and missing return in scipmodel.cpp - Remove duplicate libraries in fp2 link line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background and Problem
In the current CMakeLists.txt file for FeasPumpCollection, the configuration for SCIP is as follows:
When using CMake with the command
cmake .. -LH, users are required to manually provide the paths to the SCIP libraries and include directories via:-DSCIP_LIB: Path to the SCIP library directory.-DSCIP_INCLUDE_DIR: Path to the SCIP include directory.In newer versions of SCIP, such as scipoptsuite-9.2.0, the
make installstep is mandatory after building SCIP to generate the required include directories. These include directories are essential for compiling older projects that depend on SCIP, such as FeasPumpCollection. Without completing themake installstep, the headers needed for these projects may not be available.Solution Inspired by the Sudoku Build Script
The build script for the Sudoku example in SCIP provides a more streamlined approach:
This script allows users to specify only the SCIP directory via
-DSCIP_DIR. Modern versions of SCIP create a CMake package configuration file (SCIPConfig.cmake) during compilation. This file contains all the required informations for CMake to automatically locate SCIP’s headers, libraries, and other configuration settings.By leveraging this package file, this approach eliminates the need to manually specify separate variables such as
SCIP_LIBandSCIP_INCLUDE_DIR, simplifying the integration process and reducing potential errors.Proposed Changes to FeasPumpCollection Build Script
To adopt this streamlined approach, the CMakeLists.txt file for FeasPumpCollection should be updated as follows:
${SCIP_INCLUDE_DIRS}.${SCIP_LIBRARIES}instead ofScip::Scip.Here’s the updated configuration snippet for FeasPumpCollection:
Addressing FindSCIP.cmake
The presence of FindSCIP.cmake in the module folder can override the manually specified
SCIP_DIRvariable, potentially leading to incorrect paths or misconfigurations. To ensure proper functionality:find_package(SCIP CONFIG PATHS ...)exclusively, as it directly utilizes SCIP’s provided CMake package configuration.Notes
These changes improve the build process for projects using SCIP as the solver by leveraging the modern CMake package configuration capabilities. This approach automates the inclusion of necessary paths and libraries, reduces user intervention, and ensures compatibility with recent SCIP versions. Note that these changes apply only when SCIP is the selected solver. Different solvers may require alternative configurations.