Skip to content

Commit

Permalink
Merge pull request #643 from SeppiaBrilla/main
Browse files Browse the repository at this point in the history
Fixed or-tools install script
  • Loading branch information
ozgurakgun authored Feb 22, 2024
2 parents 3ecf310 + 0f8dc55 commit 2b9618f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ WORKDIR /conjure/
# All binaries will end up in /root/.local/bin
RUN mkdir -p /root/.local/bin
ENV PATH /root/.local/bin:$PATH
ENV LD_LIBRARY_PATH /root/.local/bin/lib:$LD_LIBRARY_PATH

# Dependencies
RUN apt-get update
Expand Down Expand Up @@ -70,6 +71,7 @@ RUN tests/allsolvers/test.sh
FROM ubuntu:23.10
WORKDIR /conjure
ENV PATH /root/.local/bin:$PATH
ENV LD_LIBRARY_PATH /root/.local/bin/lib:$LD_LIBRARY_PATH
RUN apt-get update
RUN apt-get install -y --no-install-recommends default-jre-headless # savilerow
RUN mkdir -p /root/.local/bin/lib
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SHELL := /bin/bash
# override by calling the makefile like so: "GHC_VERSION=9.2 make"
export GHC_VERSION?=9.4
export BIN_DIR?=${HOME}/.local/bin
export LIB_DIR?=${BIN_DIR}/lib
export PATH := $(BIN_DIR):$(PATH)
export CI?=false
export BUILD_TESTS?=false
Expand All @@ -20,10 +21,15 @@ install:
@echo ""
@echo "Installing executables to ${BIN_DIR}"
@echo "Add this directory to your PATH."
@echo "Set the environment variable BIN_DIR to change this location"
@echo "For example: \"BIN_DIR=your/preferred/path make install\""
@echo ""
@echo "Installing shared libraries to ${LIB_DIR}"
@echo "Add this directory to your LD_LIBRARY_PATH."
@echo ""
@echo "You can set the environment variables BIN_DIR and LIB_DIR to change these locations"
@echo "For example: \"BIN_DIR=your/preferred/path LIB_DIR=/usr/local/lib make install\""
@echo ""
@mkdir -p ${BIN_DIR}
@mkdir -p ${LIB_DIR}
@echo Using Stack file: etc/hs-deps/stack-${GHC_VERSION}.yaml
@if ${BUILD_TESTS} ; then echo "BUILD_TESTS=true"; fi
@if ${CI} ; then echo "CI=true"; fi
Expand Down
5 changes: 4 additions & 1 deletion etc/build/install-ortools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ set -o errexit
set -o nounset

export BIN_DIR=${BIN_DIR:-${HOME}/.local/bin}
export LIB_DIR=${LIB_DIR:-${BIN_DIR}/lib}
export PROCESSES=${PROCESSES:-1}

mkdir -p ${LIB_DIR}

rm -rf tmp-install-ortools
mkdir tmp-install-ortools
pushd tmp-install-ortools
Expand All @@ -22,7 +25,7 @@ cmake -S . -B build -DBUILD_DEPS=ON
cmake --build build --config Release --target all -j${PROCESSES}
cp build/bin/fzn-cp-sat ${BIN_DIR}/fzn-cp-sat
# .dylib or .a depending on OS
cp build/lib*/libortools* ${BIN_DIR}
cp build/lib*/libortools* ${LIB_DIR}
echo "ortools executable is at ${BIN_DIR}/fzn-cp-sat"
ls -l ${BIN_DIR}/fzn-cp-sat
popd
Expand Down
10 changes: 5 additions & 5 deletions tests/allsolvers/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ echo ""
echo ""
echo "========================================"

# echo "or-tools"
# conjure solve test.essence --solver or-tools
# echo ""
# echo ""
# echo "========================================"
echo "or-tools"
conjure solve test.essence --solver or-tools
echo ""
echo ""
echo "========================================"

# SAT solvers

Expand Down
9 changes: 9 additions & 0 deletions tests/allsolvers/stdout.expected
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Running solver: chuffed
Copying solution to: test.solution


========================================
or-tools
Using cached models.
Savile Row: model000001.eprime
Running minion for domain filtering.
Running solver: or-tools
Copying solution to: test.solution


========================================
glucose
Using cached models.
Expand Down

0 comments on commit 2b9618f

Please sign in to comment.