diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index eef77cad07..36759a50e8 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -11,7 +11,7 @@ jobs: name: Autodoc if: github.repository == 'aibasel/downward' timeout-minutes: 60 - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 env: DOWNWARD_AUTODOC_PASSWORD: ${{ secrets.DOWNWARD_AUTODOC_PASSWORD }} steps: diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index c79ba31447..cc7a95ab1d 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -15,8 +15,8 @@ jobs: strategy: matrix: version: - - {macos: macos-11, python: '3.8'} - - {macos: macos-12, python: '3.10'} + - {macos: macos-13, python: '3.10'} + - {macos: macos-14, python: '3.10'} steps: - name: Clone repository uses: actions/checkout@v3 diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 5fc5f6df83..88ea3acac1 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -10,7 +10,7 @@ on: jobs: style: name: Test code style - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Clone repository uses: actions/checkout@v3 @@ -23,14 +23,7 @@ jobs: - name: Install dependencies run: | pip3 install tox - sudo apt-get -y install clang-tidy-12 - - # TODO: Remove once issue with Ubuntu 22.04 and clang++-14 is resolved. - - name: Work around https://github.com/actions/runner-images/issues/8659 - run: | - sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list - sudo apt-get update - sudo apt-get install -y --allow-downgrades libc6=2.35-* libc6-dev=2.35-* libstdc++6=12.3.0-* libgcc-s1=12.3.0-* + sudo apt-get -y install clang-tidy-16 - name: Install uncrustify run: | diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 00df07d298..a179d71982 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -20,20 +20,19 @@ jobs: strategy: matrix: version: - - {ubuntu: 'ubuntu-20.04', python: '3.8', cc: gcc-10, cxx: g++-10, run_tox_tests: true} - - {ubuntu: 'ubuntu-20.04', python: '3.8', cc: clang-12, cxx: clang++-12, run_tox_tests: false} - - {ubuntu: 'ubuntu-22.04', python: '3.10', cc: gcc-11, cxx: g++-11, run_tox_tests: false} - {ubuntu: 'ubuntu-22.04', python: '3.10', cc: gcc-12, cxx: g++-12, run_tox_tests: true} - - {ubuntu: 'ubuntu-22.04', python: '3.10', cc: clang-14, cxx: clang++-14, run_tox_tests: false} + - {ubuntu: 'ubuntu-22.04', python: '3.10', cc: clang-15, cxx: clang++-15, run_tox_tests: false} + - {ubuntu: 'ubuntu-24.04', python: '3.10', cc: gcc-14, cxx: g++-14, run_tox_tests: true} + - {ubuntu: 'ubuntu-24.04', python: '3.10', cc: clang-18, cxx: clang++-18, run_tox_tests: false} env: CC: ${{ matrix.version.cc }} CXX: ${{ matrix.version.cxx }} CPLEX_URL: ${{ secrets.CPLEX2211_LINUX_URL }} 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 - 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/ + soplex_DIR: /home/runner/lib/soplex-7.1.0 + SOPLEX_LIB: /home/runner/lib/soplex-7.1.0/lib/ + SOPLEX_INCLUDE: /home/runner/lib/soplex-7.1.0/include/ steps: - name: Clone repository uses: actions/checkout@v3 @@ -57,14 +56,6 @@ jobs: run: | sudo apt-get -y install ${{ matrix.version.cxx }} - # TODO: Remove once issue with Ubuntu 22.04 and clang++-14 is resolved. - - name: Work around https://github.com/actions/runner-images/issues/8659 - if: matrix.version.cxx == 'clang++-14' - run: | - sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list - sudo apt-get update - sudo apt-get install -y --allow-downgrades libc6=2.35-* libc6-dev=2.35-* libstdc++6=12.3.0-* libgcc-s1=12.3.0-* - # Only install CPLEX if its URL/secret is set. - name: Install CPLEX if: ${{ env.CPLEX_URL != 0 }} @@ -80,7 +71,7 @@ jobs: run: | git clone https://github.com/scipopt/soplex.git cd soplex - git checkout a5df0814d67812c13a00f06eec507b4d071fb862 + git checkout release-710 cd .. cmake -S soplex -B build cmake --build build @@ -121,8 +112,8 @@ jobs: strategy: matrix: version: - - {ubuntu: ubuntu-20.04, python: '3.8'} - {ubuntu: ubuntu-22.04, python: '3.10'} + - {ubuntu: ubuntu-24.04, python: '3.10'} env: CPLEX_URL: ${{ secrets.CPLEX2211_LINUX_URL }} steps: diff --git a/misc/releases/templates/_Dockerfile.tpl b/misc/releases/templates/_Dockerfile.tpl index c301bf0ae9..f70e5077dd 100644 --- a/misc/releases/templates/_Dockerfile.tpl +++ b/misc/releases/templates/_Dockerfile.tpl @@ -6,7 +6,7 @@ ############################################################################### # A first image to build the planner ############################################################################### -FROM ubuntu:22.04 AS builder +FROM ubuntu:24.04 AS builder RUN apt-get update && apt-get install --no-install-recommends -y \ ca-certificates \ @@ -20,18 +20,12 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ # Set up some environment variables. ENV CXX g++ -# TODO: on next release, replace this with a tagged SoPlex release > 6.0.3. -ENV SOPLEX_REVISION a5df081 +ENV SOPLEX_REVISION release-710 ENV soplex_DIR /opt/soplex # Install SoPlex. WORKDIR /workspace/soplex -# TODO: on next release, work with a tagged SoPlex release again if possible. -# We might continue using git clone, replacing this with `--depth 1 --branch $SOPLEX_REVISION` -# ($SOPLEX_REVISION needs to be a branch or tag, not a commit hash) or use -# another distribution mechanism. -RUN git clone --branch master https://github.com/scipopt/soplex.git . && \ - git checkout $SOPLEX_REVISION && \ +RUN git clone --depth 1 --branch $SOPLEX_REVISION https://github.com/scipopt/soplex.git . && \ cmake -DCMAKE_INSTALL_PREFIX="$soplex_DIR" -S . -B build && \ cmake --build build && \ cmake --install build @@ -46,7 +40,7 @@ RUN git clone --depth 1 --branch TAG https://github.com/aibasel/downward.git . & ############################################################################### # The final image to run the planner ############################################################################### -FROM ubuntu:22.04 AS runner +FROM ubuntu:24.04 AS runner RUN apt-get update && apt-get install --no-install-recommends -y \ python3 \ diff --git a/misc/releases/templates/_Vagrantfile.tpl b/misc/releases/templates/_Vagrantfile.tpl index 5b392053d3..3fb8b0f2b6 100644 --- a/misc/releases/templates/_Vagrantfile.tpl +++ b/misc/releases/templates/_Vagrantfile.tpl @@ -11,7 +11,7 @@ Vagrant.configure("2") do |config| v.memory = 2048 end - config.vm.box = "ubuntu/jammy64" + config.vm.box = "ubuntu/noble64" # To compile the planner with support for CPLEX, download the 64-bit Linux # installer of CPLEX 22.1.1 and set the environment variable @@ -56,9 +56,8 @@ Vagrant.configure("2") do |config| export soplex_DIR="/opt/soplex" EOM source /etc/profile.d/downward-soplex.sh - git clone --branch master https://github.com/scipopt/soplex.git soplex + git clone --depth 1 --branch release-710 https://github.com/scipopt/soplex.git soplex cd soplex - git checkout a5df081 cmake -DCMAKE_INSTALL_PREFIX="$soplex_DIR" -S . -B build cmake --build build cmake --install build diff --git a/misc/style/run-clang-tidy.py b/misc/style/run-clang-tidy.py index 2bc557ccde..8b3360b43e 100755 --- a/misc/style/run-clang-tidy.py +++ b/misc/style/run-clang-tidy.py @@ -103,10 +103,10 @@ def check_search_code_with_clang_tidy(): {{key: performance-unnecessary-value-param.AllowedTypes, value: "{';'.join(LIGHTWEIGHT_TYPES)}"}},\ ]}}""".replace(" ", "") cmd = [ - "run-clang-tidy-12", + "run-clang-tidy-16", "-quiet", "-p", build_dir, - "-clang-tidy-binary=clang-tidy-12", + "-clang-tidy-binary=clang-tidy-16", "-checks=-*," + ",".join(checks), f"-config={config}", ] @@ -116,7 +116,7 @@ def check_search_code_with_clang_tidy(): try: p = subprocess.run(cmd, cwd=DIR, text=True, capture_output=True, check=False) except FileNotFoundError: - sys.exit(f"run-clang-tidy-12 not found. Is it on the PATH?") + sys.exit(f"run-clang-tidy-16 not found. Is it on the PATH?") output = f"{p.stdout}\n{p.stderr}" errors = re.findall(r"^(.*:\d+:\d+: .*(?:warning|error): .*)$", output, flags=re.M) filtered_errors = [error for error in errors if not any(ignore in error for ignore in IGNORES)] @@ -126,7 +126,7 @@ def check_search_code_with_clang_tidy(): for error in filtered_errors: print(error) fix_cmd = cmd + [ - "-clang-apply-replacements-binary=clang-apply-replacements-12", "-fix"] + "-clang-apply-replacements-binary=clang-apply-replacements-16", "-fix"] print("\nYou may be able to fix some of these issues with the following command:\n" + " ".join(pipes.quote(x) for x in fix_cmd)) sys.exit(1) diff --git a/src/search/CMakeLists.txt b/src/search/CMakeLists.txt index 393c2b2ed9..2ed853265b 100644 --- a/src/search/CMakeLists.txt +++ b/src/search/CMakeLists.txt @@ -561,8 +561,7 @@ if(USE_LP) target_sources(lp_solver INTERFACE lp/cplex_solver_interface.h lp/cplex_solver_interface.cc) endif() - # TODO: we actually require a version greater than 6.0.3 but it is not released yet. - find_package(soplex 6.0.3 QUIET) + find_package(soplex 7.1.0 QUIET) if (SOPLEX_FOUND) message(STATUS "Found SoPlex: ${SOPLEX_INCLUDE_DIRS}") target_link_libraries(lp_solver INTERFACE libsoplex) diff --git a/src/search/cmake/common_cxx_flags.cmake b/src/search/cmake/common_cxx_flags.cmake index 5d5cbd777d..fcb1603120 100644 --- a/src/search/cmake/common_cxx_flags.cmake +++ b/src/search/cmake/common_cxx_flags.cmake @@ -45,3 +45,11 @@ target_compile_options(common_cxx_warnings INTERFACE # /wd4244: conversion with possible loss of data # /wd4267: conversion from size_t to int with possible loss of data target_link_libraries(common_cxx_flags INTERFACE common_cxx_warnings) + +set(v15_or_later "$,15>") +set(using_clang "$") +set(using_apple_clang "$") +set(using_clang_like "$") +set(should_ignore_std_warning "$") +target_compile_options(common_cxx_warnings INTERFACE + "$<${should_ignore_std_warning}:-Wno-unqualified-std-cast-call>") diff --git a/src/search/command_line.cc b/src/search/command_line.cc index 714b5c9622..e8934d9240 100644 --- a/src/search/command_line.cc +++ b/src/search/command_line.cc @@ -89,7 +89,7 @@ static shared_ptr parse_cmd_line_aux(const vector &args SearchPtr search_algorithm = nullptr; // TODO: Remove code duplication. for (size_t i = 0; i < args.size(); ++i) { - string arg = args[i]; + const string &arg = args[i]; bool is_last = (i == args.size() - 1); if (arg == "--search") { if (search_algorithm) @@ -97,7 +97,7 @@ static shared_ptr parse_cmd_line_aux(const vector &args if (is_last) input_error("missing argument after --search"); ++i; - string search_arg = args[i]; + const string &search_arg = args[i]; try { parser::TokenStream tokens = parser::split_tokens(search_arg); parser::ASTNodePtr parsed = parser::parse(tokens); @@ -112,7 +112,7 @@ static shared_ptr parse_cmd_line_aux(const vector &args bool txt2tags = false; vector plugin_names; for (size_t j = i + 1; j < args.size(); ++j) { - string help_arg = args[j]; + const string &help_arg = args[j]; if (help_arg == "--txt2tags") { txt2tags = true; } else { diff --git a/src/search/heuristics/hm_heuristic.cc b/src/search/heuristics/hm_heuristic.cc index 0b6990ad81..63022ef271 100644 --- a/src/search/heuristics/hm_heuristic.cc +++ b/src/search/heuristics/hm_heuristic.cc @@ -64,9 +64,7 @@ void HMHeuristic::init_hm_table(const Tuple &t) { void HMHeuristic::update_hm_table() { - int round = 0; do { - ++round; was_updated = false; for (OperatorProxy op : task_proxy.get_operators()) { diff --git a/src/search/heuristics/lm_cut_landmarks.cc b/src/search/heuristics/lm_cut_landmarks.cc index ea8c5e6502..590c070e6f 100644 --- a/src/search/heuristics/lm_cut_landmarks.cc +++ b/src/search/heuristics/lm_cut_landmarks.cc @@ -288,9 +288,7 @@ bool LandmarkCutLandmarks::compute_landmarks( if (artificial_goal.status == UNREACHED) return true; - int num_iterations = 0; while (artificial_goal.h_max_cost != 0) { - ++num_iterations; mark_goal_plateau(&artificial_goal); assert(cut.empty()); second_exploration(state, second_exploration_queue, cut); diff --git a/src/search/landmarks/landmark_factory_rpg_sasp.cc b/src/search/landmarks/landmark_factory_rpg_sasp.cc index 813c02cd9b..bb1b592164 100644 --- a/src/search/landmarks/landmark_factory_rpg_sasp.cc +++ b/src/search/landmarks/landmark_factory_rpg_sasp.cc @@ -175,6 +175,7 @@ void LandmarkFactoryRpgSasp::found_simple_lm_and_order( // Retrieve incoming edges from disj_lm vector predecessors; + predecessors.reserve(disj_lm->parents.size()); for (auto &pred : disj_lm->parents) { predecessors.push_back(pred.first); } diff --git a/src/search/lp/soplex_solver_interface.cc b/src/search/lp/soplex_solver_interface.cc index 02c7cdb228..e0331c6388 100644 --- a/src/search/lp/soplex_solver_interface.cc +++ b/src/search/lp/soplex_solver_interface.cc @@ -143,8 +143,10 @@ void SoPlexSolverInterface::print_failure_analysis() const { case SPxSolverBase::Status::NOT_INIT: cout << "Not initialized" << endl; break; +#if SOPLEX_VERSION < 700 case SPxSolverBase::Status::ABORT_EXDECOMP: case SPxSolverBase::Status::ABORT_DECOMP: +#endif case SPxSolverBase::Status::ABORT_CYCLING: case SPxSolverBase::Status::ABORT_TIME: case SPxSolverBase::Status::ABORT_ITER: diff --git a/src/search/merge_and_shrink/factored_transition_system.cc b/src/search/merge_and_shrink/factored_transition_system.cc index d60e9afe03..f7ec99c7c8 100644 --- a/src/search/merge_and_shrink/factored_transition_system.cc +++ b/src/search/merge_and_shrink/factored_transition_system.cc @@ -82,8 +82,8 @@ void FactoredTransitionSystem::assert_index_valid(int index) const { assert(utils::in_bounds(index, transition_systems)); assert(utils::in_bounds(index, mas_representations)); assert(utils::in_bounds(index, distances)); - if (!(transition_systems[index] && mas_representations[index] && distances[index]) && - !(!transition_systems[index] && !mas_representations[index] && !distances[index])) { + if ((!transition_systems[index] || !mas_representations[index] || !distances[index]) && + (transition_systems[index] || mas_representations[index] || distances[index])) { cerr << "Factor at index is in an inconsistent state!" << endl; utils::exit_with(utils::ExitCode::SEARCH_CRITICAL_ERROR); } diff --git a/src/search/merge_and_shrink/merge_and_shrink_algorithm.cc b/src/search/merge_and_shrink/merge_and_shrink_algorithm.cc index 7b678a7663..dc9530d6d4 100644 --- a/src/search/merge_and_shrink/merge_and_shrink_algorithm.cc +++ b/src/search/merge_and_shrink/merge_and_shrink_algorithm.cc @@ -200,7 +200,6 @@ void MergeAndShrinkAlgorithm::main_loop( << timer.get_elapsed_time() << " (" << msg << ")" << endl; }; - int iteration_counter = 0; while (fts.get_num_active_entries() > 1) { // Choose next transition systems to merge pair merge_indices = merge_strategy->get_next(); @@ -321,8 +320,6 @@ void MergeAndShrinkAlgorithm::main_loop( if (log.is_at_least_normal()) { log << endl; } - - ++iteration_counter; } log << "End of merge-and-shrink algorithm, statistics:" << endl;