Differences between revisions 19 and 101 (spanning 82 versions)
Revision 19 as of 2014-07-24 15:49:04
Size: 7730
Editor: MalteHelmert
Comment:
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 a linear programming (LP) solver and will complain if the planner has not been built with support for such a solver. Setting up LP support requires three steps, explained below: 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 8: Line 8:
 1. Installing the Open Solver Interface.
Line 10: Line 9:
 1. Choosing a solver with command-line arguments.
Line 13: Line 13:
Fast Downward uses a generic interface (see next step) for accessing LP solvers and hence can be used together with different LP solvers. Currently, three LP solvers are supported: CPLEX, Gurobi, and COIN-LP. You can install one, two or all three solvers without causing conflicts. The solver used by the planner is selected by command-line arguments, not at compile time. We recommend using CPLEX, which in our experiments has led to better performance than COIN-LP. We have no experience with Gurobi, but others recommend it over CPLEX. (If you have data comparing these two within Fast Downward, we would be very interested in hearing about it.) 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.
Line 15: Line 15:
=== Installing one or more LP solvers: CPLEX === === Installing CPLEX on Linux/macOS ===
Line 17: Line 17:
IBM offers a [[http://www-304.ibm.com/ibm/university/academic/pub/page/ban_ilog_programming|free academic license]] that includes access to CPLEX.
Once you are registered, you can download a binary from the member area of the [[http://www-304.ibm.com/ibm/university/academic/member/page/mem_login|Academic Initiative Website]]. Execute the binary and follow the guided installation. If you want to install in a global location, you have to execute the installer as {{{root}}}.
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}}}.
Line 20: Line 20:
After the installation, set the following environment variables (adapt the paths if you did not install in the default location): 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 22: Line 24:
export DOWNWARD_CPLEX_INCDIR=/opt/ibm/ILOG/CPLEX_Studio1251/cplex/include/ilcplex
export DOWNWARD_CPLEX_LIBDIR=/opt/ibm/ILOG/CPLEX_Studio1251/cplex/lib/x86_sles10_4.1/static_pic
export cplex_DIR=/opt/ibm/ILOG/CPLEX_Studio2211/cplex
Line 26: Line 27:
If you don't want to permanently modify your environment, you can also set these variables directly in {{{src/search/Makefile}}}. The variables need to be set for when installing the Open Solver Interface (Step 2.) and when building Fast Downward's search component (Step 3.). 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.).
Line 28: Line 29:
=== Installing one or more LP solvers: Gurobi === === Installing CPLEX on Windows ===
Line 30: Line 31:
We have no experience with installing Gurobi. 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
Line 32: Line 34:
After the installation, set the following environment variables (adapt the paths if you did not install in the default location): /!\ '''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 34: Line 42:
export DOWNWARD_GUROBI_INCDIR=/path/to/gurobi/include_dir
export DOWNWARD_GUROBI_LIBDIR=/path/to/gurobi/library_dir

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 38: Line 53:
If you don't want to permanently modify your environment, you can also set these variables directly in {{{src/search/Makefile}}}. The variables need to be set for when installing the Open Solver Interface (Step 2.) and when building Fast Downward's search component (Step 3.). After installation, permanently set the environment variable {{{soplex_DIR}}} to the value you used in installation.
Line 40: Line 55:
=== Installing one or more LP solvers: COIN-LP === /!\ '''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 42: Line 57:
COIN-LP is installed automatically be the following step, so it will be available without additional work. However, we recommend against using it in serious experiments unless you have established that it offers comparable performance to CPLEX in your setting. === Installing SoPlex on the grid in Basel ===
Line 44: Line 59:
== Step 2. Installing the Open Solver Interface ==

The Open Solver Interface (OSI) provides a common interface to different LP solvers. OSI must be compiled '''after''' installing the LP solver(s) in Step 1. If you install a solver later, repeat the installation steps of OSI. We assume in the following that CPLEX and Gurobi are installed and the environment variables {{{DOWNWARD_CPLEX_INCDIR}}}, {{{DOWNWARD_CPLEX_LIBDIR}}}, {{{DOWNWARD_GUROBI_INCDIR}}} and {{{DOWNWARD_GUROBI_LIBDIR}}} are set up correctly.

