Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Made changes to build process in an attempt to incorporate SHTOOLS in…
Browse files Browse the repository at this point in the history
…to the build
  • Loading branch information
daminton committed Jan 29, 2024
1 parent 8bb2aa0 commit 59d6d2f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
16 changes: 3 additions & 13 deletions buildscripts/build_shtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ ARGS=$@
. ${SCRIPT_DIR}/_build_getopts.sh ${ARGS}
. ${SCRIPT_DIR}/set_compilers.sh

SHTOOLS_VER="4.10.4"

printf "*********************************************************\n"
printf "* FETCHING SHTOOLS SOURCE *\n"
printf "*********************************************************\n"
printf "Copying files to ${DEPENDENCY_DIR}\n"
mkdir -p ${DEPENDENCY_DIR}
if [ ! -d ${DEPENDENCY_DIR}/SHTOOLS-${SHTOOLS_VER} ]; then
[ -d ${DEPENDENCY_DIR}/SHTOOLS-* ] && rm -rf ${DEPENDENCY_DIR}/SHTOOLS-*
curl -L https://github.com/SHTOOLS/SHTOOLS/releases/download/v${SHTOOLS_VER}/SHTOOLS-${SHTOOLS_VER}.tar.gz | tar xvz -C ${DEPENDENCY_DIR}
fi

printf "*********************************************************\n"
printf "* BUILDING SHTOOLS LIBRARY *\n"
printf "*********************************************************\n"
Expand All @@ -38,13 +26,15 @@ printf "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}\n"
printf "LDFLAGS: ${LDFLAGS}\n"
printf "*********************************************************\n"

cd ${DEPENDENCY_DIR}/SHTOOLS-*
cd SHTOOLS
make F95="${FC}" CXX="${CXX}" fortran
make F95="${FC}" CXX="${CXX}" fortran-mp
if [ -w ${PREFIX} ]; then
make PREFIX="${PREFIX}" install
else
sudo make PREFIX="${PREFIX}" install
fi
cd ..

if [ $? -ne 0 ]; then
printf "SHTOOLS could not be compiled.\n"
Expand Down
13 changes: 11 additions & 2 deletions buildscripts/install_editable_debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ SCRIPT_DIR=$(realpath $(dirname $0))
ROOT_DIR=$(realpath ${SCRIPT_DIR}/..)
VENV_DIR=${ROOT_DIR}/venv
cd ${ROOT_DIR}
python3 -m venv ${VENV_DIR}
. ${VENV_DIR}/bin/activate

# Create the virtual environment if it doesn't exist
if [ ! -d "${VENV_DIR}" ]; then
python3 -m venv ${VENV_DIR}
fi

# Activate the virtual environment only if it's not already active
if [ -z "${VIRTUAL_ENV}" ]; then
. ${VENV_DIR}/bin/activate
fi

python3 -m pip install --upgrade pip
pip install scikit-build-core pyproject-metadata pathspec ninja cython cmake ffmpeg-python
pip install --config-settings=editable.rebuild=true \
Expand Down
13 changes: 8 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers=[
]
keywords=['astronomy','astrophysics', 'planetary', 'n-body', 'integrator', 'symplectic', 'wisdom-holman', 'symba']
dependencies = [
'numpy>=1.24.3',
'numpy>=1.26.3',
'scipy>=1.10.1',
'xarray>=2023.1',
'dask>=2023.5',
Expand All @@ -36,9 +36,11 @@ dependencies = [
'matplotlib>=3.7',
'astropy>=5.2',
'astroquery>=0.4.6',
'tqdm>=4.64.1',
'cython>=3.0.0',
'pyshtools==4.10.4'
'tqdm>=4.64',
'cython>=3.0',
'meson>=1.3',
'meson-python>=0.15',
'pyshtools==4.11.10'
]

[project.urls]
Expand All @@ -61,6 +63,7 @@ requires = [
"sphinxext-rediraffe",
"sphinxext-opengraph",
"nbsphinx",
'meson-python>=0.15',
"ford"
]
build-backend = "scikit_build_core.build"
Expand Down Expand Up @@ -112,7 +115,7 @@ netCDF-Fortran_DIR="${PREFIX}/lib/cmake/netCDF"

[tool.cibuildwheel.macos]
before-all = [
"brew install coreutils",
"brew install coreutils pkg-config fftw vecLibFort",
"LIBS=\"\" buildscripts/build_dependencies.sh -p ${PREFIX} -d ${HOME}/Downloads -m ${MACOSX_DEPLOYMENT_TARGET}"
]

Expand Down

0 comments on commit 59d6d2f

Please sign in to comment.