-
Notifications
You must be signed in to change notification settings - Fork 5
/
build_spglib
executable file
·39 lines (31 loc) · 949 Bytes
/
build_spglib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 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