-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpine-gnu-static
48 lines (38 loc) · 2.71 KB
/
alpine-gnu-static
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
# vim: filetype=dockerfile:
FROM alpine:edge
# Install system-wide prerequisites
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && cat /etc/apk/repositories
RUN apk update && apk add libtool autoconf automake gfortran gcc g++ make boost-dev ccache wget bash m4 file git cmake perl grep zlib-dev libexecinfo-dev ninja libdwarf-dev libelf-dev binutils-dev patch bzip2-dev xz-dev
# Install OpenMPI with gnu
ADD http://download.open-mpi.org/release/open-mpi/v2.1/openmpi-2.1.5.tar.gz /openmpi/
RUN cd /openmpi/ && tar xzf openmpi-2.1.5.tar.gz
# Patch OpenMPI 2.1.5, see https://github.com/open-mpi/ompi/issues/1838#issuecomment-230201439
ADD 111.patch /openmpi/openmpi-2.1.5/opal/mca/pmix/pmix112/pmix
RUN cd /openmpi/openmpi-2.1.5/opal/mca/pmix/pmix112/pmix && patch -p1 < 111.patch
RUN cd /openmpi/openmpi-2.1.5 && ./configure --enable-shared --enable-static --prefix=/opt/openmpi/gnu && make -sj$(grep -c processor /proc/cpuinfo) install
RUN rm -rf /openmpi
ENV PATH /opt/openmpi/gnu/bin:$PATH
ENV OMPI_MCA_plm isolated
# Create symbolic link to /lib/cpp for the charm++ build, see
# https://lists.cs.illinois.edu/lists/arc/charm/2016-05/msg00013.html
RUN ln -s /usr/bin/cpp /lib/cpp
# Configure user
RUN addgroup quinoa
RUN adduser -S quinoa quinoa
RUN chown -R quinoa:quinoa /home/quinoa
USER quinoa
WORKDIR /home/quinoa
# Clone quinoa
RUN git clone --recurse-submodules http://github.com/quinoacomputing/quinoa.git
# Pull in docker build arg: COMMIT
ARG COMMIT
# Checkout specific commit
RUN cd quinoa && git checkout $COMMIT && git log -1 HEAD
# Update submodules
RUN cd quinoa && git submodule init && git submodule update --recursive && cd external && git submodule init && git submodule update --recursive && cd .. && git submodule status --recursive
# Build TPLs with gnu as static libs
RUN cd quinoa && mkdir -p external/build/gnu-static && cd external/build/gnu-static && cmake -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DCMAKE_BUILD_TYPE=Release -DENABLE_DOXYGEN=false -DENABLE_MCSS=false -DBUILD_SHARED_LIBS=off -DCHARM_EXTRA_ARGS="--enable-error-checking" -DCMAKE_INSTALL_PREFIX=/home/quinoa/external/gnu-static ../.. && make -sj$(grep -c processor /proc/cpuinfo)
# Build code, run tests (comment this when verified, before docker push)
#RUN mkdir -p quinoa/build && cd quinoa/build && cmake -DCMAKE_CXX_FLAGS=-Werror -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DTPL_DIR=/home/quinoa/external/gnu-static -DBUILD_SHARED_LIBS=off -DRUNNER_ARGS="--bind-to none -oversubscribe" -GNinja ../src && ninja && ../script/run_tests.sh $(grep -c processor /proc/cpuinfo) mpirun -n
# Remove quinoa (keep only TPLs)
RUN rm -rf /home/quinoa/quinoa