diff --git a/Champ/champ.def b/Champ/champ.def index f3278ba..92cc449 100644 --- a/Champ/champ.def +++ b/Champ/champ.def @@ -11,6 +11,7 @@ From: ubuntu:22.04 export LANG="C" export LANGUAGE=$LANG export LC_ALL=$LANG + export OMP_NUM_THREADS=1 %files champ.def /opt/install/champ.def @@ -28,104 +29,14 @@ From: ubuntu:22.04 cd /opt/install ./setup_image.sh ./install_oneapi.sh + ./install_trexio.sh + ./install_trexio_python.sh + ./install_qmckl.sh + ./install_champ.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 + ./cleanup_oneapi.sh apt autoremove -y apt purge -y --auto-remove rm -rf /var/lib/apt/lists/* + diff --git a/lib/cleanup_oneapi.sh b/lib/cleanup_oneapi.sh new file mode 100755 index 0000000..1c73302 --- /dev/null +++ b/lib/cleanup_oneapi.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +apt remove -y \ + intel-oneapi-compiler-dpcpp-cpp \ + intel-oneapi-compiler-fortran \ + intel-oneapi-mpi-devel \ + gcc gfortran + diff --git a/lib/install_champ.sh b/lib/install_champ.sh index b995291..7a30ae8 100755 --- a/lib/install_champ.sh +++ b/lib/install_champ.sh @@ -1,16 +1,14 @@ #!/bin/bash -source environment.sh cd /opt +source environment.sh + +ln -s /usr/bin/python3 /usr/bin/python # Install dependencies # -------------------- -apt install -y cmake python3 git \ - make m4 mlocate autotools-dev pkg-config \ - vim emacs-nox - -ln -s /usr/bin/python3 /usr/bin/python +apt install -y cmake python3 git make git clone --depth=1 https://github.com/filippi-claudia/champ.git @@ -22,16 +20,6 @@ cmake -S. -Bbuild \ 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/* +apt remove -y cmake git make diff --git a/lib/install_oneapi.sh b/lib/install_oneapi.sh index 2532527..3e6b7cd 100755 --- a/lib/install_oneapi.sh +++ b/lib/install_oneapi.sh @@ -1,7 +1,7 @@ #!/bin/bash -source environment.sh cd /opt +source environment.sh apt install -y wget pgpgpg @@ -29,3 +29,5 @@ ln -s /opt/intel/oneapi/compiler/latest/bin/ifort.cfg /opt/ifort.cfg ln -s /opt/intel/oneapi/compiler/latest/bin/icx.cfg /opt/icx.cfg echo "-diag-disable=10448" > /opt/ifort.cfg + +apt remove -y wget pgpgpg diff --git a/lib/install_qmckl.sh b/lib/install_qmckl.sh index d54e1a1..764363d 100755 --- a/lib/install_qmckl.sh +++ b/lib/install_qmckl.sh @@ -1,7 +1,7 @@ #!/bin/bash -source environment.sh cd /opt +source environment.sh apt install -y wget make pkg-config @@ -62,3 +62,4 @@ cd .. cd .. rm -rf qmckl-1.0.0 qmckl-1.0.0.tar.gz +apt remove -y wget make pkg-config gcc gfortran diff --git a/lib/install_trexio.sh b/lib/install_trexio.sh index d9cd5fd..1d40f14 100755 --- a/lib/install_trexio.sh +++ b/lib/install_trexio.sh @@ -1,7 +1,7 @@ #!/bin/bash -source environment.sh cd /opt +source environment.sh apt install -y wget libhdf5-dev make [ -z $CC ] && apt install -y gcc @@ -19,3 +19,4 @@ cd .. rm -rf trexio-2.4.2 trexio-2.4.2.tar.gz +apt remove -y wget gcc gfortran diff --git a/lib/install_trexio_python.sh b/lib/install_trexio_python.sh index 79d971d..daf2feb 100755 --- a/lib/install_trexio_python.sh +++ b/lib/install_trexio_python.sh @@ -1,7 +1,7 @@ #!/bin/bash -source environment.sh cd /opt +source environment.sh apt install -y python3 python3-pip git pip install trexio @@ -10,3 +10,4 @@ git clone --depth=1 https://github.com/TREX-CoE/trexio_tools.git cd trexio_tools pip install . +apt remove -y git python3-pip