Build fails when cross-compiling
Attempting to cross-compile ligo.skymap on macOS x86_64 for macOS arm64 results in a build failure attempting to detect openmp:
File "setup.py", line 126, in <module>
ext_modules=get_extensions())
File "setup.py", line 55, in get_extensions
add_openmp_flags_if_available(extension)
File "/Users/duncanmacleod/opt/mambaforge/conda-bld/ligo.skymap_1643881988664/_build_env/venv/lib/python3.10/site-packages/extension_helpers/_openmp_helpers.py", line 245, in add_openmp_flags_if_available
using_openmp = check_openmp_support(openmp_flags=openmp_flags)
File "/Users/duncanmacleod/opt/mambaforge/conda-bld/ligo.skymap_1643881988664/_build_env/venv/lib/python3.10/site-packages/extension_helpers/_openmp_helpers.py", line 198, in check_openmp_support
output = subprocess.check_output('./test_openmp')
File "/Users/duncanmacleod/opt/mambaforge/conda-bld/ligo.skymap_1643881988664/_build_env/lib/python3.10/subprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/Users/duncanmacleod/opt/mambaforge/conda-bld/ligo.skymap_1643881988664/_build_env/lib/python3.10/subprocess.py", line 501, in run
with Popen(*popenargs, **kwargs) as process:
File "/Users/duncanmacleod/opt/mambaforge/conda-bld/ligo.skymap_1643881988664/_build_env/lib/python3.10/subprocess.py", line 966, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Users/duncanmacleod/opt/mambaforge/conda-bld/ligo.skymap_1643881988664/_build_env/lib/python3.10/subprocess.py", line 1842, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 86] Bad CPU type in executable: './test_openmp'
error: subprocess-exited-with-error
This stems from extension-helpers
, for which github redirects me to astropy-helpers
, whose README states:
Note: astropy-helpers is deprecated. As justified and described in APE17, the astropy-helpers infrastructure is no longer used for Astropy coordinated or infrastructure packages, and hence has limited-to-no maintainience from 2021 onwards.
So, maybe it's time to stop using that tool and detect openmp in a different way that supports cross-compiling.