forked from NumCosmo/NumCosmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
83 lines (70 loc) · 1.93 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM ubuntu:latest AS compile-image
# Install basic stuff
RUN apt-get update && apt-get install -y \
nano \
wget \
git \
cmake \
pkg-config
# Install compilers
RUN apt-get update && apt-get install -y \
gcc-8 \
gfortran-8
# Install GLib and GObject related packages
RUN apt-get update && apt-get install -y \
gtk-doc-tools \
gobject-introspection \
libgirepository1.0-dev \
libglib2.0-dev
# Install package building tools
RUN apt-get update && apt-get install -y \
autoconf \
automake \
autotools-dev \
libtool
# Install dependencies
RUN apt-get update && apt-get install -y \
libgsl-dev \
libgmp-dev \
libmpfr-dev \
libcfitsio-dev \
libfftw3-dev \
libnlopt-dev \
liblapack-dev \
libopenblas-dev \
libhdf5-dev \
libflint-arb-dev
# NumCosmo (Creates a NumCosmo dir and copy everything from context to it)
RUN cd && mkdir NumCosmo usr
COPY . /root/NumCosmo/
# Set environment variables
ENV CUBACORES=1
ENV OMP_NUM_THREADS=1
ENV OMP_THREAD_LIMIT=1
WORKDIR /root/NumCosmo
RUN NOCONFIGURE=yes ./autogen.sh
RUN CC=gcc-8 FC=gfortran-8 F90=gfortran-8 F77=gfortran-8 CFLAGS="-O3 -g -Wall" FCFLAGS="-O3 -g -Wall" ./configure --prefix=/usr --enable-opt-cflags
RUN make -j12
RUN make install DESTDIR=/root
FROM ubuntu:latest AS runtime-image
# Install python
RUN apt-get update && apt-get install -y \
python3-gi \
python3-numpy \
python3-matplotlib \
python3-scipy
# Install dependencies (runtime only)
RUN apt-get update && apt-get install -y \
libgfortran5 \
libgsl23 \
libgmp10 \
libmpfr6 \
libcfitsio5 \
libfftw3-double3 \
libfftw3-single3 \
libnlopt0 \
liblapack3 \
libopenblas-base \
libhdf5-100 \
libflint-arb2
COPY --from=compile-image /root/usr /usr