Skip to content

Commit

Permalink
Merge branch 'cmake-presets' into 'master'
Browse files Browse the repository at this point in the history
Add CMake presets for common use cases

See merge request integer/scip!3569
  • Loading branch information
svigerske committed Dec 1, 2024
2 parents e4fe24f + 048e27a commit 3fd15d1
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .gitlab/merge_request_templates/Code_Review.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

* [ ] The CHANGELOG is up to date (including API changes if present in this MR).
* [ ] The user documentation is up to date (doc/xternal.c, doc/inc/faq/, installation instructions, ...).
* [ ] Both build systems and makedist.sh are up to date. Especially, newly added, renamed or removed source files have been added to, renamed in or removed from src/CMakeLists.txt.
* [ ] Both build systems, `CMakePresets.json`, and `makedist.sh` are up to date.
* [ ] If new CMake options have been added, non-default values are written to the log (see `# write log file of non-default parameter settings` in `CMakeLists.txt`).

### Testing
Expand Down
36 changes: 36 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"version": 3,
"configurePresets": [
{
"name": "autobuild",
"description": "Autobuild configuration, tries to enable as many features as possible",
"cacheVariables": {
"AUTOBUILD": "On"
}
},
{
"name": "mip",
"description": "Default configuration for compiling SCIP as a MIP solver (requires LP solver selected with LPS)",
"cacheVariables": {
"AUTOBUILD": "Off",
"IPOPT": "Off",
"PAPILO": "On",
"SYM": "snauty"
}
},
{
"name": "minimal",
"description": "Minimal built-in configuration",
"cacheVariables": {
"AUTOBUILD": "Off",
"IPOPT": "Off",
"PAPILO": "Off",
"ZIMPL": "Off",
"READLINE": "Off",
"ZLIB": "Off",
"GMP": "Off",
"LPS": "none"
}
}
]
}
47 changes: 20 additions & 27 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,12 @@ For that we refer to the `README.md` file of the SCIP Optimization Suite (in cas
Building SCIP using CMake {#CMAKE}
==================================

[CMake](https://cmake.org/) is a build system generator that can create, e.g., Makefiles for UNIX and Mac or Visual Studio project files for Windows.
[CMake](https://cmake.org/) is a build system generator that can create, e.g., Makefiles or MS Visual Studio project files.

CMake provides an [extensive documentation](https://cmake.org/cmake/help/latest/manual/cmake.1.html) explaining available features and use cases as well as an [FAQ section](https://gitlab.kitware.com/cmake/community/-/wikis/FAQ).
It's recommended to use the latest stable CMake version available. `cmake --help` is also a good first step to see available options and usage information.

Windows and platform independent build instructions
---------------------------------------------------

To build SCIP you may use the CMake GUI to specify the path to SCIP and the desired location for the build.
Available options are listed and can be modified to fit your needs.
After the configuration step is done, open the generated Visual Studio solution file and compile it.
Note that compilation is tested on MSVC version >= 12.

Alternatively, you may use the command line to configure and build SCIP by creating a `build` directory and then building the configuration:

```
cmake -Bbuild -H. [-DSOPLEX_DIR=/path/to/soplex]
cmake --build build --config Release [Debug]
```

Command line instructions (Linux, macOS)
----------------------------------------

Compiling SCIP directly can be done as follows:

To configure, compile, and install SCIP from a source tarball on a command line via cmake, use the following commands:
```
tar xvzf scip-x.y.z.tgz # unpack the tarball
cd scip-x.y.z # change into the directory
Expand All @@ -51,20 +32,32 @@ make install #

Note: For a full ctest run `ctest` instead of `make check` after compilation.

CMake checks for available third-party libraries like GMP or ZLIB and sets up the configuration accordingly.
CMake checks for available dependencies like PaPILO, SoPlex, or ZLIB and sets up the configuration accordingly.
Currently, it is necessary to either explicitly disable dependencies that should not be used, or use `-DAUTOBUILD=ON` as parameter to the cmake call to automatically disable dependencies that cannot be found.
Note that the symmetry codes [Nauty](https://pallini.di.uniroma1.it/) and [Sassy](https://github.com/markusa4/sassy) are shipped with SCIP.
A version of Bliss that is compatible with SCIP is available at https://github.com/scipopt/bliss.

Note: Here is a list of apt package requirements for ubuntu or debian users that want to build the entire SCIP Optimization Suite from source tarball:
Predefined presets for different use cases are also included in the `CMakePresets.json` file.
To use them, specify `--preset <preset>` as argument to `cmake`.
For example, to build only with dependencies needed for a MIP solver, use `--preset mip`.

The available presets can be listed with
```
cmake --list-presets
```

Alternatively to the cmake command line, also the CMake GUI can be used to build.
Here, one may specify the path to SCIP and the desired location for the build.
Available options are listed and can be modified to fit your needs.

Note: Here is a list of apt package requirements for Ubuntu or Debian users that want to build the entire SCIP Optimization Suite from source tarball:
```
apt-get install wget cmake g++ m4 xz-utils libgmp-dev unzip zlib1g-dev libboost-program-options-dev libboost-serialization-dev libboost-regex-dev libboost-iostreams-dev libtbb-dev libreadline-dev pkg-config git liblapack-dev libgsl-dev flex bison libcliquer-dev gfortran file dpkg-dev libopenblas-dev rpm
apt-get install wget cmake g++ m4 xz-utils libgmp-dev unzip zlib1g-dev libboost-program-options-dev libboost-serialization-dev libboost-regex-dev libboost-iostreams-dev libtbb-dev libreadline-dev pkg-config git liblapack-dev libgsl-dev flex bison libcliquer-dev gfortran file dpkg-dev libopenblas-dev rpm libmetis-dev
```
Additionally the following dependencies need to be downloaded, compiled and installed:
- [Hmetis](http://glaros.dtc.umn.edu/gkhome/metis/hmetis/download)
- [Metis](http://glaros.dtc.umn.edu/gkhome/metis/metis/download)
- [Ipopt](https://github.com/coin-or/Ipopt/releases) with [Mumps](https://github.com/coin-or-tools/ThirdParty-Mumps/releases)
- [Gmp](https://gmplib.org/#DOWNLOAD)
During the CMake configuration of the SCIP Optimization Suite the can be specified, see [CMake](https://scipopt.org/doc/html/md_INSTALL.php#CMAKE) [(local link)](@ref CMAKE) .
- [GMP](https://gmplib.org/#DOWNLOAD)


Troubleshooting
Expand Down

0 comments on commit 3fd15d1

Please sign in to comment.