Skip to content

Commit

Permalink
CHG: macOS now only provides python3 and not python, and header files…
Browse files Browse the repository at this point in the history
… are now in the Headers directory
  • Loading branch information
MathieuMorlighem committed Jun 22, 2024
1 parent 1ea61ca commit bf9c1e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ configure
configure.sh
libtool
stamp-h1
m4
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
src/Makefile
src/c/Makefile
src/c/issm
Expand Down
10 changes: 9 additions & 1 deletion m4/issm_options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,13 @@ AC_DEFUN([ISSM_OPTIONS],[
dnl Query Python for its version number. Getting [:3] seems to be
dnl the best way to do this: it's what "site.py" does in the
dnl standard library.
PYTHON_VERSION=$(${PYTHON_ROOT}/bin/python -c "import sys; print(sys.version[[:3]])")
if test -f "${PYTHON_ROOT}/bin/python"; then
PYTHON_VERSION=$(${PYTHON_ROOT}/bin/python -c "import sys; print(sys.version[[:3]])")
elif test -f "${PYTHON_ROOT}/bin/python3"; then
PYTHON_VERSION=$(${PYTHON_ROOT}/bin/python3 -c "import sys; print(sys.version[[:3]])")
else
AC_MSG_ERROR([Python version could not be determined automatically, please provide option --with-python-version]);
fi
AC_MSG_RESULT([${PYTHON_VERSION}])
else
AC_MSG_RESULT([enforced Python version is ${PYTHON_VERSION}])
Expand All @@ -794,6 +800,8 @@ AC_DEFUN([ISSM_OPTIONS],[
PYTHONINCL=-I${PYTHON_ROOT}/include/python${PYTHON_VERSION}
elif test -f "${PYTHON_ROOT}/include/python${PYTHON_VERSION}m/Python.h"; then
PYTHONINCL=-I${PYTHON_ROOT}/include/python${PYTHON_VERSION}m
elif test -f "${PYTHON_ROOT}/Headers/Python.h"; then
PYTHONINCL=-I${PYTHON_ROOT}/include/python${PYTHON_VERSION}m
else
AC_MSG_ERROR([Python.h not found! Please locate this file and contact ISSM developers via forum or email.]);
fi
Expand Down

0 comments on commit bf9c1e1

Please sign in to comment.