add script to install libxc
This commit is contained in:
parent
36cfd96016
commit
03d1eb4514
1 changed files with 33 additions and 0 deletions
33
install_libxc.sh
Normal file
33
install_libxc.sh
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [[ -z "$CONDA_PREFIX" ]]; then
|
||||
echo "You do not seem to have an active conda environment active, aborting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get and unzip archive
|
||||
LIBXC_VERSION=6.1.0
|
||||
wget "https://github.com/ElectronicStructureLibrary/libxc/archive/refs/tags/$LIBXC_VERSION.zip"
|
||||
unzip "$LIBXC_VERSION.zip"
|
||||
rm "$LIBXC_VERSION.zip"
|
||||
cd "libxc-$LIBXC_VERSION"
|
||||
|
||||
# Compile
|
||||
cmake -H. -Bobjdir -DENABLE_PYTHON=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX"
|
||||
cd objdir && make
|
||||
|
||||
# Test
|
||||
make test
|
||||
|
||||
# Install
|
||||
make install
|
||||
|
||||
# Link the python library
|
||||
PYTHON_VERSION=$(python --version | sed -e 's/.* \([0-9]\.[0-9]\{2\}\).*/\1/')
|
||||
echo "Detected python v$PYTHON_VERSION"
|
||||
echo "Creating symlink to pylibxc library (python bindings for libxc)"
|
||||
ln -v -s "$CONDA_PREFIX/lib64/pylibxc" "$CONDA_PREFIX/lib/python$PYTHON_VERSION/site-packages"
|
||||
|
||||
echo 'Install successful'
|
Loading…
Reference in a new issue