Skip to content

Commit

Permalink
[issue1101] Fix release templates.
Browse files Browse the repository at this point in the history
for developers: we removed the OSI-related parts from our release templates.
  • Loading branch information
FlorianPommerening authored Jul 31, 2023
1 parent fb2c917 commit 6dfee3f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 108 deletions.
9 changes: 0 additions & 9 deletions misc/releases/push-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
RELEASESDIR=$SCRIPTDIR
DOCKERFILE="$RELEASESDIR/$MAJOR/Dockerfile.$MAJOR"

SOPLEX_INSTALLER="$DOWNWARD_LP_INSTALLERS/soplex-3.1.1.tgz"

# Verify that the LP installer files exist
if [ ! -f "$SOPLEX_INSTALLER" ]; then
echo "SoPlex 3.1.1 installation file not found at '$SOPLEX_INSTALLER'. Please set the environment variable DOWNWARD_LP_INSTALLERS to a path containing the SoPlex installer."
exit 1
fi

function docker_build_and_tag {
RECIPE_FILE=$1
BUILD_TAG=$2
Expand All @@ -37,7 +29,6 @@ function docker_build_and_tag {
TEMPDIR=$(mktemp -d)
pushd $TEMPDIR
cp $RECIPE_FILE Dockerfile
cp $SOPLEX_INSTALLER .
docker build -t $BUILD_TAG .
popd
rm -rf $TEMPDIR
Expand Down
43 changes: 12 additions & 31 deletions misc/releases/templates/_Dockerfile.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,25 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
libgmp3-dev \
make \
python3 \
wget \
zlib1g-dev

# Set up some environment variables.
ENV CXX g++
ENV SOPLEX_VERSION soplex-3.1.1
ENV DOWNWARD_SOPLEX_INSTALLER $SOPLEX_VERSION.tgz
# TODO: on next release, replace this with a tagged SoPlex release > 6.0.3.
ENV SOPLEX_REVISION a5df081
ENV DOWNWARD_SOPLEX_ROOT /opt/soplex
ENV OSI_VERSION Osi-0.107.9
ENV DOWNWARD_COIN_ROOT /opt/osi

# Install SoPlex.
WORKDIR /workspace/soplex
ADD $SOPLEX_VERSION.tgz .
RUN mkdir -p $SOPLEX_VERSION/build && \
cd $SOPLEX_VERSION/build && \
cmake -DCMAKE_INSTALL_PREFIX="$DOWNWARD_SOPLEX_ROOT" .. && \
make && \
make install

# Install OSI with support for both CPLEX and SoPlex.
WORKDIR /workspace/osi/
RUN wget http://www.coin-or.org/download/source/Osi/$OSI_VERSION.tgz && \
tar xvzf $OSI_VERSION.tgz && \
cd $OSI_VERSION && \
mkdir $DOWNWARD_COIN_ROOT && \
./configure CC="gcc" CFLAGS="-pthread -Wno-long-long" \
CXX="g++" CXXFLAGS="-pthread -Wno-long-long" \
LDFLAGS="-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" && \
make && \
make install
# 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 && \
cmake -DCMAKE_INSTALL_PREFIX="$DOWNWARD_SOPLEX_ROOT" -S . -B build && \
cmake --build build && \
cmake --install build

# Install Fast Downward.
WORKDIR /workspace/downward/
Expand All @@ -77,10 +60,8 @@ COPY --from=builder /workspace/downward/builds/release/bin/ ./builds/release/bin
COPY --from=builder /workspace/downward/builds/debug/bin/ ./builds/debug/bin/
COPY --from=builder /workspace/downward/driver ./driver
COPY --from=builder /opt/soplex /opt/soplex
COPY --from=builder /opt/osi /opt/osi

ENV DOWNWARD_SOPLEX_ROOT=/opt/soplex
ENV DOWNWARD_COIN_ROOT=/opt/osi
ENV LD_LIBRARY_PATH=$DOWNWARD_SOPLEX_ROOT/lib:$DOWNWARD_COIN_ROOT/lib
ENV LD_LIBRARY_PATH=$DOWNWARD_SOPLEX_ROOT/lib

ENTRYPOINT ["/workspace/downward/fast-downward.py"]
93 changes: 25 additions & 68 deletions misc/releases/templates/_Vagrantfile.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@
Vagrant.configure("2") do |config|
# For a complete reference of vagrant options see https://docs.vagrantup.com.

config.vm.box = "ubuntu/bionic64"
# We increase the RAM from a default of 1GB for compiling with SoPlex.
# See issue1101 for details.
config.vm.provider "virtualbox" do |v|
v.memory = 2048
end

config.vm.box = "ubuntu/jammy64"

# To compile the planner with support for CPLEX or SoPlex, download the 64-bit
# Linux installers of CPLEX 12.9 and/or SoPlex 3.1.1 and set the environment
# variable DOWNWARD_LP_INSTALLERS to an absolute path containing them before
# To compile the planner with support for CPLEX, download the 64-bit Linux
# installer of CPLEX 22.1.1 and set the environment variable
# DOWNWARD_LP_INSTALLERS to an absolute path containing them before
# provisioning the VM.
provision_env = {}
if !ENV["DOWNWARD_LP_INSTALLERS"].nil?
cplex_installer = ENV["DOWNWARD_LP_INSTALLERS"] + "/cplex_studio129.linux-x86-64.bin"
soplex_installer = ENV["DOWNWARD_LP_INSTALLERS"] + "/soplex-3.1.1.tgz"
if File.exists?(cplex_installer) || File.exists?(soplex_installer)
cplex_installer = ENV["DOWNWARD_LP_INSTALLERS"] + "/cplex_studio2211.linux_x86_64.bin"
if File.exists?(cplex_installer)
config.vm.synced_folder ENV["DOWNWARD_LP_INSTALLERS"], "/lp", :mount_options => ["ro"]
provision_env["CPLEX_INSTALLER"] = "/lp/" + File.basename(cplex_installer)
provision_env["SOPLEX_INSTALLER"] = "/lp/" + File.basename(soplex_installer)
end
end

Expand All @@ -37,75 +41,28 @@ Vagrant.configure("2") do |config|
wget \
zlib1g-dev

OSI_LD_FLAGS=""
OSI_CONFIG_OPTIONS=()
if [ -f "$CPLEX_INSTALLER" ]; then
# Set environment variables for CPLEX.
cat > /etc/profile.d/downward-cplex.sh <<- EOM
export DOWNWARD_CPLEX_ROOT="/opt/ibm/ILOG/CPLEX_Studio129/cplex"
cat > /etc/profile.d/downward-cplex.sh <<-EOM
export DOWNWARD_CPLEX_ROOT="/opt/ibm/ILOG/CPLEX_Studio2211/cplex"
EOM
source /etc/profile.d/downward-cplex.sh

# Install CPLEX.
$CPLEX_INSTALLER -DLICENSE_ACCEPTED=TRUE -i silent

# Prepare configuration of OSI.
OSI_LD_FLAGS="$OSI_LD_FLAGS -L$DOWNWARD_CPLEX_ROOT/bin/x86-64_linux"
OSI_CONFIG_OPTIONS+=(
"--with-cplex-incdir=$DOWNWARD_CPLEX_ROOT/include/ilcplex"
"--with-cplex-lib=-lcplex1290 -lm")
fi

if [ -f "$SOPLEX_INSTALLER" ]; then
# Set environment variables for SoPlex.
cat > /etc/profile.d/downward-soplex.sh <<- EOM
export DOWNWARD_SOPLEX_ROOT="/opt/soplex"
EOM
source /etc/profile.d/downward-soplex.sh

# Install SoPlex.
tar xvzf $SOPLEX_INSTALLER
pushd $(basename $SOPLEX_INSTALLER .tgz)
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="$DOWNWARD_SOPLEX_ROOT" ..
make
make install
popd

# Prepare configuration of OSI.
OSI_LD_FLAGS="$OSI_LD_FLAGS -L$DOWNWARD_SOPLEX_ROOT/lib"
OSI_CONFIG_OPTIONS+=(
"--with-soplex-incdir=$DOWNWARD_SOPLEX_ROOT/include"
"--with-soplex-lib=-lsoplex")
fi

if [ -f "$CPLEX_INSTALLER" ] || [ -f "$SOPLEX_INSTALLER" ]; then
# Set environment variables for OSI.
cat > /etc/profile.d/downward-osi.sh <<- EOM
export DOWNWARD_COIN_ROOT="/opt/osi"
EOM
source /etc/profile.d/downward-osi.sh

# Install OSI.
OSI_VERSION="Osi-0.107.9"
wget http://www.coin-or.org/download/source/Osi/$OSI_VERSION.tgz
tar xvzf $OSI_VERSION.tgz
pushd $OSI_VERSION
mkdir $DOWNWARD_COIN_ROOT

./configure CC="gcc" CFLAGS="-pthread -Wno-long-long" \
CXX="g++" CXXFLAGS="-pthread -Wno-long-long" \
LDFLAGS="$OSI_LD_FLAGS" \
--without-lapack --enable-static=no \
--prefix="$DOWNWARD_COIN_ROOT" \
--disable-bzlib \
"${OSI_CONFIG_OPTIONS[@]}"
make
make install
popd
rm -rf $OSI_VERSION $OSI_VERSION.tgz
fi
# Set environment variables for SoPlex.
cat > /etc/profile.d/downward-soplex.sh <<-EOM
export DOWNWARD_SOPLEX_ROOT="/opt/soplex"
EOM
source /etc/profile.d/downward-soplex.sh
git clone --branch master https://github.com/scipopt/soplex.git soplex
cd soplex
git checkout a5df081
cmake -DCMAKE_INSTALL_PREFIX="$DOWNWARD_SOPLEX_ROOT" -S . -B build
cmake --build build
cmake --install build

cd /home/vagrant

Expand Down

0 comments on commit 6dfee3f

Please sign in to comment.