Differences between revisions 11 and 101 (spanning 90 versions)
Revision 11 as of 2014-07-23 18:04:09
Size: 3340
Comment: preliminary documentation
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, you need OSI and (optionally but recommended) an external solver such as CPLEX installed on your system (see below). Once OSI is installed, 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
}}}

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 [[https://soplex.zib.de/index.php#download|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"
Line 27: Line 74:
== Installing CPLEX == == Step 2. Building Fast Downward with LP support ==
Line 29: Line 76:
IBM has 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.
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}}}.
Line 33: Line 84:
== Installing the Open Solver Interface === == Step 3. Choosing a solver with command-line arguments ==
Line 35: Line 86:
OSI provides a common interface to different LP solvers. To build an interface to a solver, the solver has to be installed before compiling OSI. If you install a solver later, repeat the installation steps of OSI to use it in Fast Downward. 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.
Line 37: Line 88:
    CPLEX_INCDIR=/opt/ibm/ILOG/CPLEX_Studio1251/cplex/include/ilcplex
    CPLEX_LIBDIR=/opt/ibm/ILOG/CPLEX_Studio1251/cplex/lib/x86_sles10_4.1/static_pic
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 41: Line 91:
Download the current version of COIN/OSI from their website: http://www.coin-or.org/download/source/Osi/
In the following description we assume version 0.103.0 since this was the last version that was bundled with Fast Downward.
== Troubleshooting ==
Line 44: Line 93:
{{{
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" \
                 --without-lapack --enable-static=yes \
                 --with-cplex-incdir=$CPLEX_INCDIR \
                 --with-cplex-lib=$CPLEX_LIBDIR/libcplex.a \
                 --with-gurobi-incdir=$GUROBI_INCDIR \
                 --with-gurobi-lib=$GUROBI_LIBDIR/libgurobi.a
}}}
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.
Line 57: Line 95:
--prefix "$BASEDIR/coin" If you get warnings about unresolved references with CPLEX, visit their [[http://www-01.ibm.com/support/docview.wss?uid=swg21399926|help pages]].
Line 59: Line 97:
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.
Line 60: Line 99:
== If LP setup fails ==

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.

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.
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.