-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpine-clang
50 lines (40 loc) · 2.62 KB
/
alpine-clang
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
# 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 clang clang-dev libdwarf-dev libelf-dev binutils-dev patch
# Install OpenMPI with clang
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 CC=clang CXX=clang++ --enable-shared --enable-static --prefix=/opt/openmpi/clang && 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 clang as shared libs
RUN cd quinoa && mkdir -p external/build/clang && cd external/build/clang && export PATH=/opt/openmpi/clang/bin:$PATH && cmake -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DCMAKE_BUILD_TYPE=Release -DENABLE_OMEGA_H=true -DENABLE_DOXYGEN=false -DENABLE_MCSS=false -DCXXFLAGS="-Wno-disabled-macro-expansion -Wno-zero-as-null-pointer-constant" -DCHARM_EXTRA_ARGS="--enable-error-checking;--with-prio-type=int;--enable-randomized-msgq;--suffix;randq-debug" -DCMAKE_INSTALL_PREFIX=/home/quinoa/external/clang ../.. && make -sj$(grep -c processor /proc/cpuinfo)
# Remove quinoa (keep only TPLs)
RUN rm -rf /home/quinoa/quinoa
# Add clang ccache links
USER root
RUN ln -s /usr/bin/ccache /usr/lib/ccache/bin/clang && ln -s /usr/bin/ccache /usr/lib/ccache/bin/clang++
USER quinoa