diff --git a/cmake_build_python_bindings.sh b/cmake_build_python_bindings.sh new file mode 100755 index 0000000..8ee84c4 --- /dev/null +++ b/cmake_build_python_bindings.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +#module load gcc/13.2.0 +#module load cmake/3.21.4 +#module load fftw3/3.3.8 +#module list + +# Add the PETSc pkg-config path to the pkg-config search path +export PKG_CONFIG_PATH=$PETSC_DIR/lib/pkgconfig:$PKG_CONFIG_PATH + +# pkg-config for PETSc seems non-standard on gadi so add the ompi/compiler specific library directory that contains the library file libpetsc.so +export PETSC_LIBRARY_DIR=$PETSC_DIR/lib/ompi3/GNU + +# BUILD_DIR is a temporary directory for building (compiling and linking) +export BUILD_DIR=$PWD/build-gnu +# INSTALL_DIR is the directory for installing the build package +export INSTALL_DIR=$PWD/install-gnu + +mkdir $BUILD_DIR +cd $BUILD_DIR + +cmake -Wno-dev -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_BUILD_TYPE=Release -DWITH_MPI=OFF -DWITH_NETCDF=OFF -DWITH_GDAL=OFF -DWITH_PETSC=OFF -DCMAKE_PREFIX_PATH=$FFTW_ROOT .. +cmake --build . --target python-bindings +cmake --install . --prefix python/gatdaem1d diff --git a/python/setup.py b/python/setup.py index 8f92a78..93d2208 100644 --- a/python/setup.py +++ b/python/setup.py @@ -4,6 +4,7 @@ # March 10 2017 # Updated: Ross C Brodie, March 20 2017 # Updated: Ross C Brodie, March 21 2024 to Version 2.0 +# Updated: Leon Foks, June 5 2024. Added .dylib import sys import os from os.path import join @@ -22,7 +23,7 @@ setup(name='gatdaem1d', packages=['gatdaem1d'], package_dir={'gatdaem1d':'gatdaem1d'}, - package_data={'gatdaem1d':['gatdaem1d.so', 'gatdaem1d.dll']}, + package_data={'gatdaem1d':['gatdaem1d.so', 'gatdaem1d.dll', 'gatdaem1d.dylib']}, scripts=[], version='2.0.1', description='Time-domain airborne electromagnetic forward modelling.',