Skip to content

Commit

Permalink
Merge branch 'main' into add-fdss-2023-portfolios
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikseipp committed Oct 5, 2023
2 parents 43e7df9 + e0cf32b commit 1f636f7
Show file tree
Hide file tree
Showing 1,210 changed files with 1,627 additions and 147,206 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/experiments export-ignore
/misc export-ignore
/.gitattributes export-ignore
/.github export-ignore
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
CC: ${{ matrix.version.cc }}
CXX: ${{ matrix.version.cxx }}
CPLEX_URL: ${{ secrets.CPLEX2211_LINUX_URL }}
DOWNWARD_CPLEX_ROOT: /home/runner/lib/ibm/ILOG/CPLEX_Studio2211/cplex
cplex_DIR: /home/runner/lib/ibm/ILOG/CPLEX_Studio2211/cplex
CPLEX_LIB: /home/runner/lib/ibm/ILOG/CPLEX_Studio2211/cplex/bin/x86-64_linux/libcplex2211.so
DOWNWARD_SOPLEX_ROOT: /home/runner/lib/soplex-6.0.3x
soplex_DIR: /home/runner/lib/soplex-6.0.3x
SOPLEX_LIB: /home/runner/lib/soplex-6.0.3x/lib/
SOPLEX_INCLUDE: /home/runner/lib/soplex-6.0.3x/include/
steps:
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
# We redirect output of wget to hide the secret URLs.
wget -O cplex_installer $CPLEX_URL &> /dev/null
chmod +x cplex_installer
./cplex_installer -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR="$(dirname "${DOWNWARD_CPLEX_ROOT}")" -i silent
./cplex_installer -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR="$(dirname "${cplex_DIR}")" -i silent
rm cplex_installer
# Always install SoPlex
Expand All @@ -76,7 +76,7 @@ jobs:
cd ..
cmake -S soplex -B build
cmake --build build
cmake --install build --prefix "${DOWNWARD_SOPLEX_ROOT}"
cmake --install build --prefix "${soplex_DIR}"
rm -rf soplex build
- name: Compile planner
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
CC: cl
CXX: cl

DOWNWARD_CPLEX_ROOT: D:\a\downward\cplex
cplex_DIR: D:\a\downward\cplex

CPLEX_URL: "${{ secrets.CPLEX2211_WINDOWS_URL }}"
ZLIB_URL: "https://www.zlib.net/zlib13.zip"
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ __pycache__/
/sas_plan
/sas_plan.*
/builds/
/experiments/issue*/.venv/
/experiments/issue*/data/
/misc/.tox/
/misc/autodoc/downward-xmlrpc.secret
84 changes: 37 additions & 47 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3

import errno
import multiprocessing
import os
import subprocess
import sys
Expand All @@ -12,25 +11,18 @@
if not config.startswith("_")}
DEFAULT_CONFIG_NAME = CONFIGS.pop("DEFAULT")
DEBUG_CONFIG_NAME = CONFIGS.pop("DEBUG")

CMAKE = "cmake"
DEFAULT_MAKE_PARAMETERS = []
CMAKE_GENERATOR = None
if os.name == "posix":
MAKE = "make"
try:
num_cpus = multiprocessing.cpu_count()
except NotImplementedError:
pass
else:
DEFAULT_MAKE_PARAMETERS.append('-j{}'.format(num_cpus))
CMAKE_GENERATOR = "Unix Makefiles"
elif os.name == "nt":
MAKE = "nmake"
CMAKE_GENERATOR = "NMake Makefiles"
else:
print("Unsupported OS: " + os.name)
sys.exit(1)

try:
# Number of usable CPUs (Unix only)
NUM_CPUS = len(os.sched_getaffinity(0))
except AttributeError:
# Number of available CPUs as a fall-back (may be None)
NUM_CPUS = os.cpu_count()

