-
Notifications
You must be signed in to change notification settings - Fork 4
/
fedora
72 lines (63 loc) · 3.62 KB
/
fedora
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
61
62
63
64
65
66
67
68
69
70
71
72
ARG TAG=latest
FROM registry.fedoraproject.org/fedora:${TAG}
ARG GMX_BRANCH
ARG GMX_DOUBLE
ARG PYTHON=python3.13
ARG INTEL
RUN ( dnf -y update || dnf -y update ) && \
dnf -y install \
make cmake valgrind git gcc-c++ expat-devel fftw-devel boost-devel txt2tags ccache procps-ng gnuplot-minimal psmisc vim-minimal clang llvm compiler-rt \
python-pip python3-lxml python3-numpy wget hdf5-devel lammps eigen3-devel libxc-devel python3-espresso-openmpi sudo curl clang-tools-extra python3-cma \
ninja-build libomp-devel clang-devel llvm-devel python3-sphinx python3-nbsphinx python3-recommonmark python3-sphinx_rtd_theme python3-ipykernel patch \
python3-seaborn python3-numpydoc zstd libint2-devel libecpint-devel doxygen python3-h5py pybind11-devel python3-coverage python3-pytest-cov \
openmpi-devel boost-python3-devel python-devel boost-openmpi-devel hdf5-openmpi-devel python3-mpi4py-openmpi python-pip vim python-xmltodict python-ase && \
dnf clean all
# set https://github.com/votca/buildenv/issues/22
RUN alternatives --set gnuplot /usr/bin/gnuplot-minimal
# install fedora's gromacs
RUN if [ -z "${GMX_BRANCH}" ]; then \
( dnf -y update || dnf -y update ) && \
dnf -y install gromacs-devel gromacs gromacs-openmpi && \
dnf clean all; \
fi
RUN if [ "${INTEL}" = "yes" ]; then \
printf "[oneAPI]\nname=Intel oneAPI\nbaseurl=https://yum.repos.intel.com/oneapi\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB" > /etc/yum.repos.d/intel-oneapi.repo && \
( dnf -y update || dnf -y update ) && \
dnf -y install intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel && \
dnf clean all; \
fi
RUN useradd -m -G wheel -u 1001 votca
RUN echo '%wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER votca
ENV PATH=/usr/lib64/openmpi/bin${PATH:+:}${PATH}
ENV PATH=${INTEL:+/opt/intel/oneapi/compiler/latest/bin}${PATH:+:}${PATH}
ENV LD_LIBRARY_PATH=${INTEL:+/opt/intel/oneapi/compiler/latest/lib:/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:+:}${CMAKE_PREFIX_PATH}
ENV CMPLR_ROOT=${INTEL:+/opt/intel/oneapi/compiler/latest}${CMPLR_ROOT:+:}${CMPLR_ROOT}
RUN XPYTHON=$(basename $(readlink -f /usr/bin/python3)); if [[ ${XPYTHON} != ${PYTHON} ]]; then echo "PYTHON default needs update (is currently ${PYTHON}, but found ${XPYTHON})"; exit 1; fi
ENV PYTHONPATH=/usr/lib64/${PYTHON}/site-packages/openmpi${PYTHONPATH:+:}${PYTHONPATH}
ENV CCACHE_MAXSIZE=250M
WORKDIR /home/votca
# workaround network detection interface in OpenMPI
ENV OMPI_MCA_btl=vader,self
ENV OMPI_MCA_mtl=^ofi
# 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 && \
if [ "${GMX_BRANCH}" != release-2019 ]; then \
gmx_cmake_opts="-DGMX_INSTALL_LEGACY_API=ON"; \
else \
curl https://gitlab.com/gromacs/gromacs/-/merge_requests/1524.patch | patch -d gromacs -p 1; \
fi && \
cmake -GNinja -S gromacs -B gromacs/build -DCMAKE_INSTALL_PREFIX=/usr -DGMX_SIMD=SSE2 -DGMX_DOUBLE=${GMX_DOUBLE} ${gmx_cmake_opts} && \
cmake --build gromacs/build && \
sudo cmake --install gromacs/build; \
fi
RUN source /etc/os-release && if [ "${VERSION_ID}" -le 39 ]; then \
git clone https://github.com/espressopp/espressopp && \
cmake -S espressopp -B espressopp/build -DCMAKE_INSTALL_PREFIX=/usr && \
cmake --build espressopp/build && \
sudo cmake --install espressopp/build && \
sudo pip3 install pyh5md && \
${PYTHON} -c "import espressopp"; \
fi