-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
69 lines (56 loc) · 1.91 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
65
66
67
68
69
FROM rocker/rstudio:4.0.0
FROM rocker/tidyverse
MAINTAINER Peter Metz <[email protected]>
WORKDIR /ipopt_df
COPY ./r /ipopt_df/r
# IPoptr envrionment directory
ENV IPOPTR_DIR=/ipopt_df/CoinIpopt/build/Ipopt/contrib
# Give the user root access
RUN echo "$USER ALL = NOPASSWD: ALL" >> /etc/sudoers && \
apt-get update && apt-get install -y \
gcc g++ gfortran git patch wget pkg-config liblapack-dev libmetis-dev && \
##################
# Download ipoptr source
# http://www.coin-or.org/Ipopt/documentation/node10.html
##################
cd /ipopt_df && \
wget http://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.13.tgz && \
gunzip Ipopt-3.12.13.tgz && \
tar -xvf Ipopt-3.12.13.tar && \
rm -rf Ipopt-3.12.13.tar && \
mv Ipopt-3.12.13 CoinIpopt
COPY ./coinhsl-2019.05.21 /ipopt_df/CoinIpopt/ThirdParty/HSL
RUN cd /ipopt_df/CoinIpopt && \
# Downloading third party solvers
cd ThirdParty/Blas && \
./get.Blas && \
cd ../Lapack && \
./get.Lapack && \
cd ../ASL && \
./get.ASL && \
cd ../Mumps && \
./get.Mumps && \
cd ../Metis && \
./get.Metis && \
cd ../HSL && \
./configure && \
##################
# Compile ipoptr
##################
cd ../../ && \
mkdir build && \
cd build && \
../configure -with-pic CXXFLAGS="-fopenmp" FCFLAGS="-fopenmp" CFLAGS="-fopenmp" ADD_FFLAGS=-fPIC ADD_CFLAGS=-fPIC ADD_CXXFLAGS=-fPIC && \
make -j3 && \
make test && \
make install && \
##################
# Pre-install ipoptr
##################
echo "install.packages('/ipopt_df/CoinIpopt/build/Ipopt/contrib/RInterface', repos=NULL, type='source')" \
>> installIpoptrPackage.R && \
r installIpoptrPackage.R && \
rm installIpoptrPackage.R
# Default CMD from
# https://github.com/rocker-org/rocker/blob/master/rstudio/Dockerfile
# CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]