def print_usage():
script_name = os.path.basename(__file__)
Expand All @@ -43,18 +35,16 @@ def print_usage():
configs.append(name + "\n " + " ".join(args))
configs_string = "\n ".join(configs)
cmake_name = os.path.basename(CMAKE)
make_name = os.path.basename(MAKE)
generator_name = CMAKE_GENERATOR.lower()
default_config_name = DEFAULT_CONFIG_NAME
debug_config_name = DEBUG_CONFIG_NAME
print("""Usage: {script_name} [BUILD [BUILD ...]] [--all] [--debug] [MAKE_OPTIONS]
print(f"""Usage: {script_name} [BUILD [BUILD ...]] [--all] [--debug] [MAKE_OPTIONS]
Build one or more predefined build configurations of Fast Downward. Each build
uses {cmake_name} to generate {generator_name} and then uses {make_name} to compile the
code. Build configurations differ in the parameters they pass to {cmake_name}.
By default, the build uses N threads on a machine with N cores if the number of
cores can be determined. Use the "-j" option for {cmake_name} to override this default
behaviour.
uses {cmake_name} to compile the code using {generator_name} . Build configurations
differ in the parameters they pass to {cmake_name}. By default, the build uses all
available cores if this number can be determined. Use the "-j" option for
{cmake_name} to override this default behaviour.
Build configurations
{configs_string}
Expand All @@ -64,7 +54,7 @@ def print_usage():
--help Print this message and exit.
Make options
All other parameters are forwarded to {make_name}.
All other parameters are forwarded to the build step.
Example usage:
./{script_name} # build {default_config_name} in #cores threads
Expand All @@ -73,7 +63,7 @@ def print_usage():
./{script_name} --debug # build {debug_config_name}
./{script_name} release debug # build release and debug configs
./{script_name} --all VERBOSE=true # build all build configs with detailed logs
""".format(**locals()))
""")


def get_project_root_path():
Expand All @@ -92,41 +82,41 @@ def get_src_path():
def get_build_path(config_name):
return os.path.join(get_builds_path(), config_name)

def try_run(cmd, cwd):
print('Executing command "{}" in directory "{}".'.format(" ".join(cmd), cwd))
def try_run(cmd):
print(f'Executing command "{" ".join(cmd)}"')
try:
subprocess.check_call(cmd, cwd=cwd)
subprocess.check_call(cmd)
except OSError as exc:
if exc.errno == errno.ENOENT:
print("Could not find '%s' on your PATH. For installation instructions, "
"see https://www.fast-downward.org/ObtainingAndRunningFastDownward." %
cmd[0])
print(f"Could not find '{cmd[0]}' on your PATH. For installation instructions, "
"see https://www.fast-downward.org/ObtainingAndRunningFastDownward.")
sys.exit(1)
else:
raise

def build(config_name, cmake_parameters, make_parameters):
print("Building configuration {config_name}.".format(**locals()))
def build(config_name, configure_parameters, build_parameters):
print(f"Building configuration {config_name}.")

build_path = get_build_path(config_name)
rel_src_path = os.path.relpath(get_src_path(), build_path)
try:
os.makedirs(build_path)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(build_path):
pass
else:
raise
generator_cmd = [CMAKE, "-S", get_src_path(), "-B", build_path]
if CMAKE_GENERATOR:
generator_cmd += ["-G", CMAKE_GENERATOR]
generator_cmd += configure_parameters
try_run(generator_cmd)

try_run([CMAKE, "-G", CMAKE_GENERATOR] + cmake_parameters + [rel_src_path],
cwd=build_path)
try_run([MAKE] + make_parameters, cwd=build_path)
build_cmd = [CMAKE, "--build", build_path]
if NUM_CPUS:
build_cmd += ["-j", f"{NUM_CPUS}"]
if build_parameters:
build_cmd += ["--"] + build_parameters
try_run(build_cmd)

print("Built configuration {config_name} successfully.".format(**locals()))
print(f"Built configuration {config_name} successfully.")


def main():
config_names = []
make_parameters = DEFAULT_MAKE_PARAMETERS
build_parameters = []
for arg in sys.argv[1:]:
if arg == "--help" or arg == "-h":
print_usage()
Expand All @@ -138,11 +128,11 @@ def main():
elif arg in CONFIGS:
config_names.append(arg)
else:
make_parameters.append(arg)
build_parameters.append(arg)
if not config_names:
config_names.append(DEFAULT_CONFIG_NAME)
for config_name in config_names:
build(config_name, CONFIGS[config_name], make_parameters)
build(config_name, CONFIGS[config_name], build_parameters)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion build_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
release_no_lp = ["-DCMAKE_BUILD_TYPE=Release", "-DUSE_LP=NO"]
# USE_GLIBCXX_DEBUG is not compatible with USE_LP (see issue983).
glibcxx_debug = ["-DCMAKE_BUILD_TYPE=Debug", "-DUSE_LP=NO", "-DUSE_GLIBCXX_DEBUG=YES"]
minimal = ["-DCMAKE_BUILD_TYPE=Release", "-DDISABLE_PLUGINS_BY_DEFAULT=YES"]
minimal = ["-DCMAKE_BUILD_TYPE=Release", "-DDISABLE_LIBRARIES_BY_DEFAULT=YES"]

DEFAULT = "release"
DEBUG = "debug"
85 changes: 0 additions & 85 deletions experiments/README

This file was deleted.

Loading

0 comments on commit 1f636f7

Please sign in to comment.