Skip to content

Commit

Permalink
Added commands to github workflow to ensure that metatensor is instal…
Browse files Browse the repository at this point in the history
…led so that we can run tests with this code
  • Loading branch information
Gareth Aneurin Tribello authored and Gareth Aneurin Tribello committed Apr 26, 2024
1 parent 8bdabcc commit 0481a1d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/linuxWF.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,24 @@ jobs:
echo "CPATH=$PWD/libtorch/include/torch/csrc/api/include/:$PWD/libtorch/include/:$PWD/libtorch/include/torch:$CPATH" >> $GITHUB_ENV
echo "INCLUDE=$PWD/libtorch/include/torch/csrc/api/include/:$PWD/libtorch/include/:$PWD/libtorch/include/torch:$INCLUDE" >> $GITHUB_ENV
echo "PLUMED_CONFIG=$PLUMED_CONFIG --enable-libtorch" >> $GITHUB_ENV
- name: Install metatensor
if: ${{ ! contains( matrix.variant, '-debug-' ) }} # metatensor is not compiled with GLIBCXX_DEBUG
run: |
pip install "metatensor-torch ==0.4.0"
pip install metatensor-operations metatensor-learn
echo "TORCH_CMAKE_PREFIX=$(python -c \"import torch; print(torch.utils.cmake_prefix_path)\")" >> $GITHUB_ENV
echo "TORCH_PREFIX=$(cd \"$TORCH_CMAKE_PREFIX/../..\" && pwd)" >> $GITHUB_ENV
echo "METATENSOR_CMAKE_PREFIX=$(python -c \"import metatensor; print(metatensor.utils.cmake_prefix_path)\")" >> $GITHUB_ENV
echo "METATENSOR_PREFIX=$(cd \"$METATENSOR_CMAKE_PREFIX/../..\" && pwd)" >> $GITHUB_ENV
echo "METATENSOR_TORCH_CMAKE_PREFIX=$(python -c \"import metatensor.torch; print(metatensor.torch.utils.cmake_prefix_path)\")" >> $GITHUB_ENV
echo "METATENSOR_TORCH_PREFIX=$(cd \"$METATENSOR_TORCH_CMAKE_PREFIX/../..\" && pwd)" >> $GITHUB_ENV
echo "TORCH_CPPFLAGS=\"-D_GLIBCXX_USE_CXX11_ABI=0\"" >> $GITHUB_ENV
echo "TORCH_INCLUDES=\"-I$TORCH_PREFIX/include -I$TORCH_PREFIX/include/torch/csrc/api/include\"" >> $GITHUB_ENV
echo "CPPFLAGS=\"$TORCH_INCLUDES $TORCH_CPPFLAGS -I$METATENSOR_PREFIX/include -I$METATENSOR_TORCH_PREFIX/include $CPPFLAGS\"" >> $GITHUB_ENV
echo "LDFLAGS=\"-L$TORCH_PREFIX/lib -L$METATENSOR_PREFIX/lib -L$METATENSOR_TORCH_PREFIX/lib $LDFLAGS\"" >> $GITHUB_ENV
echo "LDFLAGS=\"$LDFLAGS -Wl,-rpath,$TORCH_PREFIX/lib\"" >> $GITHUB_ENV
echo "LDFLAGS=\"$LDFLAGS -Wl,-rpath,$METATENSOR_PREFIX/lib -Wl,-rpath,$METATENSOR_TORCH_PREFIX/lib\"" >> $GITHUB_ENV
echo "PLUMED_CONFIG=$PLUMED_CONFIG --enable-libtorch --enable-metatensor" >> $GITHUB_ENV
- name: Install Doxygen
if: contains( matrix.variant, '-doc-' )
run: |
Expand Down

0 comments on commit 0481a1d

Please sign in to comment.