Skip to content

Instantly share code, notes, and snippets.

@kparrish
Last active July 5, 2019 16:13
Show Gist options
  • Save kparrish/6440812 to your computer and use it in GitHub Desktop.
Save kparrish/6440812 to your computer and use it in GitHub Desktop.
A bash script to install spglib on a Debian (Ubuntu) machine. To install run the script: sudo bash spglib_install.sh
#!/bin/bash
### spglib Ubuntu install
# Assign user name
read -p "Enter your user name: " UserName
### MAIN ###
# Install required packages
apt-get update
apt-get -y upgrade
cd ~/Downloads
# Check/remove spglib-1.5.2.tar.gz
if [ -f ~/Downloads/spglib-1.5.2.tar.gz ]
then
rm ~/Downloads/spglib-1.5.2.tar.gz
fi
# Download spglib-1.5.2.tar.gz
sudo -u $UserName wget http://downloads.sourceforge.net/project/spglib/spglib/spglib-1.5/spglib-1.5.2.tar.gz
# Extract spglib-1.5.2.tar.gz
sudo -u $UserName tar xzf ~/Downloads/spglib-1.5.2.tar.gz
# Compile and Install
cd spglib-1.5.2
sudo -u $UserName ./configure
sudo -u $UserName make
cd ~
# Move files
mkdir /usr/local/include/spglib
cp ~/Downloads/spglib-1.5.2/src/.libs/libsymspg.a /usr/local/lib
cp ~/Downloads/spglib-1.5.2/src/*.h /usr/local/include/spglib
# Cleanup
rm -r ~/Downloads/spglib-1.5.2 ~/Downloads/spglib-1.5.2.tar.gz
echo "spglib Install Complete"
@tyst3273
Copy link

tyst3273 commented Jul 5, 2019

It worked :) thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment