Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue1093 #159

Merged
merged 20 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
cf014a4
[issue1093] Adapt ubuntu workflow.
remochristen Jul 20, 2023
3061979
[issue1093] Make lib paths explicit.
remochristen Jul 20, 2023
dd75461
[issue1093] Fix shell variable reference syntax.
remochristen Jul 20, 2023
3c8c216
[issue1093] Make SoPlex CMake instructions modern.
remochristen Jul 20, 2023
e56fc3b
[issue1093] Ignore -Wuse-after-free only for g++-12 and above.
remochristen Jul 20, 2023
46c2c0d
[issue1093] Adapt compiler warning guards.
remochristen Jul 20, 2023
b105ec1
[issue1093] Adapt compiler warning guards.
remochristen Jul 20, 2023
e6e6de7
[issue1093] Adapt compiler warning guards.
remochristen Jul 20, 2023
c8ed5fc
[issue1093] Adapt compiler warning guards.
remochristen Jul 20, 2023
0169020
[issue1093] Fix archived library path.
remochristen Jul 20, 2023
2afedd9
[issue1093] Fix archived library path.
remochristen Jul 20, 2023
857db85
[issue1093] Upgrade Windows workflow to CPLEX 22.1.1.
remochristen Jul 20, 2023
d77a341
[issue1093] Add debug output.
remochristen Jul 21, 2023
8b15ce6
[issue1093] Add cplex finder debug output.
remochristen Jul 21, 2023
662962c
[issue1093] Make messages warnings.
remochristen Jul 21, 2023
34888e5
[issue1093] Add CPLEX version number to finder script.
remochristen Jul 21, 2023
116d38f
[issue1093] Fix CPLEX compiler version.
remochristen Jul 21, 2023
0e40e00
[issue1093] Replace last 1262 reference.
remochristen Jul 21, 2023
ab0f666
[issue1093] Remove debug output.
remochristen Jul 21, 2023
c2c4c81
[issue1093] Remove PATH setting and debug output.
remochristen Jul 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
#--------------
Expand Down
83 changes: 24 additions & 59 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -56,55 +57,27 @@ 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
chmod +x cplex_installer
./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: |
Expand All @@ -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 }}
Expand All @@ -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
Expand Down Expand Up @@ -192,23 +161,19 @@ 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: |
cd misc/
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
Expand Down
77 changes: 5 additions & 72 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand All @@ -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 }}

Expand Down Expand Up @@ -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: |
Expand All @@ -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

Expand All @@ -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

Expand Down
8 changes: 5 additions & 3 deletions src/cmake_modules/FindCplex.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -111,6 +111,7 @@ endif()
# (see issue925) and otherwise prefer the latest available version.
find_library(CPLEX_LIBRARY_RELEASE
NAMES
cplex2211
cplex1290
cplex1280
cplex1271
Expand All @@ -125,6 +126,7 @@ find_library(CPLEX_LIBRARY_RELEASE
# See above.
find_library(CPLEX_LIBRARY_DEBUG
NAMES
cplex2211
cplex1290
cplex1280
cplex1271
Expand Down Expand Up @@ -166,15 +168,15 @@ 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}
PATH_SUFFIXES
${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()

Expand Down
6 changes: 5 additions & 1 deletion src/search/lp/soplex_solver_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <soplex.h>

Expand Down