-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalpine-clang-smp
49 lines (39 loc) · 2.8 KB
/
alpine-clang-smp
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
# 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/v3.1/openmpi-3.1.1.tar.gz /openmpi/
RUN cd /openmpi/ && tar xzf openmpi-3.1.1.tar.gz
RUN cd /openmpi/openmpi-3.1.1 && ./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/clang/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;smp" -DCMAKE_INSTALL_PREFIX=/home/quinoa/external/clang-smp ../.. && 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 -DTPL_DIR=/home/quinoa/external/clang-smp -GNinja -DRUNNER=mpirun -DRUNNER_NCPUS_ARG=-n -DRUNNER_ARGS="--bind-to none -oversubscribe" ../src && ninja && npes=$(($(grep -c processor /proc/cpuinfo)-2)) && ppn=$(($npes/2)) && ../script/run_tests.sh 2 mpirun -n "--bind-to none -oversubscribe" "+ppn $ppn"
# 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