These instructions apply to COIN/OSI 0.103.0, which was the last version that was bundled with Fast Downward. Newer versions from http://www.coin-or.org/download/source/Osi/ should work, too. If you experience problems, please [[HomePage#contact|let us know]].

=== Installing the Open Solver Interface on Linux ===

Run the following commands. If you have installed only one of the two solvers, omit the options for the other one:

{{{#!highlight bash
wget http://www.coin-or.org/download/source/Osi/Osi-0.103.0.tgz
tar xvzf Osi-0.103.0.tgz
cd Osi-0.103.0

sudo ./configure CC="gcc" CFLAGS="-m32 -pthread -Wno-long-long" \
                 CXX="g++" CXXFLAGS="-m32 -pthread -Wno-long-long" \
                 LDFLAGS="-L$DOWNWARD_CPLEX_LIBDIR -L$DOWNWARD_GUROBI_LIBDIR" \
                 --without-lapack --enable-static=yes \
                 --prefix="/opt/coin" \
                 --with-cplex-incdir=$DOWNWARD_CPLEX_INCDIR --with-cplex-lib="-lcplex -lm" \
                 --with-gurobi-incdir=$DOWNWARD_GUROBI_INCDIR --with-gurob-lib="-lgurobi"
sudo make
sudo make install
cd ..
rm -rf Osi-0.103.0
rm Osi-0.103.0.tgz
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
Line 73: Line 68:
After installation, set the environment variable {{{DOWNWARD_COIN_ROOT}}} to the prefix you used in the call to {{{./configure}}}. For example: Because the library is loaded from a module, it is not in a default directory, so change the CMake call to
Line 75: Line 70:
export DOWNWARD_COIN_ROOT=/opt/coin cmake -S soplex -B build -DGMP_DIR="$EBROOTGMP"
Line 78: Line 73:
If you don't want to permanently modify your environment, you can also set this variables directly in {{{src/search/Makefile}}}. The variable need to be set when building Fast Downward's search component (Step 3.).
Line 80: Line 74:
== Installing the Open Solver Interface on Mac OS X == == Step 2. Building Fast Downward with LP support ==
Line 82: Line 76:
Follow the Linux instructions above with the following changes:
 * Replace {{{-m32}}} with {{{-arch i386}}}.
 * Replace {{{--enable-static=yes}}} with {{{--enable-static=no}}}.

Installation has been reported to fail on Mac OS X due to a bug in the {{{CoinUtils}}} configure script. (See [[http://issues.fast-downward.org/issue295|issue295]].) If you run into this problem, try downloading the [[attachment:coinutils-configure.patched|patched file]] attached to this page, make it executable, and replace the file {{{Osi-0.103.0/CoinUtils/configure}}} with it:

{{{#! highlight bash
    cp Dowloads/coinutils-configure.patched Osi-0.103.0/CoinUtils/configure
    chmod +x Osi-0.103.0/CoinUtils/configure
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
Line 93: Line 81:
== Step 3. Building Fast Downward with LP support == 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}}}.
Line 95: Line 83:
To enable LP support in Fast Downward, you need the [[https://projects.coin-or.org/Osi|Open Solver Interface]] (OSI) and (optionally but recommended) an external solver such as CPLEX installed on your system (see below). Once OSI is installed, you can build Fast Downward with LP support by calling make with the option {{{DOWNWARD_USE_LP=1}}}. This option can be either set as an environment variable or given to make in the commandline. If OSI is not installed in {{{/opt/coin}}}, you also need to set {{{DOWNWARD_COIN_ROOT}}} to its installation path.
Line 97: Line 84:
{{{
make distclean
make DOWNWARD_USE_LP=1 DOWNWARD_COIN_ROOT=/path/to/coin
}}}
== 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.
Line 106: Line 95:
If the configure step fails for COIN/OSI, have a look at their [[https://projects.coin-or.org/BuildTools/wiki/user-troubleshooting|troubleshooting page]].
Line 109: Line 97:
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 and OSI library are external packages not developed by us. 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.