Skip to content

Commit

Permalink
Merge branch 'main' into scorpion
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikseipp committed Oct 15, 2023
2 parents 41c953e + f6618a5 commit 1e03b80
Show file tree
Hide file tree
Showing 14 changed files with 238 additions and 100 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: macOS

on:
push:
branches: [main, issue*, release-*, scorpion]
branches: [main, release-*, scorpion]
pull_request:
branches: [main, issue*, release-*, scorpion]
branches: [main, release-*, scorpion]

jobs:
test:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Code style tests

on:
push:
branches: [main, issue*, release-*, scorpion]
branches: [main, release-*, scorpion]
pull_request:
branches: [main, issue*, release-*, scorpion]
branches: [main, release-*, scorpion]

jobs:
style:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Ubuntu

on:
push:
branches: [main, issue*, release-*, scorpion]
branches: [main, release-*, scorpion]
pull_request:
branches: [main, issue*, release-*, scorpion]
branches: [main, release-*, scorpion]

# Some notes on file paths: the working directory is $GITHUB_WORKSPACE,
# which equals /home/runner/work/my-repo-name/my-repo-name. The code is
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Windows

on:
push:
branches: [main, issue*, release-*, scorpion]
branches: [main, release-*, scorpion]
pull_request:
branches: [main, issue*, release-*, scorpion]
branches: [main, release-*, scorpion]

env:
ARCH: "x64"
Expand Down
120 changes: 120 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
## Dependencies
### Mandatory Dependencies

**Linux/MacOS:** you need a C++ compiler, CMake and GNU make.
To run the planner, you also need Python 3.

On Debian/Ubuntu, the following should install all these dependencies:
```
sudo apt install cmake g++ make python3
```

