diff --git a/.github/workflows/misc/cplex129_windows_installer.properties b/.github/workflows/misc/cplex2211_windows_installer.properties similarity index 98% rename from .github/workflows/misc/cplex129_windows_installer.properties rename to .github/workflows/misc/cplex2211_windows_installer.properties index 71b40e8b4c..94d581dfed 100644 --- a/.github/workflows/misc/cplex129_windows_installer.properties +++ b/.github/workflows/misc/cplex2211_windows_installer.properties @@ -25,7 +25,7 @@ USER_INSTALL_DIR=D:\\a\\downward\\cplex_temp #Copy examples #------------------- CPLEX_STUDIO_EXAMPLES_DIR=D:\\a\\downward\\cplex_examples -CPLEX_STUDIO_SAMPLE_COPY_NOT_ACTIVATED=0 +CPLEX_STUDIO_SAMPLE_COPY_ACTIVATED=1 #Associate files with CPLEX #-------------- diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5b5d27f69d..74f5a4076c 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -28,17 +28,18 @@ jobs: env: CC: ${{ matrix.version.cc }} CXX: ${{ matrix.version.cxx }} - CPLEX_URL: ${{ secrets.CPLEX129_LINUX_URL }} - SOPLEX_URL: ${{ secrets.SOPLEX311_URL }} - DOWNWARD_CPLEX_ROOT: /home/runner/lib/ibm/ILOG/CPLEX_Studio129/cplex - DOWNWARD_SOPLEX_ROOT: /home/runner/lib/soplex-3.1.1 - DOWNWARD_COIN_ROOT: /home/runner/lib/coin + CPLEX_URL: ${{ secrets.CPLEX2211_LINUX_URL }} + DOWNWARD_CPLEX_ROOT: /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_LIB: /home/runner/lib/soplex-6.0.3x/lib/ + SOPLEX_INCLUDE: /home/runner/lib/soplex-6.0.3x/include/ steps: - name: Clone repository - uses: actions/checkout@master + uses: actions/checkout@v3 - name: Install Python - uses: actions/setup-python@master + uses: actions/setup-python@v4 with: python-version: ${{ matrix.version.python }} @@ -56,11 +57,9 @@ jobs: run: | sudo apt-get -y install ${{ matrix.version.cxx }} - # We only want to set up Osi if both LP solvers are set, hence - # we execute the following three steps only if both secrets - # are set. + # Only install CPLEX if its URL/secret is set. - name: Install CPLEX - if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} + if: ${{ env.CPLEX_URL != 0 }} run: | # We redirect output of wget to hide the secret URLs. wget -O cplex_installer $CPLEX_URL &> /dev/null @@ -68,43 +67,17 @@ jobs: ./cplex_installer -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR="$(dirname "${DOWNWARD_CPLEX_ROOT}")" -i silent rm cplex_installer + # Always install SoPlex - name: Install SoPlex - if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} - run: | - # We redirect output of wget to hide the secret URLs. - wget -O soplex-3.1.1.tgz $SOPLEX_URL &> /dev/null - tar xzf soplex-3.1.1.tgz - cd soplex-3.1.1 - mkdir build - cd build - cmake -DCMAKE_INSTALL_PREFIX="$DOWNWARD_SOPLEX_ROOT" .. - make - make install - cd ../../ - rm -r soplex-3.1.1.tgz soplex-3.1.1 - - - name: Install Osi - if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | - wget http://www.coin-or.org/download/source/Osi/Osi-0.107.9.tgz - tar xzf Osi-0.107.9.tgz - cd Osi-0.107.9 - mkdir $DOWNWARD_COIN_ROOT - ./configure CC=$CC CFLAGS="-pthread -Wno-long-long" \ - CXX=$CXX CXXFLAGS="-pthread -Wno-long-long" \ - LDFLAGS="-L$DOWNWARD_CPLEX_ROOT/lib/x86-64_linux/static_pic \ - -L$DOWNWARD_SOPLEX_ROOT/lib" \ - --without-lapack --enable-static=no \ - --prefix="$DOWNWARD_COIN_ROOT" \ - --disable-bzlib \ - --with-soplex-incdir=$DOWNWARD_SOPLEX_ROOT/include \ - --with-soplex-lib="-lsoplex" \ - --with-cplex-incdir=$DOWNWARD_CPLEX_ROOT/include/ilcplex \ - --with-cplex-lib="-lcplex -lm -ldl" # -ldl is only needed for CPLEX >= 12.8 - make -j2 - make install - cd ../ - rm -r Osi-0.107.9.tgz Osi-0.107.9 + git clone https://github.com/scipopt/soplex.git + cd soplex + git checkout a5df0814d67812c13a00f06eec507b4d071fb862 + cd .. + cmake -S soplex -B build + cmake --build build + cmake --install build --prefix "${DOWNWARD_SOPLEX_ROOT}" + rm -rf soplex build - name: Compile planner run: | @@ -120,16 +93,13 @@ jobs: # archive the entire lib directory of Osi because we need all # 4 large library files and several file links to these. run: | - libs="" - if [[ ! -z "${CPLEX_URL}" || ! -z "${SOPLEX_URL}" ]]; then - libs="${libs} lib/coin/lib/" - fi + libs="${SOPLEX_LIB} ${SOPLEX_INCLUDE}" if [[ ! -z "${CPLEX_URL}" ]]; then - libs="${libs} lib/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so" + libs="${libs} ${CPLEX_LIB}" fi # Handle libs first because tar complains when no files follow the last --directory option. - tar cfz archive.tar.gz --directory /home/runner ${libs} --directory ${GITHUB_WORKSPACE} fast-downward.py driver misc builds/debug/bin/ builds/release/bin/ + tar cfz archive.tar.gz ${libs} --directory ${GITHUB_WORKSPACE} fast-downward.py driver misc builds/debug/bin/ builds/release/bin/ - name: Upload archive if: ${{ matrix.version.run_tox_tests }} @@ -150,8 +120,7 @@ jobs: - {ubuntu: ubuntu-20.04, python: '3.8'} - {ubuntu: ubuntu-22.04, python: '3.10'} env: - CPLEX_URL: ${{ secrets.CPLEX129_LINUX_URL }} - SOPLEX_URL: ${{ secrets.SOPLEX311_URL }} + CPLEX_URL: ${{ secrets.CPLEX2211_LINUX_URL }} steps: - name: Download archive uses: actions/download-artifact@master @@ -192,9 +161,6 @@ jobs: # during compilation. run: | tar xfz archive.tar.gz - if [[ ! -z "${CPLEX_URL}" || ! -z "${SOPLEX_URL}" ]]; then - mv lib/ /home/runner - fi - name: Run driver, translator and search tests run: | @@ -202,13 +168,12 @@ jobs: tox -e driver,translator,search - name: Run CPLEX tests - if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} + if: ${{ env.CPLEX_URL != 0 }} run: | cd misc/ tox -e cplex - name: Run SoPlex tests - if: ${{ env.CPLEX_URL != 0 && env.SOPLEX_URL != 0 }} run: | cd misc/ tox -e soplex diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4498b335c3..3009f22120 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -12,13 +12,10 @@ env: CC: cl CXX: cl - DOWNWARD_COIN_ROOT_RELEASE: D:\a\downward\osi_release - DOWNWARD_COIN_ROOT_DEBUG: D:\a\downward\osi_debug DOWNWARD_CPLEX_ROOT: D:\a\downward\cplex ZLIB_ROOT: D:\a\downward\zlib - CPLEX_URL: "${{ secrets.CPLEX129_WINDOWS_URL }}" - OSI_URL: "https://www.coin-or.org/download/source/Osi/Osi-0.107.9.tgz" + CPLEX_URL: "${{ secrets.CPLEX2211_WINDOWS_URL }}" ZLIB_URL: "https://www.zlib.net/zlib1213.zip" @@ -35,10 +32,10 @@ jobs: python-version: [3.8] steps: - name: Clone repository - uses: actions/checkout@master + uses: actions/checkout@v3 - name: Install Python - uses: actions/setup-python@master + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -72,75 +69,17 @@ jobs: if: ${{ env.CPLEX_URL != 0 }} run: | echo "For information about the CPLEX silent installation consult:" - echo "https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.studio.help/Optimization_Studio/topics/td_silent_install.html" + echo "https://www.ibm.com/docs/en/icos/22.1.1?topic=2211-silent-installation-cplex-optimization-studio" curl.exe --output cplex.exe $ENV:CPLEX_URL echo "Install CPLEX" - Start-Process -FilePath .\cplex.exe -ArgumentList "-f", "D:\a\downward\downward\.github\workflows\misc\cplex129_windows_installer.properties" -PassThru | Wait-Process + Start-Process -FilePath .\cplex.exe -ArgumentList "-f", "D:\a\downward\downward\.github\workflows\misc\cplex2211_windows_installer.properties" -PassThru | Wait-Process del .\cplex.exe echo "Copy the relevant directory to a location which is not magically protected against cmake" Xcopy /E /I ..\cplex_temp\cplex ..\cplex - - name: Install Coin - shell: cmd - if: ${{ env.CPLEX_URL != 0 }} - run: | - call "${{ matrix.platform.vc }}" %ARCH% - set SET_RUNTIME_LIBRARY=python D:\a\downward\downward\.github\workflows\misc\set-visual-studio-static-runtime-libraries.py - - cd .. - echo "Download OSI" - curl.exe --output osi.tgz %OSI_URL% - tar xf osi.tgz - del osi.tgz - cd Osi-0.107.9 - - echo "Set up Include Directory" - mkdir ..\osi_release\include - copy CoinUtils\src\*.hpp ..\osi_release\include - copy CoinUtils\src\*.h ..\osi_release\include - copy Osi\src\Osi\*.hpp ..\osi_release\include - copy Osi\src\Osi\*.h ..\osi_release\include - copy Osi\src\OsiCpx\*.hpp ..\osi_release\include - copy Osi\src\OsiCpx\*.h ..\osi_release\include - Xcopy /E /I ..\osi_release\include ..\osi_debug\include - - echo "Set up Lib Directory" - mkdir ..\osi_release\lib - mkdir ..\osi_debug\lib - - echo "Compile libOsi" - cd Osi\MSVisualStudio\v10\ - devenv Osi.sln /Upgrade - cd libOsi\ - %SET_RUNTIME_LIBRARY% libOsi.vcxproj libOsi.vcxproj - msbuild libOsi.vcxproj /p:Configuration=Release /p:Platform=x64 /p:DefaultWindowsSDKVersion=%WindowsSDKVersion% /p:OutDir=lib - move lib\* ..\..\..\..\..\osi_release\lib\ - msbuild libOsi.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:DefaultWindowsSDKVersion=%WindowsSDKVersion% /p:OutDir=lib - move lib\* ..\..\..\..\..\osi_debug\lib\ - - echo "Compile libOsiCpx" - cd ..\..\..\src\OsiCpx - cl /EHsc OsiCpxSolverInterface.cpp /I ..\Osi /I ..\..\..\CoinUtils\src /I "%DOWNWARD_CPLEX_ROOT%\include\ilcplex" /c - lib OsiCpxSolverInterface.obj - move OsiCpxSolverInterface.lib ..\..\..\..\osi_release\lib\libOsiCpx.lib - cl /EHsc OsiCpxSolverInterface.cpp /I ..\Osi /I ..\..\..\CoinUtils\src /I "%DOWNWARD_CPLEX_ROOT%\include\ilcplex" /c /MTd - lib OsiCpxSolverInterface.obj - move OsiCpxSolverInterface.lib ..\..\..\..\osi_debug\lib\libOsiCpx.lib - - echo "Compile libCoinUtils" - cd ..\..\..\CoinUtils\MSVisualStudio\v10 - devenv CoinUtils.sln /Upgrade - cd libCoinUtils - %SET_RUNTIME_LIBRARY% libCoinUtils.vcxproj libCoinUtils.vcxproj - msbuild libCoinUtils.vcxproj /p:Configuration=Release /p:Platform=x64 /p:DefaultWindowsSDKVersion=%WindowsSDKVersion% /p:OutDir=lib - move lib\* ..\..\..\..\..\osi_release\lib\ - msbuild libCoinUtils.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:DefaultWindowsSDKVersion=%WindowsSDKVersion% /p:OutDir=lib - move lib\* ..\..\..\..\..\osi_debug\lib\ - - - name: Compile planner shell: cmd run: | @@ -161,11 +100,6 @@ jobs: # steps, we hope to be able to install VAL natively on Windows. run: | call "${{ matrix.platform.vc }}" %ARCH% - rem "dumpbin /dependents builds\release\bin\downward.exe shows that" - rem "downward.exe depends on cplexXYZ.dll. Thus, we have to add it to" - rem "the PATH. On my local CPLEX installation this is done" - rem "automatically. For the GitHub Action we have to do it manually:" - set PATH=%PATH%;D:\a\downward\cplex_temp\opl\bin\x64_win64/ cd misc/ tox -e translator,search @@ -174,7 +108,6 @@ jobs: if: ${{ env.CPLEX_URL != 0 }} run: | call "${{ matrix.platform.vc }}" %ARCH% - set PATH=%PATH%;D:\a\downward\cplex_temp\opl\bin\x64_win64/ cd misc/ tox -e cplex diff --git a/src/cmake_modules/FindCplex.cmake b/src/cmake_modules/FindCplex.cmake index f25e1fee6c..0eafe7ff41 100644 --- a/src/cmake_modules/FindCplex.cmake +++ b/src/cmake_modules/FindCplex.cmake @@ -69,7 +69,7 @@ elseif(MSVC) elseif(MSVC13) set(CPLEX_COMPILER_HINT "vs2015") elseif(MSVC14) - set(CPLEX_COMPILER_HINT "vs2017") + set(CPLEX_COMPILER_HINT "msvc14") endif() set(CPLEX_LIBRARY_PATH_SUFFIX_RELEASE_32 "lib/x86_windows_${CPLEX_COMPILER_HINT}/stat_mda") @@ -111,6 +111,7 @@ endif() # (see issue925) and otherwise prefer the latest available version. find_library(CPLEX_LIBRARY_RELEASE NAMES + cplex2211 cplex1290 cplex1280 cplex1271 @@ -125,6 +126,7 @@ find_library(CPLEX_LIBRARY_RELEASE # See above. find_library(CPLEX_LIBRARY_DEBUG NAMES + cplex2211 cplex1290 cplex1280 cplex1271 @@ -166,7 +168,7 @@ if(CPLEX_INCLUDE_DIRS) # HACK: there must be a better way to find the dll file. find_path(CPLEX_RUNTIME_LIBRARY_PATH NAMES - cplex1262.dll + cplex2211.dll HINTS ${CPLEX_HINT_PATHS_RELEASE} ${CPLEX_HINT_PATHS_DEBUG} @@ -174,7 +176,7 @@ if(CPLEX_INCLUDE_DIRS) ${CPLEX_RUNTIME_LIBRARY_HINT} ) if(CPLEX_RUNTIME_LIBRARY_PATH) - set(CPLEX_RUNTIME_LIBRARY "${CPLEX_RUNTIME_LIBRARY_PATH}/cplex1262.dll") + set(CPLEX_RUNTIME_LIBRARY "${CPLEX_RUNTIME_LIBRARY_PATH}/cplex2211.dll") endif() endif() diff --git a/src/search/lp/soplex_solver_interface.h b/src/search/lp/soplex_solver_interface.h index 83d96b43f0..7eeeefb19d 100644 --- a/src/search/lp/soplex_solver_interface.h +++ b/src/search/lp/soplex_solver_interface.h @@ -8,9 +8,13 @@ #ifdef __GNUG__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wuse-after-free" +#if (__GNUG__ >= 11) || (__clang_major__ >= 12) #pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" #endif +#if __GNUG__ >= 12 +#pragma GCC diagnostic ignored "-Wuse-after-free" +#endif +#endif #include