-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
65 lines (54 loc) · 1.78 KB
/
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
FROM docker.io/debian:bookworm-20231030 as debian-base
MAINTAINER Martin Heistermann <[email protected]>
FROM debian-base as base-packages
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
binutils \
build-essential \
ca-certificates \
clang \
cmake \
curl \
git \
libc-dev \
liblapack-dev \
libopenblas64-serial-dev \
libtool \
locales \
ninja-build \
time \
tzdata \
wget \
pkg-config \
libgmp-dev \
libomp-dev \
gfortran \
clang
RUN echo "Downloading Gurobi..." \
mkdir -p /opt && \
cd /opt && \
wget -q https://packages.gurobi.com/10.0/gurobi10.0.3_linux64.tar.gz && \
echo 82f916db110c42ce8ce13c10a14eba97c7acd63c3c0c59f98186c5085780ca83 gurobi10.0.3_linux64.tar.gz | sha256sum --check && \
tar xf gurobi10.0.3_linux64.tar.gz && \
ln -s gurobi1003 gurobi
RUN mkdir -p /usr/src/coin-or && \
mkdir -p /opt/coin-or && \
cd /usr/src/coin-or && \
wget https://raw.githubusercontent.com/coin-or/coinbrew/master/coinbrew \
&& chmod +x coinbrew
RUN cd /usr/src/coin-or && ./coinbrew fetch [email protected]
RUN cd /usr/src/coin-or && ./coinbrew build [email protected] --prefix=/opt/coin-or --parallel-jobs 8
# TODO: can set --parallel-jobs in build step
FROM base-packages AS build
COPY . /app
ENV IPOPT_HOME=/opt/coin-or
RUN mkdir /app/build && cd /app/build && \
cmake -G Ninja \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_COMPILER=clang++ \
-D CMAKE_C_COMPILER=clang \
-D CMAKE_CXX_FLAGS="-march=native" \
.. && ninja
#-D CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
RUN ln -s /app/build/Build/bin/* /usr/local/bin
#RUN apt-get clean && rm -rf /var/lib/apt/lists/