**Windows:** install [Visual Studio >= 2017](https://visualstudio.microsoft.com/de/vs/older-downloads/),
[Python](https://www.python.org/downloads/windows/), and [CMake](http://www.cmake.org/download/).
During the installation of Visual Studio, the C++ compiler is not installed by default, but the IDE prompts you to install it when you create a new C++ project.


### Optional: Linear-Programming Solvers

Some planner configurations depend on an LP or MIP solver. We support CPLEX (commercial, [free academic license](http://ibm.com/academic)) and SoPlex (Apache License, no MIP support). You can install one or both solvers without causing conflicts.

Once LP solvers are installed and the environment variables `cplex_DIR` and/or `soplex_DIR` are set up correctly, Fast Downward automatically includes each solver detected on the system in the build.

#### Installing CPLEX

Obtain CPLEX and follow the guided installation. See [troubleshooting](#troubleshooting) if you have problems accessing the installer.
On Windows, install CPLEX into a directory without spaces.

After the installation, set the environment variable `cplex_DIR` to the subdirectory `/cplex` of the installation.
For example on Ubuntu:
```bash
export cplex_DIR=/opt/ibm/ILOG/CPLEX_Studio2211/cplex
```
Note that on Windows, setting up the environment variable might require using `/` instead of the more Windows-common `\`.


#### Installing SoPlex on Linux/macOS

**Important:** The GNU Multiple Precision library (GMP) is critical for the performance of SoPlex but the build does not complain if it is not present.
Make sure that the build uses the library (check the output of CMake for `Found GMP`).

As of SoPlex 6.0.4, the release does not support C++-20, so we build from the tip of the [GitHub main branch](https://github.com/scipopt/soplex) (adapt the path if you install a different version or want to use a different location):
```bash
sudo apt install libgmp3-dev
git clone https://github.com/scipopt/soplex.git
export soplex_DIR=/opt/soplex-6.0.4x
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 during the installation.

**Note:** Once [support for C++-20](https://github.com/scipopt/soplex/pull/15) has been included in a SoPlex release, we can update this and can recommend the [SoPlex homepage](https://soplex.zib.de/index.php#download) for downloads instead.


### Optional: Plan Validator

You can validate the found plans by passing `--validate` (implied by `--debug`) to the planner if the [VAL plan validation software](https://github.com/KCL-Planning/VAL)
is installed on your system and the binary `validate` is on the `PATH`.

**Note:** VAL has a [bug](https://github.com/KCL-Planning/VAL/issues/48) that prevents it from correctly handling the IPC 18 data network domain.
You can install an older version, e.g., under Debian/Ubuntu:

```bash
sudo apt install g++ make flex bison
git clone https://github.com/KCL-Planning/VAL.git
cd VAL
git checkout a5565396007eee73ac36527fbf904142b3077c74
make clean # Remove old binaries.
sed -i 's/-Werror //g' Makefile # Ignore warnings.
make
```

Don't forget to add the resulting `validate` binary to your `PATH`.

## Compiling the planner

To build the planner, from the top-level directory run:

```bash
./build.py
```

This creates the default build `release` in the directory `builds`. For information on alternative builds (e.g. `debug`) and further options, call
`./build.py --help`. [Our website](https://www.fast-downward.org/ForDevelopers/CMake) has details on how to set up development builds.


### Compiling on Windows

Windows does not interpret the shebang in Python files, so you have to call `build.py` as `python3 build.py` (make sure `python3` is on your `PATH`). Also note that options are passed without `--`, e.g., `python3 build.py build=debug`.

Note that compiling from the terminal is only possible with the right environment. The easiest way to get such an environment is to use the `Developer PowerShell for VS 2019` or `Developer PowerShell`.

Alternatively, you can [create a Visual Studio Project](https://www.fast-downward.org/ForDevelopers/CMake#Custom_Builds), open it in Visual Studio and build from there. Visual Studio creates its binary files in subdirectories of the project that our driver script currently does not recognize. If you build with Visual Studio, you have to run the individual components of the planner yourself.

## Testing the build

To test your build use:

```bash
./fast-downward.py misc/tests/benchmarks/miconic/s1-0.pddl --search "astar(lmcut())"
```

To test the LP support use:
```bash
./fast-downward.py misc/tests/benchmarks/miconic/s1-0.pddl --search "astar(operatorcounting([lmcut_constraints()]))"
```

## Troubleshooting

* If you changed the build environment, delete the `builds` directory and rebuild.
* **Windows:** If you cannot execute the Fast Downward 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.
* **CPLEX:** After logging in at the IBM website, you find the Ilog studio 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.
* **CPLEX:** If you get warnings about unresolved references with CPLEX, visit their [help pages](http://www-01.ibm.com/support/docview.wss?uid=swg21399926).
* **MacOS:** If your compiler doesn't find flex or bison when building VAL, your include directories might be in a non-standard location. In this case you probably have to specify where to look for includes and libraries in VAL's
Makefile (probably `/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr`).

18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,18 @@ For further information:
- Fast Downward mailing list: <https://groups.google.com/forum/#!forum/fast-downward>
- Fast Downward main repository: <https://github.com/aibasel/downward>

## Scientific experiments

## Tested software versions
We recommend to use the [latest release](https://github.com/aibasel/downward/releases/latest) instead of the tip of the main branch.
The [Downward Lab](https://lab.readthedocs.io/en/stable/) Python package helps running Fast Downward experiments.
Our separate [benchmark repository](https://github.com/aibasel/downward-benchmarks) contains a collection of planning tasks.

## Supported software versions

The planner is mainly developed under Linux; and all of its features should work with no restrictions under this platform.
The planner should compile and run correctly on macOS, but we cannot guarantee that it works as well as under Linux.
The same comment applies for Windows, where additionally some diagnostic features (e.g., reporting peak memory usage when the planner is terminated by a signal) are not supported.
Setting time and memory limits and running portfolios is not supported under Windows either.

This version of Fast Downward has been tested with the following software versions:

Expand All @@ -263,11 +273,15 @@ We test LP support with CPLEX 22.1.1 and SoPlex 6.0.3+. On Ubuntu we
test both CPLEX and SoPlex. On Windows we currently only test CPLEX,
and on macOS we do not test LP solvers (yet).

## Build instructions

See [BUILD.md](BUILD.md).


## Contributors

The following list includes all people that actively contributed to
Fast Downward, i.e. all people that appear in some commits in Fast
Fast Downward, i.e., all people that appear in some commits in Fast
Downward's history (see below for a history on how Fast Downward
emerged) or people that influenced the development of such commits.
Currently, this list is sorted by the last year the person has been
Expand Down
27 changes: 16 additions & 11 deletions driver/run_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@
from . import util
from .plan_manager import PlanManager

# TODO: We might want to turn translate into a module and call it with "python3 -m translate".
REL_TRANSLATE_PATH = os.path.join("translate", "translate.py")
if os.name == "posix":
REL_SEARCH_PATH = "downward"
VALIDATE = "validate"
BINARY_EXT = ""
elif os.name == "nt":
REL_SEARCH_PATH = "downward.exe"
VALIDATE = "validate.exe"
BINARY_EXT = ".exe"
else:
returncodes.exit_with_driver_unsupported_error("Unsupported OS: " + os.name)

# TODO: We might want to turn translate into a module and call it with "python3 -m translate".
REL_TRANSLATE_PATH = os.path.join("translate", "translate.py")
REL_SEARCH_PATH = f"downward{BINARY_EXT}"
# Older versions of VAL use lower case, newer versions upper case. We prefer the
# older version because this is what our build instructions recommend.
VALIDATE = (shutil.which(f"validate{BINARY_EXT}") or
shutil.which(f"Validate{BINARY_EXT}"))


def get_executable(build, rel_path):
# First, consider 'build' to be a path directly to the binaries.
# The path can be absolute or relative to the current working
Expand Down Expand Up @@ -172,8 +177,11 @@ def run_search(args):


def run_validate(args):
logging.info("Running validate.")
if not VALIDATE:
returncodes.exit_with_driver_input_error(
"Error: Trying to run validate but it was not found on the PATH.")

logging.info("Running validate.")
num_files = len(args.filenames)
if num_files == 1:
task, = args.filenames
Expand All @@ -196,9 +204,6 @@ def run_validate(args):
time_limit=args.validate_time_limit,
memory_limit=args.validate_memory_limit)
except OSError as err:
if err.errno == errno.ENOENT:
returncodes.exit_with_driver_input_error("Error: {} not found. Is it on the PATH?".format(VALIDATE))
else:
returncodes.exit_with_driver_critical_error(err)
returncodes.exit_with_driver_critical_error(err)
else:
return (0, True)
4 changes: 2 additions & 2 deletions src/search/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See https://www.fast-downward.org/ForDevelopers/AddingSourceFiles
# See https://www.fast-downward.org/ForDevelopers/CMake
# for general information on adding source files and CMake libraries.
#
# All libraries are enabled by default and users can disable them by specifying
Expand Down Expand Up @@ -948,7 +948,7 @@ create_fast_downward_library(
SOURCES
landmarks/exploration
landmarks/landmark
landmarks/landmark_cost_assignment
landmarks/landmark_cost_partitioning_algorithms
landmarks/landmark_cost_partitioning_heuristic
landmarks/landmark_factory
landmarks/landmark_factory_h_m
Expand Down
Loading

0 comments on commit 1e03b80

Please sign in to comment.