# Image de départ. FROM openmpi:latest SHELL ["/bin/bash", "-c"] WORKDIR / ARG petsc_branch=main ARG petsc_ver=petsc-${petsc_branch} ARG petsc_rep_dest=/opt/${petsc_ver} RUN \ git clone https://gitlab.com/petsc/petsc.git -b main && \ cd petsc RUN \ source /opt/intel/oneapi/mkl/latest/env/vars.sh intel64 && \ source ${MPIdir}/mpilibs.sh && \ cd petsc && \ ./configure \ --prefix=${petsc_rep_dest} \ --with-mpi-compilers=1 --with-mpi-dir=${MPIdir} \ --download-ml=yes \ --download-mumps=yes \ --download-superlu=yes \ --with-cxx-dialect=C++14 \ --with-make-np=12 \ --with-shared-libraries=1 \ --with-debugging=1 \ --with-memalign=64 \ --with-visibility=0 \ --with-openmp=1 \ --with-64-bit-indices=0 \ --download-hpddm=yes \ --download-slepc=yes \ --download-superlu_dist=yes \ --download-parmetis=yes \ --download-ptscotch=yes \ --download-metis=yes \ --download-strumpack=yes \ --download-suitesparse=yes \ --download-hypre=yes \ --with-blaslapack-dir="$MKLROOT/lib/intel64" \ --with-mkl_pardiso-dir="$MKLROOT" \ --with-mkl_cpardiso-dir="$MKLROOT" \ --with-scalapack=1 \ --with-scalapack-include="$MKLROOT/include" \ --with-scalapack-lib="-L$MKLROOT/lib/intel64 -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64" \ && \ export PETSC_ARCH_VAR=$(tail -20 configure.log |grep "PETSC_ARCH:"|awk '{print $2}') && \ export PETSC_DIR_VAR=$(tail -20 configure.log |grep "PETSC_DIR:"|awk '{print $2}') && \ make PETSC_DIR="$PETSC_DIR_VAR" PETSC_ARCH="$PETSC_ARCH_VAR" all && \ make PETSC_DIR="$PETSC_DIR_VAR" PETSC_ARCH="$PETSC_ARCH_VAR" install && \ touch "${petsc_rep_dest}/hpclibs.sh" && \ echo -e "source $MKLROOT/env/vars.sh intel64\n\ source ${MPIdir}/mpilibs.sh\n\ export PETSC_DIR=${petsc_rep_dest}\n\ export PETSC_ARCH=\"\"\n\ export LD_LIBRARY_PATH=\${PETSC_DIR}/lib:\${LD_LIBRARY_PATH}\n\ export PATH=\${PETSC_DIR}/bin:\${MPIdir}/\${MPIbindir}:\${PATH}\n" >> "${petsc_rep_dest}/hpclibs.sh" ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \ OMPI_ALLOW_RUN_AS_ROOT=1 RUN source ${petsc_rep_dest}/hpclibs.sh \ && \ cd /petsc \ && \ export PETSC_ARCH_VAR=$(tail -20 configure.log |grep "PETSC_ARCH:"|awk '{print $2}') \ && \ export PETSC_DIR_VAR=$(tail -20 configure.log |grep "PETSC_DIR:"|awk '{print $2}') \ && \ make PETSC_DIR="$PETSC_DIR_VAR" PETSC_ARCH="$PETSC_ARCH_VAR" test |& tee make_test.log # Exécuter une commande au démarrage de l'image. #CMD ["cd /petsc; echo "You can source ${petsc_rep_dest}/hpclibs.sh to use PETSc"]