2022-05-02 16:14:18 +02:00
|
|
|
#!/bin/bash
|
2022-05-02 13:39:22 +02:00
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2022-05-03 15:09:49 +02:00
|
|
|
cp ../include/qmckl.h src/
|
2022-05-02 17:52:11 +02:00
|
|
|
|
2022-05-03 13:34:38 +02:00
|
|
|
cd src/
|
|
|
|
|
2022-05-02 16:14:18 +02:00
|
|
|
# check if qmckl header exists
|
|
|
|
if [[ ! -f 'qmckl.h' ]]; then
|
|
|
|
echo "qmckl.h NOT FOUND"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# process the qmckl header file to get patterns for SWIG
|
2022-05-03 13:34:38 +02:00
|
|
|
python process_header.py
|
2022-05-02 16:14:18 +02:00
|
|
|
|
|
|
|
# check if SWIG files exist
|
|
|
|
SWIG_LIST='pyqmckl.i pyqmckl_include.i numpy.i'
|
|
|
|
for file in $SWIG_LIST; do
|
|
|
|
if [[ ! -f $file ]]; then
|
|
|
|
echo "$file NOT FOUND"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# run SWIG interface file to produce the Python wrappers
|
2022-05-04 15:07:41 +02:00
|
|
|
# `-threads` to release GIL before the call to C functions (for multi-threading)
|
|
|
|
# `-builtin` to activate Python-ic built-in types
|
|
|
|
swig -python -py3 -builtin -o qmckl_wrap.c pyqmckl.i
|
2022-05-02 13:39:22 +02:00
|
|
|
|
2022-05-03 13:34:38 +02:00
|
|
|
cd ..
|