Skip to content
Snippets Groups Projects
Commit 45805662 authored by Franck Pérignon's avatar Franck Pérignon
Browse files

[docker-build-cpu-intel-user] [docker-build-gpu-nvidia-user]

- Try to fix docker images gen with CI (symlink loop?)
- Use pyfft from micromamba  (last version is now available)
parent 52467935
No related branches found
No related tags found
No related merge requests found
Pipeline #194412 failed
...@@ -88,60 +88,42 @@ RUN micromamba config prepend channels conda-forge && \ ...@@ -88,60 +88,42 @@ RUN micromamba config prepend channels conda-forge && \
# HPTT # (longest time compilation) # HPTT # (longest time compilation)
######## ########
FROM hysop-base-python AS hptt FROM hysop-base-python AS hptt
USER hysop-user
ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN git clone https://gitlab.com/keckj/hptt.git && \ RUN git clone https://gitlab.com/keckj/hptt.git && \
cd hptt && \ cd hptt && \
sed -i "s#-mavx##g" CMakeLists.txt && \ sed -i "s#-mavx##g" CMakeLists.txt && \
sed -i "s#-march=native##g" CMakeLists.txt && \ sed -i "s#-march=native##g" CMakeLists.txt && \
sed -i "s#-mtune=native##g" CMakeLists.txt sed -i "s#-mtune=native##g" CMakeLists.txt
RUN cmake -S hptt -B build-hptt -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX && \ RUN cmake -S hptt -B build-hptt -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX && \
cmake --build build-hptt -j$(nproc) && \ cmake --build build-hptt -j$(nproc) && \
cmake --install build-hptt cmake --install build-hptt
ENV HPTT_ROOT /opt/conda ENV HPTT_ROOT /opt/conda
RUN cd hptt/pythonAPI && \ RUN cd hptt/pythonAPI && \
pip install --no-cache-dir --upgrade . pip install --no-cache-dir --upgrade . && rm -rf hptt build-hptt
RUN rm -rf hptt build-hptt
######### #########
# FLINT # # FLINT #
######### #########
FROM hysop-base-python AS flint FROM hysop-base-python AS flint
ARG MAMBA_DOCKERFILE_ACTIVATE=1
USER hysop-user
# #
# python flint (FLINT2 + ARB + python-flint) # python flint (FLINT2 + ARB + python-flint)
# #
# flint 3.0.1 version is the last version (16 nov 2023) # flint 3.0.1 version is the last version (16 nov 2023)
# (now ARB has been merged into flint 3) # (now ARB has been merged into flint 3)
# #
# Requires gmp and mpfr -> from micromamba env
RUN wget -q https://github.com/flintlib/flint/archive/refs/tags/v3.0.1.tar.gz && \ RUN wget -q https://github.com/flintlib/flint/archive/refs/tags/v3.0.1.tar.gz && \
tar -xzf v*.tar.gz && \ tar -xzf v*.tar.gz && \
rm -f v*.tar.gz && \ rm -f v*.tar.gz && \
mv flint* flint mv flint* flint
RUN cmake -S flint -B build-flint -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX && \ RUN cmake -S flint -B build-flint -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX && \
cmake --build build-flint -j$(nproc) && \ cmake --build build-flint -j$(nproc) && \
cmake --install build-flint cmake --install build-flint && \
# RUN rm -rf flint* build-flint rm -rf flint* build-flint
#####################
# HDF5_mpi and H5PY #
#####################
# NOT USED !
FROM hysop-base-python AS hdf5_mpi_h5py
ENV MPICC "mpicc"
ARG pip_install_opts='--upgrade --no-binary=h5py --no-deps --no-build-isolation'
RUN wget -q https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.3/src/hdf5-1.14.3.tar.gz && \
tar -xzf hdf5-*.tar.gz && \
rm -f hdf5-*.tar.gz
RUN cd hdf5-* && \
CC="${MPICC}" ./configure --prefix=$CONDA_PREFIX --enable-parallel \
--enable-shared=yes --enable-static=no && \
make -j$(nproc) && \
make install
RUN rm -rf hdf5-* && \
CC="${MPICC}" HDF5_MPI="ON" HDF5_VERSION="1.14.3" \
HDF5_DIR=$CONDA_PREFIX H5PY_SETUP_REQUIRES=0 \
pip install ${pip_install_opts} h5py==3.11.0
########## ##########
# Stage # # Stage #
...@@ -159,8 +141,7 @@ RUN pip install --no-cache-dir --upgrade \ ...@@ -159,8 +141,7 @@ RUN pip install --no-cache-dir --upgrade \
RUN git clone https://github.com/geggo/gpyfft.git && \ RUN git clone https://github.com/geggo/gpyfft.git && \
cd gpyfft && \ cd gpyfft && \
sed 's#finalize(self, _destroy_plan, self.plan)##' -i gpyfft/gpyfftlib.pyx && \ sed 's#finalize(self, _destroy_plan, self.plan)##' -i gpyfft/gpyfftlib.pyx && \
pip install --no-cache-dir . pip install --no-cache-dir . && rm -rf gpyfft
RUN rm -rf gpyfft
# # # #
# FFTW latest version nov 2023 # FFTW latest version nov 2023
...@@ -186,12 +167,12 @@ RUN rm -rf gpyfft ...@@ -186,12 +167,12 @@ RUN rm -rf gpyfft
# pyfftw is linked to fftw3 compiled above # pyfftw is linked to fftw3 compiled above
#ARG pip_install_opts='--no-binary=pyfftw --no-deps --no-build-isolation' #ARG pip_install_opts='--no-binary=pyfftw --no-deps --no-build-isolation'
ARG pip_install_opts='--no-cache-dir --no-binary=pyfftw --no-deps' #ARG pip_install_opts='--no-cache-dir --no-binary=pyfftw --no-deps'
RUN git clone https://github.com/pyFFTW/pyFFTW.git && \ #RUN git clone https://github.com/pyFFTW/pyFFTW.git && \
cd pyFFTW && \ # cd pyFFTW && \
# PYFFTW_INCLUDE="/include" \ ## PYFFTW_INCLUDE="/include" \
pip install ${pip_install_opts} . # pip install ${pip_install_opts} . && \
RUN rm -rf pyFFTW # cd && rm -rf pyFFTW
############### ###############
# Final-Stage # # Final-Stage #
...@@ -199,13 +180,16 @@ RUN rm -rf pyFFTW ...@@ -199,13 +180,16 @@ RUN rm -rf pyFFTW
FROM hysop-full-python AS hysop-final FROM hysop-full-python AS hysop-final
# Copy only necessary files from previous stages # Copy only necessary files from previous stages
COPY --from=hptt /opt/conda/lib/libhptt* /opt/conda/lib COPY --from=hptt --chown=hysop-user:hysop-user /opt/conda/lib/libhptt.so /opt/conda/lib/
COPY --from=hptt /opt/conda/include /opt/conda/include COPY --from=hptt --chown=hysop-user:hysop-user /opt/conda/include/compute_node.h /opt/conda/include/hptt*.h \
COPY --from=flint /opt/conda/include/flint /opt/conda/include/flint /opt/conda/include/macros.h /opt/conda/include/plan.h /opt/conda/include/utils.h /opt/conda/include/transpose.h /opt/conda/include/
COPY --from=flint /opt/conda/lib/libflint* /opt/conda/lib COPY --from=hptt --chown=hysop-user:hysop-user /opt/conda/lib/python3.12/site-packages/hptt \
# Copy only necessary parts of /opt/conda /opt/conda/lib/python3.12/site-packages/hptt
COPY --from=hptt /opt/conda/lib/python3.12/site-packages/hptt \
/opt/conda/lib/python3.12/site-packages/hptt COPY --from=flint --chown=hysop-user:hysop-user /opt/conda/include/flint /opt/conda/include/flint
RUN mkdir -p /home/hysop-user/temp/lib
COPY --from=flint --chown=hysop-user:hysop-user /opt/conda/lib/libflint* /home/hysop-user/temp/lib/
RUN mv /home/hysop-user/temp/lib/libflint* /opt/conda/lib/ && rm -rf /home/hysop-user/temp
# Important for f2py command summit in meson build system! # Important for f2py command summit in meson build system!
ENV MPIFC mpif90 ENV MPIFC mpif90
...@@ -223,7 +207,6 @@ ENV MPIEXEC_EXECUTABLE="${MPI_HOME}/bin/mpiexec" ...@@ -223,7 +207,6 @@ ENV MPIEXEC_EXECUTABLE="${MPI_HOME}/bin/mpiexec"
RUN rm -rf $HOME/.cache/pip/* && \ RUN rm -rf $HOME/.cache/pip/* && \
rm -rf /tmp/* rm -rf /tmp/*
# ---- cpu image --- # ---- cpu image ---
FROM hysop-final AS hysop-final-cpu FROM hysop-final AS hysop-final-cpu
......
...@@ -69,6 +69,7 @@ dependencies: ...@@ -69,6 +69,7 @@ dependencies:
- h5py=*=mpi* - h5py=*=mpi*
- fftw=*=mpi* - fftw=*=mpi*
- tox - tox
- pyfftw
channels: channels:
- numba - numba
dependencies: dependencies:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment