Differences between revisions 10 and 101 (spanning 91 versions)
Revision 10 as of 2014-01-27 18:20:28
Size: 1829
Comment: fixed link
Revision 101 as of 2023-09-15 13:42:10
Size: 6532
Editor: RemoChristen
Comment: Replace "DOWNWARD_CPLEX_ROOT" by "cplex_DIR".
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Back to [[Doc/Heuristic]]. Back to [[ObtainingAndRunningFastDownward]].
Line 5: Line 5:
Some configurations of the search component of Fast Downward, such as optimal cost partitioning for landmark heuristics, require an Linear Programming (LP) solver and will complain if the planner has not been built with support for such a solver. Some configurations of the search component of Fast Downward, such as optimal cost partitioning for landmark heuristics, require a linear programming (LP) solver and will complain if the planner has not been built with support for such a solver. Running an LP configuration requires three steps, explained below:
Line 7: Line 7:
Fast Downward uses the [[http://www.coin-or.org/|COIN-OR]] LP Solver ([[http://www.coin-or.org/Clp/|CLP]]) with the [[https://projects.coin-or.org/Osi|Open Solver Interface]].  1. Installing one or more LP solvers.
 1. Building Fast Downward with LP support.
 1. Choosing a solver with command-line arguments.
Line 9: Line 11:
== Instructions for building Fast Downward with LP support == == Step 1. Installing one or more LP solvers ==
Line 11: Line 13:
To enable LP support in Fast Downward, change the line Fast Downward uses a generic interface for accessing LP solvers and hence can be used together with different LP solvers. Currently, CPLEX and !SoPlex are supported. You can install one or both solvers without causing conflicts. Installation varies by solver and operating system.

=== Installing CPLEX on Linux/macOS ===

IBM offers a [[http://ibm.com/academic|free academic license]] that includes access to CPLEX.
Once you are registered, you find the software under Technology -> Data Science. Choose the right version and switch to HTTP download unless you have the IBM download manager installed. If you have problems using their website with Firefox, try Chrome instead. Execute the downloaded binary and follow the guided installation. If you want to install in a global location, you have to execute the installer as {{{root}}}.

After the installation, set the following environment variable.
The installer is for ILOG Studio, which contains more than just CPLEX, so the variable points to the subdirectory {{{/cplex}}} of the installation.
Adapt the path if you installed another version or did not install in the default location:
Line 13: Line 24:
USE_LP=0
}}}
in the {{{Makefile}}} to
{{{
USE_LP=1
export cplex_DIR=/opt/ibm/ILOG/CPLEX_Studio2211/cplex
Line 20: Line 27:
and run If you don't want to permanently modify your environment, you can also set these variables directly when calling CMake. The variable needs to be set when building Fast Downward's search component (Step 2.).

=== Installing CPLEX on Windows ===

Follow the Linux instructions to acquire a license and access the Windows-version of the CPLEX installer. Please install CPLEX into a directory without spaces.
For a silent installation, please consult: https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.studio.help/Optimization_Studio/topics/td_silent_install.html

/!\ '''Important Note:''' Setting up environment variables might require using / instead of the more Windows-common \ to work correctly.

=== Installing SoPlex on Linux/macOS ===

!SoPlex is available under the Apache License from [[https://github.com/scipopt/soplex|Github]]. To be compatible with C++-20, we require a version of !SoPlex more recent than 6.0.3. At the time of this writing, 6.0.3 is the latest release, so we have to build from the unreleased version at the tip of the main branch.

You can install !SoPlex as follows (adapt the path if you install another version or want to use another location):
Line 22: Line 42:
make clean
make

git clone https://github.com/scipopt/soplex.git
sudo apt install libgmp3-dev # The library is optional but important for SoPlex's performance
export soplex_DIR=/opt/soplex-6.0.3x
export CXXFLAGS="$CXXFLAGS -Wno-use-after-free" # Ignore compiler warnings about use-after-free
cmake -S soplex -B build
cmake --build build
cmake --install build --prefix $soplex_DIR
rm -rf soplex build
Line 26: Line 53:
The {{{make}}} invocation will take a long time because it first builds the LP library, which is rather big. This is a one-time operation: once the library has been built, it will not be deleted, not even by {{{make clean}}} or {{{make distclean}}}. If for some reason you absolutely want to delete it, run {{{rm -r lp/coin}}} and it will be rebuilt on the next compile with {{{USE_LP=1}}}. After installation, permanently set the environment variable {{{soplex_DIR}}} to the value you used in installation.
Line 28: Line 55:
== If LP setup fails == /!\ '''Note:''' Once a version including Salomé's fix is released, we can update this and can recommend the [[https://soplex.zib.de/index.php#download|SoPlex homepage]] for downloads instead.
Line 30: Line 57:
The LP solver has a number of dependencies which might not be installed on your system. If for some reason the LP setup step fails, we'd appreciate if you attempt to troubleshoot it yourself. Check the contents of the {{{setup}}} script in the {{{lp}}} directory to see what it does, try to run the various steps manually, have a look at the errors generated, and consult the Osi documentation. === Installing SoPlex on the grid in Basel ===
Line 32: Line 59:
If after troubleshooting you can get the LP package to work, do let us know of your problem and its solution so that we can improve these instructions. If you still cannot get it to work, we may be able to provide some help, but note that the LP solver is an external package not developed by us. To build !SoPlex on the grid, you should load a module with the GMP library and a compatible compiler module. The following setup should work:
{{{
module purge
module load GCC/11.3.0.lua
module load CMake/3.23.1-GCCcore-11.3.0.lua
module load Python/3.10.4-GCCcore-11.3.0.lua
module load GMP/6.2.1-GCCcore-11.3.0
}}}

Because the library is loaded from a module, it is not in a default directory, so change the CMake call to
{{{
cmake -S soplex -B build -DGMP_DIR="$EBROOTGMP"
}}}


== Step 2. Building Fast Downward with LP support ==

Once LP solvers are installed and the environment variables {{{cplex_DIR}}} and/or {{{soplex_DIR}}} are set up correctly, you can build Fast Downward's search component with LP support by calling {{{./build.py}}}. Remove your previous build first:
{{{
rm -rf builds
}}}

Fast Downward automatically includes an LP Solver in the build if it is needed and the solver is detected on the system. If you want to explicitly build without LP solvers that are installed on your system, use {{{./build.py release_no_lp}}}, or a [[ObtainingAndRunningFastDownward#Manual_Builds|manual build]] with the option {{{-DUSE_LP=NO}}}.


== Step 3. Choosing a solver with command-line arguments ==

Features that use an LP solver have a command-line option `lpsolver` to switch between different solver types. See [[http://issues.fast-downward.org/issue752|issue752]] and [[http://issues.fast-downward.org/issue1076|issue1076]] for a discussion of the relative performance of CPLEX and !SoPlex.

Note that !SoPlex is not a MIP solver, so using it for configurations that require integer variables will result in an error. Please use CPLEX for such cases.


== Troubleshooting ==

The LP-related libraries have a number of dependencies which might not be installed on your system. If for some reason one of the above steps fails, we would appreciate if you could attempt to troubleshoot it yourself.

If you get warnings about unresolved references with CPLEX, visit their [[http://www-01.ibm.com/support/docview.wss?uid=swg21399926|help pages]].

If you compiled Fast Downward on Windows (especially on !GitHub Actions) and cannot execute the binary in a new command line, then it might be unable to find a dynamically linked library. Use {{{dumpbin /dependents PATH\TO\DOWNWARD\BINARY}}} to list all required libraries and ensure that they can be found in your {{{PATH}}} variable.

If after troubleshooting you can get the LP package to work, please do let us know of your problem and its solution so that we can improve these instructions. If you still cannot get it to work, we may be able to provide some help, but note that the LP solvers are external packages not developed by us.

Back to ObtainingAndRunningFastDownward.

LP solver support

Some configurations of the search component of Fast Downward, such as optimal cost partitioning for landmark heuristics, require a linear programming (LP) solver and will complain if the planner has not been built with support for such a solver. Running an LP configuration requires three steps, explained below:

  1. Installing one or more LP solvers.
  2. Building Fast Downward with LP support.
  3. Choosing a solver with command-line arguments.

Step 1. Installing one or more LP solvers

Fast Downward uses a generic interface for accessing LP solvers and hence can be used together with different LP solvers. Currently, CPLEX and SoPlex are supported. You can install one or both solvers without causing conflicts. Installation varies by solver and operating system.

Installing CPLEX on Linux/macOS

IBM offers a free academic license that includes access to CPLEX. Once you are registered, you find the software under Technology -> Data Science. Choose the right version and switch to HTTP download unless you have the IBM download manager installed. If you have problems using their website with Firefox, try Chrome instead. Execute the downloaded binary and follow the guided installation. If you want to install in a global location, you have to execute the installer as root.

After the installation, set the following environment variable. The installer is for ILOG Studio, which contains more than just CPLEX, so the variable points to the subdirectory /cplex of the installation. Adapt the path if you installed another version or did not install in the default location:

export cplex_DIR=/opt/ibm/ILOG/CPLEX_Studio2211/cplex

If you don't want to permanently modify your environment, you can also set these variables directly when calling CMake. The variable needs to be set when building Fast Downward's search component (Step 2.).

Installing CPLEX on Windows

Follow the Linux instructions to acquire a license and access the Windows-version of the CPLEX installer. Please install CPLEX into a directory without spaces. For a silent installation, please consult: https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.studio.help/Optimization_Studio/topics/td_silent_install.html

/!\ Important Note: Setting up environment variables might require using / instead of the more Windows-common \ to work correctly.

Installing SoPlex on Linux/macOS

SoPlex is available under the Apache License from Github. To be compatible with C++-20, we require a version of SoPlex more recent than 6.0.3. At the time of this writing, 6.0.3 is the latest release, so we have to build from the unreleased version at the tip of the main branch.

You can install SoPlex as follows (adapt the path if you install another version or want to use another location):

git clone https://github.com/scipopt/soplex.git
sudo apt install libgmp3-dev # The library is optional but important for SoPlex's performance
export soplex_DIR=/opt/soplex-6.0.3x
export CXXFLAGS="$CXXFLAGS -Wno-use-after-free" # Ignore compiler warnings about use-after-free
cmake -S soplex -B build
cmake --build build
cmake --install build --prefix $soplex_DIR
rm -rf soplex build

After installation, permanently set the environment variable soplex_DIR to the value you used in installation.

/!\ Note: Once a version including Salomé's fix is released, we can update this and can recommend the SoPlex homepage for downloads instead.

Installing SoPlex on the grid in Basel

To build SoPlex on the grid, you should load a module with the GMP library and a compatible compiler module. The following setup should work:

module purge 
module load GCC/11.3.0.lua 
module load CMake/3.23.1-GCCcore-11.3.0.lua 
module load Python/3.10.4-GCCcore-11.3.0.lua 
module load GMP/6.2.1-GCCcore-11.3.0

Because the library is loaded from a module, it is not in a default directory, so change the CMake call to

cmake -S soplex -B build -DGMP_DIR="$EBROOTGMP"

Step 2. Building Fast Downward with LP support

Once LP solvers are installed and the environment variables cplex_DIR and/or soplex_DIR are set up correctly, you can build Fast Downward's search component with LP support by calling ./build.py. Remove your previous build first:

rm -rf builds

Fast Downward automatically includes an LP Solver in the build if it is needed and the solver is detected on the system. If you want to explicitly build without LP solvers that are installed on your system, use ./build.py release_no_lp, or a manual build with the option -DUSE_LP=NO.

Step 3. Choosing a solver with command-line arguments

Features that use an LP solver have a command-line option lpsolver to switch between different solver types. See issue752 and issue1076 for a discussion of the relative performance of CPLEX and SoPlex.

Note that SoPlex is not a MIP solver, so using it for configurations that require integer variables will result in an error. Please use CPLEX for such cases.

Troubleshooting

The LP-related libraries have a number of dependencies which might not be installed on your system. If for some reason one of the above steps fails, we would appreciate if you could attempt to troubleshoot it yourself.

If you get warnings about unresolved references with CPLEX, visit their help pages.

If you compiled Fast Downward on Windows (especially on GitHub Actions) and cannot execute the binary in a new command line, then it might be unable to find a dynamically linked library. Use dumpbin /dependents PATH\TO\DOWNWARD\BINARY to list all required libraries and ensure that they can be found in your PATH variable.

If after troubleshooting you can get the LP package to work, please do let us know of your problem and its solution so that we can improve these instructions. If you still cannot get it to work, we may be able to provide some help, but note that the LP solvers are external packages not developed by us.