132 lines
3.7 KiB
Modula-2
132 lines
3.7 KiB
Modula-2
|
BootStrap: docker
|
||
|
From: ubuntu:22.04
|
||
|
|
||
|
%labels
|
||
|
Author scemama@irsamc.ups-tlse.fr
|
||
|
|
||
|
%help
|
||
|
Container for running CHAMP.
|
||
|
|
||
|
%environment
|
||
|
export LANG="C"
|
||
|
export LANGUAGE=$LANG
|
||
|
export LC_ALL=$LANG
|
||
|
|
||
|
%files
|
||
|
champ.def /opt/install/champ.def
|
||
|
../lib/install_champ.sh /opt/install/install_champ.sh
|
||
|
../lib/install_qmckl.sh /opt/install/install_qmckl.sh
|
||
|
../lib/install_trexio.sh /opt/install/install_trexio.sh
|
||
|
../lib/install_trexio_python.sh /opt/install/install_trexio_python.sh
|
||
|
../lib/install_oneapi.sh /opt/install/install_oneapi.sh
|
||
|
|
||
|
%setup
|
||
|
# mkdir -p ${APPTAINER_ROOTFS}/opt/install
|
||
|
# cp champ.def ${APPTAINER_ROOTFS}/opt/install/champ.def
|
||
|
|
||
|
%post
|
||
|
cd /opt/install
|
||
|
./setup_image.sh
|
||
|
./install_oneapi.sh
|
||
|
|
||
|
# Install dependencies
|
||
|
# --------------------
|
||
|
|
||
|
apt install -y cmake python3 python3-pip git \
|
||
|
make m4 mlocate autotools-dev pkg-config \
|
||
|
libhdf5-dev \
|
||
|
bash vim emacs-nox
|
||
|
|
||
|
ln -s /usr/bin/python3 /usr/bin/python
|
||
|
|
||
|
|
||
|
# Install TREXIO
|
||
|
# --------------
|
||
|
|
||
|
cd /opt
|
||
|
|
||
|
wget https://github.com/TREX-CoE/trexio/releases/download/v2.4.2/trexio-2.4.2.tar.gz
|
||
|
tar -zxvf trexio-2.4.2.tar.gz
|
||
|
cd trexio-2.4.2
|
||
|
./configure --prefix=/usr
|
||
|
make -j 8
|
||
|
make -j 8 check
|
||
|
make install
|
||
|
cd ..
|
||
|
rm -rf trexio-2.4.2 trexio-2.4.2.tar.gz
|
||
|
pip install trexio
|
||
|
|
||
|
|
||
|
# Install QMCkl
|
||
|
# -------------
|
||
|
|
||
|
cflags="-Ofast -g -qmkl=sequential -ftz -fma -march=core-avx2"
|
||
|
fcflags="-Ofast -g -qmkl=sequential -ftz -fma -march=core-avx2 -ip"
|
||
|
|
||
|
wget https://github.com/TREX-CoE/qmckl/releases/download/v1.0.0/qmckl-1.0.0.tar.gz
|
||
|
tar -zxvf qmckl-1.0.0.tar.gz
|
||
|
cd qmckl-1.0.0
|
||
|
|
||
|
mkdir _build_sequential
|
||
|
cd _build_sequential
|
||
|
../configure --prefix=/usr --disable-python --disable-doc --enable-hpc --without-openmp \
|
||
|
CFLAGS="$cflags" FCFLAGS="$fcflags"
|
||
|
make -j 8
|
||
|
make -j 8 check
|
||
|
|
||
|
# make install
|
||
|
/usr/bin/install -c src/.libs/libqmckl.so.0.0.0 /usr/lib/libqmckl-sequential.so.0.0.0
|
||
|
(cd /usr/lib \
|
||
|
&& { ln -s -f libqmckl-sequential.so.0.0.0 libqmckl-sequential.so.0 \
|
||
|
|| { rm -f libqmckl-sequential.so.0 \
|
||
|
&& ln -s libqmckl-sequential.so.0.0.0 libqmckl-sequential.so.0; }; })
|
||
|
(cd /usr/lib \
|
||
|
&& { ln -s -f libqmckl-sequential.so.0.0.0 libqmckl-sequential.so \
|
||
|
|| { rm -f libqmckl-sequential.so \
|
||
|
&& ln -s libqmckl-sequential.so.0.0.0 libqmckl-sequential.so; }; })
|
||
|
/usr/bin/install -c src/.libs/libqmckl.lai /usr/lib/libqmckl-sequential.la
|
||
|
sed -i "s/libqmckl/libqmckl-sequential/g" /usr/lib/libqmckl-sequential.la
|
||
|
/usr/bin/install -c src/.libs/libqmckl.a /usr/lib/libqmckl-sequential.a
|
||
|
chmod 644 /usr/lib/libqmckl-sequential.a
|
||
|
ranlib /usr/lib/libqmckl-sequential.a
|
||
|
|
||
|
cd ..
|
||
|
|
||
|
mkdir _build_parallel
|
||
|
cd _build_parallel
|
||
|
../configure --prefix=/usr --disable-python --disable-doc --enable-hpc --with-openmp \
|
||
|
CFLAGS="$cflags" FCFLAGS="$fcflags"
|
||
|
make -j 8
|
||
|
make -j 8 check
|
||
|
make install
|
||
|
cd ..
|
||
|
|
||
|
cd ..
|
||
|
rm -rf qmckl-1.0.0 qmckl-1.0.0.tar.gz
|
||
|
|
||
|
# CHAMP
|
||
|
# -----
|
||
|
|
||
|
git clone --depth=1 https://github.com/filippi-claudia/champ.git
|
||
|
cd champ
|
||
|
cmake -S. -Bbuild \
|
||
|
-DCMAKE_Fortran_COMPILER="mpiifort" \
|
||
|
-DENABLE_TREXIO=ON \
|
||
|
-DENABLE_QMCKL=ON
|
||
|
|
||
|
cmake --build build -j 8
|
||
|
|
||
|
|
||
|
# Clean up
|
||
|
# --------
|
||
|
|
||
|
rm -rf compile-* docs tests build lib
|
||
|
apt remove -y intel-oneapi-compiler-dpcpp-cpp \
|
||
|
intel-oneapi-compiler-fortran \
|
||
|
intel-oneapi-mpi-devel \
|
||
|
wget git gcc gfortran
|
||
|
|
||
|
apt autoremove -y
|
||
|
apt purge -y --auto-remove
|
||
|
rm -rf /var/lib/apt/lists/*
|