-
Notifications
You must be signed in to change notification settings - Fork 0
/
debian-clang-smp
37 lines (30 loc) · 2.46 KB
/
debian-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
# vim: filetype=dockerfile:
FROM debian:stable
# Install system-wide prerequisites
RUN apt-get update -y && apt-get install -y git cmake g++ libc++1 libc++abi1 libc++-dev libc++abi-dev gfortran clang ninja-build m4 autoconf libtool libpugixml-dev libpstreams-dev libblas-dev liblapack-dev liblapacke-dev zlib1g-dev binutils-dev python-dev libx11-dev libxpm-dev libxft-dev libxext-dev libdw-dev libdwarf-dev vim liblua5.3-dev
# Set environment var so the system-wide libc++ is found
ENV LIBCXX_PATH /usr/lib/llvm-7
# Install OpenMPI with gnu (for static builds)
ADD http://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.3.tar.gz /openmpi/
RUN cd /openmpi/ && tar xzf openmpi-3.1.3.tar.gz && cd openmpi-3.1.3 && ./configure --enable-shared --disable-static CC=clang CXX=clang++ FC=gfortran CFLAGS=-fPIC --prefix=/opt/openmpi/clang && make -sj$(grep -c processor /proc/cpuinfo) install
RUN rm -rf /openmpi
ENV PATH /opt/openmpi/clang/bin:$PATH
ENV LD_LIBRARY_PATH /opt/openmpi/clang/lib:$LD_LIBRARY_PATH
# User configuration
RUN adduser --gecos "" --disabled-password quinoa
USER quinoa
WORKDIR /home/quinoa
CMD ["/bin/bash"]
# Clone quinoa
RUN git clone --recurse-submodules http://github.com/quinoacomputing/quinoa.git
# Checkout commit to be tested
ARG 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
RUN mkdir -p quinoa/external/build && cd quinoa/external/build && cmake -DENABLE_OMEGA_H=true -DENABLE_DOXYGEN=false -DENABLE_MCSS=false -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DCMAKE_INSTALL_PREFIX=/home/quinoa/external/clang-smp -DCHARM_EXTRA_ARGS="--enable-error-checking;smp" -DCXXFLAGS=-w .. && 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_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -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) && mpirun -n 2 --bind-to none -oversubscribe Main/unittest -v -q +ppn $((($npes-2)/2)) && ctest -j $npes --output-on-failure -LE extreme
# Clean, keep TPLs
RUN rm -rf quinoa