From 0f5cf1a3c2d42dc37e85b8b3e39ee4e6eba9dcfd Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Wed, 9 Oct 2024 20:34:44 +0200 Subject: [PATCH 1/4] Attempt to remove the RTLD_GLOBAL hack. --- heyoka/__init__.py | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/heyoka/__init__.py b/heyoka/__init__.py index 5356e193..06cc588b 100644 --- a/heyoka/__init__.py +++ b/heyoka/__init__.py @@ -9,45 +9,11 @@ # Version setup. from ._version import __version__ -import os as _os import cloudpickle as _cloudpickle from threading import Lock as _Lock -if _os.name == "posix": - # NOTE: on some platforms Python by default opens extensions - # with the RTLD_LOCAL flag, which creates problems because - # public symbols used by heyoka (e.g., sleef functions, quad - # precision math) are then not found by the LLVM jit machinery. - # Thus, before importing core, we temporarily flip on the - # RTLD_GLOBAL flag, which makes the symbols visible and - # solves these issues. Another possible approach suggested - # in the llvm discord is to manually and explicitly add - # libheyoka.so to the DL search path: - # DynamicLibrarySearchGenerator::Load(“/path/to/libheyoka.so”) - # See: - # https://docs.python.org/3/library/ctypes.html - import ctypes as _ctypes - import sys as _sys - - _orig_dlopen_flags = _sys.getdlopenflags() - _sys.setdlopenflags(_orig_dlopen_flags | _ctypes.RTLD_GLOBAL) - - try: - # We import the sub-modules into the root namespace. - from .core import * - finally: - # Restore the original dlopen flags whatever - # happens. - _sys.setdlopenflags(_orig_dlopen_flags) - - del _ctypes - del _sys - del _orig_dlopen_flags -else: - # We import the sub-modules into the root namespace. - from .core import * - -del _os +# We import the sub-modules into the root namespace. +from .core import * # Explicitly import the submodules # NOTE: it is *important* that the import is performed From 5a28b8bb732ba8f0a25ae31200aaa50b1ac90e82 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Wed, 9 Oct 2024 20:37:02 +0200 Subject: [PATCH 2/4] Bump to 6.1.0. --- CMakeLists.txt | 4 ++-- doc/install.rst | 2 +- tools/gha_manylinux.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4411167..a45a768d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ if(NOT CMAKE_BUILD_TYPE) FORCE) endif() -project(heyoka.py VERSION 6.0.0 LANGUAGES CXX C) +project(heyoka.py VERSION 6.1.0 LANGUAGES CXX C) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/yacma") @@ -118,7 +118,7 @@ find_package(fmt REQUIRED CONFIG) message(STATUS "fmt version: ${fmt_VERSION}") # heyoka. -find_package(heyoka 6.0.0 REQUIRED CONFIG) +find_package(heyoka 6.1.0 REQUIRED CONFIG) # Python. diff --git a/doc/install.rst b/doc/install.rst index eb37ae35..0c764e60 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -9,7 +9,7 @@ Dependencies heyoka.py has several Python and C++ dependencies. On the C++ side, heyoka.py depends on: * the `heyoka C++ library `__, - version 6.0.x (**mandatory**), + version 6.1.x (**mandatory**), * the `Boost `__ C++ libraries (**mandatory**), * the `{fmt} `__ library (**mandatory**), * the `TBB `__ library (**mandatory**), diff --git a/tools/gha_manylinux.sh b/tools/gha_manylinux.sh index 1b720fb6..91e9a59a 100644 --- a/tools/gha_manylinux.sh +++ b/tools/gha_manylinux.sh @@ -44,7 +44,7 @@ else fi # The heyoka version to be used for releases. -export HEYOKA_VERSION_RELEASE="6.0.0" +export HEYOKA_VERSION_RELEASE="6.1.0" # Check if this is a release build. if [[ "${GITHUB_REF}" == "refs/tags/v"* ]]; then From 29f43ac3d7e2115aeb4edf50dff35b86076c7a4a Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Wed, 9 Oct 2024 20:37:34 +0200 Subject: [PATCH 3/4] Update changelog. --- doc/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.rst b/doc/changelog.rst index 4ff6965f..6ec87c48 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -3,7 +3,7 @@ Changelog ========= -6.0.1 (unreleased) +6.1.0 (unreleased) ------------------ Fix From 8dd1d2c1c6cdd22340eaa91e55a7b0806a21efc2 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Wed, 9 Oct 2024 21:32:57 +0200 Subject: [PATCH 4/4] Temporarily pin compilers on OSX CI. --- tools/gha_osx_heyoka_head.sh | 4 +++- tools/gha_osx_heyoka_head_static.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/gha_osx_heyoka_head.sh b/tools/gha_osx_heyoka_head.sh index c84171dd..09a65dc2 100644 --- a/tools/gha_osx_heyoka_head.sh +++ b/tools/gha_osx_heyoka_head.sh @@ -11,7 +11,9 @@ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge export deps_dir=$HOME/local export PATH="$HOME/miniconda/bin:$PATH" bash miniconda.sh -b -p $HOME/miniconda -conda create -y -p $deps_dir python=3.11 c-compiler cxx-compiler git pybind11 'numpy<2' cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef fmt skyfield spdlog sympy cloudpickle 'mppp=1.*' +conda create -y -p $deps_dir python=3.11 c-compiler cxx-compiler git pybind11 'numpy<2' \ + cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef fmt skyfield \ + spdlog sympy cloudpickle 'mppp=1.*' 'clang<19' 'clangxx<19' source activate $deps_dir # Checkout, build and install heyoka's HEAD. diff --git a/tools/gha_osx_heyoka_head_static.sh b/tools/gha_osx_heyoka_head_static.sh index df0e29c2..d4771df4 100644 --- a/tools/gha_osx_heyoka_head_static.sh +++ b/tools/gha_osx_heyoka_head_static.sh @@ -11,7 +11,9 @@ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge export deps_dir=$HOME/local export PATH="$HOME/miniconda/bin:$PATH" bash miniconda.sh -b -p $HOME/miniconda -conda create -y -p $deps_dir python=3.11 c-compiler cxx-compiler git pybind11 'numpy<2' cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef fmt skyfield spdlog sympy cloudpickle 'mppp=1.*' numba +conda create -y -p $deps_dir python=3.11 c-compiler cxx-compiler git pybind11 'numpy<2' \ + cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef fmt skyfield \ + spdlog sympy cloudpickle 'mppp=1.*' numba 'clang<19' 'clangxx<19' source activate $deps_dir # Checkout, build and install heyoka's HEAD.