# Simple build script for Spglib. Please # consult README.md for additional details. # Please also supply an install prefix as the first argument, # otherwise it will install in the default directories. if [ $# -eq 0 ] then echo "No arguments supplied. Please supply the PREFIX as an argument." exit fi EXECUTE_DIRECTORY=`dirname $0` # remove old stuff rm -rf /tmp/spglib # build spglib per specs in README.md cd /tmp git clone https://github.com/atztogo/spglib.git cd spglib mkdir _build && cd _build cmake -DCMAKE_INSTALL_PREFIX="" .. make make DESTDIR=$1 install # build tetrahedron_method (separated since spglib 1.7.4) # change to you specs CC=gcc CFLAGS="-O2 -fPIC" cd /tmp/spglib/src $CC $CFLAGS -c kgrid.c tetrahedron_method.c # make simple library that can be included in setup.py $CC -shared -o libtetrahedron.so tetrahedron_method.o mv libtetrahedron.so $1/lib/. cp tetrahedron_method.h $1/include/. cd $EXECUTE_DIRECTORY