-
Notifications
You must be signed in to change notification settings - Fork 0
/
scip.dockerfile
84 lines (70 loc) · 2.66 KB
/
scip.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Build from official python image
FROM python:3.8
# Set working directory
WORKDIR /app
# Boost variables
ENV BOOST_MAJOR 1
ENV BOOST_MINOR 74
ENV BOOST_PATCH 0
ENV BOOST_VERSION "${BOOST_MAJOR}.${BOOST_MINOR}.${BOOST_PATCH}"
ENV BOOST_SRC_DIR "/app/boost_${BOOST_MAJOR}_${BOOST_MINOR}_${BOOST_PATCH}"
ENV BOOST_FILENAME "boost_${BOOST_MAJOR}_${BOOST_MINOR}_${BOOST_PATCH}.tar.bz2"
ENV BOOST_URL "https://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/${BOOST_FILENAME}/download"
# SCIP variables
ENV SCIP_VERSION 8.0.0
ENV SCIP_SRC_DIR /app/scipoptsuite-${SCIP_VERSION}
ENV SCIP_FILENAME scipoptsuite-${SCIP_VERSION}.tgz
ENV SCIP_URL https\://www.scipopt.org/download/release
# TBB variables
ENV TBB_SRC_DIR /app/oneTBB
ENV TBB_URL https://github.com/oneapi-src/oneTBB.git
# yaml-cpp variables
ENV YAML_CPP_SRC_DIR /app/yaml-cpp
ENV YAML_CPP_URL https://github.com/jbeder/yaml-cpp.git
# install locations
ENV LOCAL_INSTALL_PREFIX /usr/local/
ENV TBB_ROOT ${LOCAL_INSTALL_PREFIX}
ENV SCIP_ROOT ${LOCAL_INSTALL_PREFIX}
ENV YAML_CPP_ROOT ${LOCAL_INSTALL_PREFIX}
# export location of local install for linker
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${LOCAL_INSTALL_PREFIX}/lib"
# download and extract boost, scip, TBB and yaml-cpp
ADD ${BOOST_URL} ${BOOST_FILENAME}
ADD ${SCIP_URL}/${SCIP_FILENAME} ${SCIP_FILENAME}
ADD https://github.com/repos/oneapi-src/oneTBB/compare/master...HEAD /dev/null
ADD https://github.com/repos/jbeder/yaml-cpp/compare/master...HEAD /dev/null
RUN tar --bzip2 -xf ${BOOST_FILENAME}
RUN tar zxvf ${SCIP_FILENAME}
RUN git clone ${TBB_URL} ${TBB_SRC_DIR}
RUN git clone ${YAML_CPP_URL} ${YAML_CPP_SRC_DIR}
# install build dependencies with pip
RUN pip3 install cmake ninja scikit-build
# build and install Boost
WORKDIR ${BOOST_SRC_DIR}
RUN ./bootstrap.sh
RUN ./b2 install
RUN rm -r ${BOOST_SRC_DIR}
# build and install TBB
RUN mkdir ${TBB_SRC_DIR}/build
WORKDIR ${TBB_SRC_DIR}/build
RUN cmake -GNinja -DCMAKE_INSTALL_PREFIX=${TBB_ROOT} -DTBB_TEST=OFF ..
RUN cmake --build .
RUN cmake --install .
RUN rm -r ${TBB_SRC_DIR}
# build and install SCIP
RUN mkdir ${SCIP_SRC_DIR}/build
WORKDIR ${SCIP_SRC_DIR}/build
RUN cmake -GNinja -DCMAKE_INSTALL_PREFIX=${SCIP_ROOT} -DIPOPT=false ..
RUN cmake --build .
RUN cmake --install .
RUN rm -r ${SCIP_SRC_DIR}
# download, build and install yaml-cpp
RUN mkdir ${YAML_CPP_SRC_DIR}/build
WORKDIR ${YAML_CPP_SRC_DIR}/build
RUN cmake -GNinja -DYAML_BUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DYAML_CPP_BUILD_TESTS=0 -DCMAKE_INSTALL_PREFIX=${YAML_CPP_ROOT} ..
RUN cmake --build .
RUN cmake --install .
RUN rm -r ${YAML_CPP_SRC_DIR}
# set so that pyscipopt can find the scip install
ENV SCIPOPTDIR=${SCIP_ROOT}
RUN pip install pyscipopt