2022-05-03 15:09:49 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -x
|
|
|
|
set -e
|
|
|
|
|
2022-05-03 15:14:12 +02:00
|
|
|
# swig pre-processing
|
2022-05-04 16:41:16 +02:00
|
|
|
./build_qmckl.sh
|
2022-05-03 15:09:49 +02:00
|
|
|
|
|
|
|
cd src/
|
|
|
|
|
|
|
|
# compile the wrapper code
|
2022-05-04 15:06:37 +02:00
|
|
|
cc -c -fPIC `pkg-config --cflags qmckl` -I/usr/include/python3.8 qmckl_wrap.c -o qmckl_wrap.o
|
2022-05-03 15:09:49 +02:00
|
|
|
|
|
|
|
# link against the previously installed QMCkl library (as detected by pkg-config)
|
2022-05-04 16:41:16 +02:00
|
|
|
cc -shared qmckl_wrap.o `pkg-config --libs qmckl` -o _qmckl.so
|
2022-05-03 15:09:49 +02:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
2022-05-03 15:14:12 +02:00
|
|
|
# copy the produced files into the test dir
|
2022-05-04 15:06:37 +02:00
|
|
|
cp src/_qmckl.so src/qmckl.py test/
|
2022-05-03 15:09:49 +02:00
|
|
|
|
2022-05-03 15:14:12 +02:00
|
|
|
# run tests
|
2022-05-03 15:09:49 +02:00
|
|
|
cd test/
|
|
|
|
python test_api.py
|
|
|
|
cd ..
|