-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathDockerfile
More file actions
89 lines (71 loc) · 2.75 KB
/
Copy pathDockerfile
File metadata and controls
89 lines (71 loc) · 2.75 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
ARG MINIFORGE_VERSION=24.11.3-2
FROM condaforge/miniforge3:${MINIFORGE_VERSION} AS build
WORKDIR /cadet
USER root
ARG DEBIAN_FRONTEND=noninteractive
# Install dependencies without Eigen3 for which v5 is not yet available on apt
RUN apt-get update && \
apt-get -y install \
gcc-14 g++-14 \
build-essential \
cmake \
libhdf5-dev \
libsuperlu-dev \
intel-mkl \
git \
git-lfs && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 && \
rm -rf /var/lib/apt/lists/*
# --- Build and install Eigen3 v5 manually ---
ENV EIGEN_INSTALL_PREFIX=/usr/local/eigen5
RUN git clone https://gitlab.com/libeigen/eigen.git && \
cd eigen && \
git fetch origin && \
git checkout --detach origin/5.0 && \
cmake -S . -B build \
-DCMAKE_INSTALL_PREFIX="${EIGEN_INSTALL_PREFIX}" \
-DEIGEN_BUILD_BLAS=OFF \
-DEIGEN_BUILD_LAPACK=OFF \
-DBUILD_TESTING=OFF && \
cmake --install build
# Add Eigen to CMAKE_PREFIX_PATH
ENV CMAKE_PREFIX_PATH="${EIGEN_INSTALL_PREFIX}:${CMAKE_PREFIX_PATH}"
# Copy and build CADET-Core
COPY . CADET-Core
WORKDIR CADET-Core
RUN mkdir -p build
WORKDIR build
SHELL ["/bin/bash", "-c"]
ENV MKLROOT=/opt/intel/mkl
RUN cmake -DCMAKE_INSTALL_PREFIX="../install" \
-DENABLE_STATIC_LINK_DEPS=ON \
-DENABLE_STATIC_LINK_LAPACK=ON \
-DBLA_VENDOR=Intel10_64lp_seq ../
RUN make -j $(lscpu | grep 'CPU(s)' | head -n 1 | cut -d ':' -f2 | tr -d ' ') install
RUN /cadet/CADET-Core/install/bin/createLWE -o /cadet/CADET-Core/install/bin/LWE.h5
RUN /cadet/CADET-Core/install/bin/cadet-cli /cadet/CADET-Core/install/bin/LWE.h5
# ---------------- Deploy stage ----------------
FROM condaforge/miniforge3:${MINIFORGE_VERSION} AS deploy
COPY --from=build /cadet/CADET-Core/install /cadet/CADET-Core/install
COPY --from=build /usr/lib/x86_64-linux-gnu/libsz.so.2 /cadet/CADET-Core/install/lib
ENV PATH="$PATH:/cadet/CADET-Core/install/bin"
RUN apt-get update && \
apt-get -y install libhdf5-dev libsuperlu-dev git git-lfs && \
apt-get clean
# Ensure CADET-Core still works
RUN cadet-cli --version
# CADET_PYTHON_HASH can be a branch name or a commit hash or vX.X.X
ARG CADET_PYTHON_HASH=master
RUN git clone https://github.com/cadet/CADET-Python /cadet/CADET-Python
WORKDIR /cadet/CADET-Python
RUN git checkout ${CADET_PYTHON_HASH}
RUN pip install .
# CADET_PROCESS_HASH can be a branch name or a commit hash or vX.X.X
ARG CADET_PROCESS_HASH=master
RUN git clone https://github.com/fau-advanced-separations/CADET-Process /cadet/CADET-Process
WORKDIR /cadet/CADET-Process
RUN git checkout ${CADET_PROCESS_HASH}
RUN pip install .
RUN pip install cadet-rdm
WORKDIR /tmp