From 22a06231b432fdc7628348f56792be44f2016051 Mon Sep 17 00:00:00 2001 From: Noam Bernstein Date: Tue, 17 Oct 2023 10:13:57 -0400 Subject: [PATCH] In CI install MACE develop branch from github, and also update mkl installation to currently supported version --- .github/workflows/pytests.yml | 41 ++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml index 1624e3ea..8429d461 100644 --- a/.github/workflows/pytests.yml +++ b/.github/workflows/pytests.yml @@ -44,17 +44,32 @@ jobs: - name: Install latest ASE from gitlab run: pip install git+https://gitlab.com/ase/ase.git - - name: Install intel-mkl-full for phono3py - run: | - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB - sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list' - sudo apt-get update - sudo apt-get install intel-mkl-64bit-2018.2-046 + - name: Install intel-oneapi-mkl for phono3py + run: | + # based on + # https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-download.html?operatingsystem=linux&distributions=aptpackagemanager + # download the key to system keyring + wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + # add signed entry to apt sources and configure the APT client to use Intel repository: + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo apt update + sudo apt install intel-oneapi-mkl + sudo apt install intel-oneapi-mkl-devel - name: Install phono3py from source run: | - source /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/bin/mklvars.sh intel64 + # find mklvars + for pkg in $( apt list --installed | fgrep "installed" | fgrep "mkl" | sed "s#/.*##" ); do + if dpkg -L $pkg | egrep -q 'vars.sh$'; then + mklvars=$( dpkg -L $pkg | egrep 'vars.sh$' ) + break + fi + done + if [ -z $mklvars ]; then + echo 'Failed to find *vars.sh in any pkg named *mkl*' + exit 1 + fi + source $mklvars intel64 git clone https://github.com/phonopy/phonopy cd phonopy @@ -71,6 +86,16 @@ jobs: - name: Install Quippy from PyPI run: pip install quippy-ase + - name: MACE + run: | + echo "search for torch version" + torch_version=$( pip3 install torch== 2>&1 | fgrep 'from versions' | sed -e 's/.* //' -e 's/)//' ) + echo "found torch version $torch_version, installing cpu-only variant" + python3 -m pip install torch==${torch_version}+cpu -f https://download.pytorch.org/whl/torch_stable.html + echo "installing mace" + python3 -m pip install git+https://github.com/ACEsuit/mace.git@develop + python3 -c "import mace; print(mace.__file__)" + - name: Julia and ace fit run: | pip install pip install threadpoolctl