-
Notifications
You must be signed in to change notification settings - Fork 4
/
ubuntu
60 lines (54 loc) · 2.67 KB
/
ubuntu
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
ARG TAG=latest
FROM ubuntu:${TAG}
ARG GMX_BRANCH
ARG GMX_DOUBLE
ARG INTEL
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
make cmake valgrind git g++ libexpat-dev libfftw3-dev libboost-all-dev txt2tags ccache gnuplot python3-numpy doxygen vim clang llvm python3-pip python3-lxml \
wget libhdf5-dev graphviz pkg-config psmisc libeigen3-dev libxc-dev sudo curl clang-tidy ninja-build libclang-dev llvm-dev libomp-dev \
clang-format software-properties-common zstd libint2-dev libecpint-dev python3-rdkit python3-h5py python3-pytest pybind11-dev python3-xmltodict ase && \
apt-get purge --autoremove -y && \
apt-get clean
# install ubuntu's gromacs
RUN . /etc/os-release && if [ -z "${GMX_BRANCH}" ]; then \
apt-get update && \
if [ "${VERSION_ID}" = "22.04" ]; then \
apt-get install -y libgromacs-dev gromacs-mpi && \
ln -s ../gromacs/cmake/gromacs /usr/share/cmake/gromacs; \
else \
apt-get install -y libgromacs-dev gromacs; \
fi && \
apt-get purge --autoremove -y && \
apt-get clean; \
fi
RUN if [ "${INTEL}" = "yes" ]; then \
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list && \
apt-get update && \
apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mkl-devel && \
apt-get purge --autoremove -y && \
apt-get clean; \
fi
RUN useradd -m -G sudo -u 1001 votca
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER votca
ENV PATH=${INTEL:+/opt/intel/oneapi/compiler/latest/linux/bin:/opt/intel/oneapi/compiler/latest/linux/bin/intel64}${PATH:+:}${PATH}
ENV LD_LIBRARY_PATH=${INTEL:+/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64:/opt/intel/oneapi/mkl/latest/lib}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}
ENV CMAKE_PREFIX_PATH=${INTEL:+/opt/intel/oneapi/mkl/latest/lib/cmake:}${CMAKE_PREFIX_PATH}
ENV CCACHE_MAXSIZE=250M
WORKDIR /home/votca
# build certain gromacs version as user
RUN if [ -n "${GMX_BRANCH}" ] && [ "${GMX_BRANCH}" != "none" ]; then \
git clone --depth 1 -b "${GMX_BRANCH}" https://gitlab.com/gromacs/gromacs.git && \
mkdir gromacs/build && cd gromacs/build && \
if [ "${GMX_BRANCH}" != release-2019 ]; then \
gmx_cmake_opts="-DGMX_INSTALL_LEGACY_API=ON"; \
fi && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DGMX_SIMD=SSE2 -DGMX_DOUBLE=${GMX_DOUBLE} ${gmx_cmake_opts} .. && \
make -j3 VERBOSE=1 && \
sudo make install && \
cd ../..; \
fi