Differences between revisions 71 and 72
Revision 71 as of 2018-11-05 12:55:53
Size: 15481
Comment: switch default OSI build to 64 bit on macOS
Revision 72 as of 2019-01-18 15:40:18
Size: 14303
Editor: JendrikSeipp
Comment: Remove documentation for 32-bit builds (except for on Windows).
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
Once you are registered, you can download the 64 bit binary from the member area of the [[https://ibm.onthehub.com|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 you are registered, you can download the binary from the member area of the [[https://ibm.onthehub.com|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}}}.
Line 24: Line 24:
export DOWNWARD_CPLEX_ROOT64=/opt/ibm/ILOG/CPLEX_Studio_Community128/cplex export DOWNWARD_CPLEX_ROOT=/opt/ibm/ILOG/CPLEX_Studio_Community128/cplex
Line 27: Line 27:
Starting with version 12.7 CPLEX no longer supports 32-bit builds. If you need 32-bit builds with LP support and have access to a CPLEX 12.6 installer, you can use the environment variable {{{DOWNWARD_CPLEX_ROOT32}}} to identify its location. However, CPLEX 12.6 is not compatible with recent OSI versions. If you get segmentation faults with 32-bit CPLEX builds, try to build one of the sample programs that come with CPLEX to see if it is installed correctly. Starting with version 12.7 CPLEX no longer supports 32-bit builds. If you need 32-bit builds with LP support, you need access to a CPLEX 12.6 installer. However, CPLEX 12.6 is not compatible with recent OSI versions. If you get segmentation faults with 32-bit CPLEX builds, try to build one of the sample programs that come with CPLEX to see if it is installed correctly.
Line 39: Line 39:
We have no experience with installing Gurobi. On Linux, Gurobi is only available for 64bit, which means that it cannot be used with our default (32bit) build. We have no experience with installing Gurobi. On Linux, Gurobi is only available for 64-bit.
Line 58: Line 58:
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 64-bit CPLEX is installed and the environment variable {{{DOWNWARD_CPLEX_ROOT64}}} is set up correctly. 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 64-bit CPLEX is installed and the environment variable {{{DOWNWARD_CPLEX_ROOT}}} is set up correctly.
Line 64: Line 64:
Run the following commands. If you have chosen not to install CPLEX, '''omit''' the options related to this solver from the call to {{{./configure}}} (options for solvers that are not installed can lead to very cryptic error messages). If you installed other solvers like CLP or Gurobi, also add the corresponding options for them. You may have to include the path to shared libraries in {{{LDFLAGS}}}, i.e. {{{LDFLAGS="-L$DOWNWARD_CPLEX_ROOT64/lib -L/usr/lib/gcc/i686-linux-gnu/4.8"}}}. If there are other problems, see the [[#Troubleshooting|troubleshooting section]]. Run the following commands. If you have chosen not to install CPLEX, '''omit''' the options related to this solver from the call to {{{./configure}}} (options for solvers that are not installed can lead to very cryptic error messages). If you installed other solvers like CLP or Gurobi, also add the corresponding options for them. You may have to include the path to shared libraries in {{{LDFLAGS}}}, i.e. {{{LDFLAGS="-L$DOWNWARD_CPLEX_ROOT/lib -L/usr/lib/gcc/i686-linux-gnu/4.8"}}}. If there are other problems, see the [[#Troubleshooting|troubleshooting section]].
Line 72: Line 72:
export DOWNWARD_COIN_ROOT64=/opt/coin/Osi-0.107.9 export DOWNWARD_COIN_ROOT=/opt/coin/Osi-0.107.9
Line 74: Line 74:
./configure CC="gcc" CFLAGS="-m64 -pthread -Wno-long-long" \
            CXX="g++" CXXFLAGS="-m64 -pthread -Wno-long-long" \
            LDFLAGS="-L$DOWNWARD_CPLEX_ROOT64/lib/x86-64_linux/static_pic" \
./configure CC="gcc" CFLAGS="-pthread -Wno-long-long" \
            CXX="g++" CXXFLAGS="-pthread -Wno-long-long" \
            LDFLAGS="-L$DOWNWARD_CPLEX_ROOT/lib/x86-64_linux/static_pic" \
Line 78: Line 78:
            --prefix="$DOWNWARD_COIN_ROOT64" \             --prefix="$DOWNWARD_COIN_ROOT" \
Line 80: Line 80:
            --with-cplex-incdir=$DOWNWARD_CPLEX_ROOT64/include/ilcplex --with-cplex-lib="-lcplex -lm -ldl" # -ldl is only needed for CPLEX >= 12.8             --with-cplex-incdir=$DOWNWARD_CPLEX_ROOT/include/ilcplex --with-cplex-lib="-lcplex -lm -ldl" # -ldl is only needed for CPLEX >= 12.8
Line 88: Line 88:
After installation, permanently set the environment variable {{{DOWNWARD_COIN_ROOT64}}} to the value you used in installation.

If you want to compile for 32-bit, change {{{-m64}}} to {{{-m32}}} in the configuration step above and use the CPLEX paths to the 32-bit version. You also have to change the setting for {{{--prefix}}}, otherwise the 32-bit version will overwrite the 64-bit version. You can then use the environment variables {{{DOWNWARD_COIN_ROOT32}}} to identify the version.
After installation, permanently set the environment variable {{{DOWNWARD_COIN_ROOT}}} to the value you used in installation.
Line 94: Line 92:
=== Installing the Open Solver Interface on Mac OS X === === Installing the Open Solver Interface on macOS ===
Line 96: Line 94:
Follow the Linux instructions above with the following changes:
 * Replace {{{-m64}}} with {{{-arch x86_64}}} and also add {{{-arch x86_64}}} to the {{{LDFLAGS}}} parameter.
Follow the Linux instructions above with the following change:
Line 103: Line 100:


Installation of version 0.103.0 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:
Installation of version 0.103.0 has been reported to fail on macOS 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:
Line 117: Line 112:
 1. Install [[http://sourceforge.net/projects/msys2/|msys2]] (this is only necessary to compile Osi and not required to compile the planner)  1. Install [[http://sourceforge.net/projects/msys2/|msys2]] (this is only necessary to compile OSI and not required to compile the planner)
Line 119: Line 114:
 1. Download Osi (we use 0.103.0, newer versions should work but are untested) and unpack to {{{C:\msys64\home\<username>\Osi-0.103.0}}}
 1. Start a command prompt and load the correct environment (see [[ObtainingAndRunningFastDownward#Compiling_on_Windows]] for how to do this), log in to msys from there, and change to the Osi directory:
 1. Download OSI (we use 0.103.0, newer versions should work but are untested) and unpack to {{{C:\msys64\home\<username>\Osi-0.103.0}}}
 1. Start a command prompt and load the correct environment (see [[ObtainingAndRunningFastDownward#Compiling_on_Windows]] for how to do this), log in to msys from there, and change to the OSI directory:
Line 158: Line 153:
To compile a 64-bit version, setup the command prompt for 64bit instead of x86 in step 5. Then choose the 64-bit version of CLPEX in steps 6. and 7., and use a different prefix, e.g., {{{--prefix=/c/osi/mt64}}}. Everything else stays the same (in particular {{{--host=x86_64-w64-mingw32}}} and {{{--build=mingw32}}} do not change). To compile a 64-bit version, setup the command prompt for 64-bit instead of x86 in step 5. Then choose the 64-bit version of CPLEX in steps 6. and 7. Everything else stays the same (in particular {{{--host=x86_64-w64-mingw32}}} and {{{--build=mingw32}}} do not change).
Line 164: Line 159:
To allow both debug and release builds of 32- and 64-bit version to link against the correct version of OSI, set the following environment variables: Set the following environment variables so that Fast Downward finds the OSI installation:
Line 166: Line 161:
    DOWNWARD_COIN_ROOT_RELEASE32=C:/osi/mt
    DOWNWARD_COIN_ROOT_DEBUG32=C:/osi/mtd
    DOWNWARD_COIN_ROOT_RELEASE64=C:/osi/mt64
    DOWNWARD_COIN_ROOT_DEBUG64=C:/osi/mtd64
    DOWNWARD_COIN_ROOT_RELEASE=C:/osi/mt
    DOWNWARD_COIN_ROOT_DEBUG=C:/osi/mtd
Line 197: Line 190:
If installing a 32-bit version of OSI on maia leads to an error about the wrong file format of {{{libstdc++.so}}}, then removing 64-bit specific paths from {{{LD_LIBRARY_PATH}}} might help. For example with g++-4.9.2 on maia, removing {{{/scicore/soft/apps/GCC/4.9.2/lib64}}} helps.

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. Setting up LP support requires three steps, explained below:

  1. Installing one or more LP solvers.
  2. Installing the Open Solver Interface.
  3. Building Fast Downward with LP support.

Step 1. Installing one or more LP solvers

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

The following instructions are for Linux/Mac OS X only.

Installing one or more LP solvers: CPLEX

IBM offers a free academic license that includes access to CPLEX. Once you are registered, you can download the binary from the member area of the 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.

After the installation, set the following environment variable (adapt the path if you installed another version or did not install in the default location):

export DOWNWARD_CPLEX_ROOT=/opt/ibm/ILOG/CPLEX_Studio_Community128/cplex

Starting with version 12.7 CPLEX no longer supports 32-bit builds. If you need 32-bit builds with LP support, you need access to a CPLEX 12.6 installer. However, CPLEX 12.6 is not compatible with recent OSI versions. If you get segmentation faults with 32-bit CPLEX builds, try to build one of the sample programs that come with CPLEX to see if it is installed correctly.

If you don't want to permanently modify your environment, you can also set these variables directly when calling CMake, or in src/build.py. 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.).

Installing CPLEX on Windows

Please install CPLEX into a directory without spaces. (We assume this is C:\cplex. Usually you will install ILOG Studio, which contains more than just CPLEX, so the paths below use C:\cplex\cplex to point to the CPLEX part of it.)

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

Installing one or more LP solvers: Gurobi

We have no experience with installing Gurobi. On Linux, Gurobi is only available for 64-bit.

After the installation, set the following environment variables:

export DOWNWARD_GUROBI_ROOT=/path/to/gurobi

If you don't want to permanently modify your environment, you can also set these variables directly when calling CMake, or in src/build.py. 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.).

Installing one or more LP solvers: COIN-LP

COIN-LP is no longer bundled with OSI starting from version 0.104.0 and needs to be installed separately. Installation should be possible with

sudo apt-get install clp

but we have no experience with this. We recommend against using it in serious experiments unless you have established that it offers comparable performance to CPLEX in your setting.

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 64-bit CPLEX is installed and the environment variable DOWNWARD_CPLEX_ROOT is set up correctly.

These instructions apply to COIN/OSI 0.107.9, newer versions from http://www.coin-or.org/download/source/Osi/ should work, too. If you experience problems, please let us know.

Installing the Open Solver Interface on Linux

Run the following commands. If you have chosen not to install CPLEX, omit the options related to this solver from the call to ./configure (options for solvers that are not installed can lead to very cryptic error messages). If you installed other solvers like CLP or Gurobi, also add the corresponding options for them. You may have to include the path to shared libraries in LDFLAGS, i.e. LDFLAGS="-L$DOWNWARD_CPLEX_ROOT/lib -L/usr/lib/gcc/i686-linux-gnu/4.8". If there are other problems, see the troubleshooting section.

   1 wget http://www.coin-or.org/download/source/Osi/Osi-0.107.9.tgz
   2 tar xvzf Osi-0.107.9.tgz
   3 cd Osi-0.107.9
   4 
   5 export DOWNWARD_COIN_ROOT=/opt/coin/Osi-0.107.9
   6 
   7 ./configure CC="gcc"  CFLAGS="-pthread -Wno-long-long" \
   8             CXX="g++" CXXFLAGS="-pthread -Wno-long-long" \
   9             LDFLAGS="-L$DOWNWARD_CPLEX_ROOT/lib/x86-64_linux/static_pic" \
  10             --without-lapack --enable-static=yes \
  11             --prefix="$DOWNWARD_COIN_ROOT" \
  12             --disable-zlib --disable-bzlib \
  13             --with-cplex-incdir=$DOWNWARD_CPLEX_ROOT/include/ilcplex --with-cplex-lib="-lcplex -lm -ldl" # -ldl is only needed for CPLEX >= 12.8
  14 make
  15 make install
  16 cd ..
  17 rm -rf Osi-0.107.9
  18 rm Osi-0.107.9.tgz

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

If you don't want to permanently modify your environment, you can also set these variables directly when calling CMake, or in src/build.py. 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.).

Installing the Open Solver Interface on macOS

Follow the Linux instructions above with the following change:

  • Building CoinUtils can create both static and dynamic libraries and there have been reported problems with both.

    • To use static libraries, delete the dynamic libraries from $(DOWNWARD_COIN_ROOT)/lib/ after building CoinUtils.

    • or

    • To use dynamic libraries, replace --enable-static=yes with --enable-static=no and change the Fast Downward CMakefile to look for dynamic (*.dylib) instead of static (*.a) libraries of libOsiCpx, libOsiGrb, and libOsiClp.

Installation of version 0.103.0 has been reported to fail on macOS due to a bug in the CoinUtils configure script. (See issue295.) If you run into this problem, try downloading the patched file attached to this page, make it executable, and replace the file Osi-0.103.0/CoinUtils/configure with it:

    cp Dowloads/coinutils-configure.patched Osi-0.103.0/CoinUtils/configure
    chmod +x Osi-0.103.0/CoinUtils/configure

Installing the Open Solver Interface on Windows

We managed to install OSI with support for CPLEX on Windows using msys2 using the following steps:

  1. We assume CPLEX is installed in C:\cplex.

  2. Install msys2 (this is only necessary to compile OSI and not required to compile the planner)

  3. Within msys2 use pacman to install base-devel: pacman -S base-devel

  4. Download OSI (we use 0.103.0, newer versions should work but are untested) and unpack to C:\msys64\home\<username>\Osi-0.103.0

  5. Start a command prompt and load the correct environment (see ObtainingAndRunningFastDownward#Compiling_on_Windows for how to do this), log in to msys from there, and change to the OSI directory:

    •    1     C:\msys64\usr\bin\bash --login -i
         2     cd Osi-0.103.0
      
  6. Compile debug version of OSI:
    •    1     mkdir /c/osi
         2     mkdir /c/osi/mtd
         3     LD='link' STRIP=':' AR='lib' RANLIB=':' NM='dumpbin -symbols' \
         4     CC='cl -nologo' CFLAGS=' -MTd -Zi -FS' CXX='cl -nologo' CXXFLAGS=' -MTd -Zi -EHsc -FS' \
         5     ./configure --host=x86_64-w64-mingw32 \
         6                 --build=mingw32 \
         7                 --prefix=/c/osi/mtd \
         8                 --with-cplex-lib='-L/c/cplex/cplex/lib/x86_windows_vs2013/stat_mtd/cplex1262.lib' \
         9                 --with-cplex-incdir='/c/cplex/cplex/include/ilcplex' \
        10                 --disable-cplex-libcheck
        11     make
        12     make install
      

      Afterwards, copy the debug symbol file C:\msys64\home\<username>\Osi-0.103.0\vc120.pdb to C:\osi\mtd\lib\ to avoid compiler warnings when compiling a debug version.

  7. Compile release version of OSI. Note the subtle differences to the command above: we use the directory /c/osi/mt instead of /c/osi/mtd in two places, the flag -MT instead of -MTd in two places, and the CPLEX library stat_mta instead of stat_mtd:

    •    1     mkdir /c/osi
         2     mkdir /c/osi/mt
         3     LD='link' STRIP=':' AR='lib' RANLIB=':' NM='dumpbin -symbols' \
         4     CC='cl -nologo' CFLAGS=' -MT -Zi -FS' CXX='cl -nologo' CXXFLAGS=' -MT -Zi -EHsc -FS' \
         5     ./configure --host=x86_64-w64-mingw32 \
         6                 --build=mingw32 \
         7                 --prefix=/c/osi/mt \
         8                 --with-cplex-lib='-L/c/cplex/cplex/lib/x86_windows_vs2013/stat_mta/cplex1262.lib' \
         9                 --with-cplex-incdir='/c/cplex/cplex/include/ilcplex' \
        10                 --disable-cplex-libcheck
        11     make
        12     make install
      

To compile a 64-bit version, setup the command prompt for 64-bit instead of x86 in step 5. Then choose the 64-bit version of CPLEX in steps 6. and 7. Everything else stays the same (in particular --host=x86_64-w64-mingw32 and --build=mingw32 do not change).

Note that linking under Windows only works if the libraries were compiled with the same flags. For example, if OSI is compiled with the flag -MTd (dynamic debug) then the planner also has to use this flag for compilation.

In our CMake build system some flags are automatically determined by the build type, e.g., if CMake is called with CMAKE_BUILD_TYPE=DEBUG, the flag -MTd is added by default. The CPLEX library also has to fit to everything. This is important when compiling Osi (in the --with-cplex-lib paramater, see above) and when compiling Fast Downward (handled by the CMake file). CPLEX has precompiled libraries for different versions of Visual Studio each as a static release and static debug version. This is documented in the file C:/cplex/cplex/c_cpp.html.

Set the following environment variables so that Fast Downward finds the OSI installation:

  •    1     DOWNWARD_COIN_ROOT_RELEASE=C:/osi/mt
       2     DOWNWARD_COIN_ROOT_DEBUG=C:/osi/mtd
    

Step 3. Building Fast Downward with LP support

Once OSI is installed, 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 and the necessary OSI adapter are detected on the system. If you want to explicitly build without the LP solver that is installed on your system, disable the LP solver plugin (with -DPLUGIN_LP_SOLVER_ENABLED=FALSE) and all plug-ins that require it, such as POTENTIAL_HEURISTICS (see ObtainingAndRunningFastDownward#Manual_Builds ).

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 the configure step of COIN/OSI fails with the error Cannot find symbol(s) CPXgetstat with CPX, check the path to the CPLEX lib directory. Depending on your CPLEX installation, the libraries might be stored in a different place, e.g., in $DOWNWARD_CPLEX_ROOT/lib/x86-64_sles10_4.1/static_pic. Check that the directory exists and contains the file libcplex.a. In some cases with the same error message, the library dl has to be added (see this question on stackoverflow). If the configure step fails for another reason, have a look at their troubleshooting page or their page of current issues.

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

If Fast Downward gives you compilation errors mentioning the isnan function, you are likely affected by an OSI/compiler incompatibility (see http://issues.fast-downward.org/issue681). In this case try the following:

  1. Add export DOWNWARD_USE_ISNAN_WORKAROUND=1 to your ~/.bashrc file (or other shell configuration file).

  2. Make sure the changed shell configuration takes effect by logging out and then logging in again.
  3. In the main directory of the repository, delete all cmake build artifacts with rm -r builds.

  4. Rebuild.

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.