Skip to content

Commit 534699a

Browse files
authored
Merge pull request #197 from bluescarni/pr/remove_rtld_global
Attempt to remove the RTLD_GLOBAL hack
2 parents 78648f1 + 8dd1d2c commit 534699a

7 files changed

+13
-43
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if(NOT CMAKE_BUILD_TYPE)
1111
FORCE)
1212
endif()
1313

14-
project(heyoka.py VERSION 6.0.0 LANGUAGES CXX C)
14+
project(heyoka.py VERSION 6.1.0 LANGUAGES CXX C)
1515

1616
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/yacma")
1717

@@ -118,7 +118,7 @@ find_package(fmt REQUIRED CONFIG)
118118
message(STATUS "fmt version: ${fmt_VERSION}")
119119

120120
# heyoka.
121-
find_package(heyoka 6.0.0 REQUIRED CONFIG)
121+
find_package(heyoka 6.1.0 REQUIRED CONFIG)
122122

123123
# Python.
124124

doc/changelog.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Changelog
44
=========
55

6-
6.0.1 (unreleased)
6+
6.1.0 (unreleased)
77
------------------
88

99
Fix

doc/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Dependencies
99
heyoka.py has several Python and C++ dependencies. On the C++ side, heyoka.py depends on:
1010

1111
* the `heyoka C++ library <https://github.com/bluescarni/heyoka>`__,
12-
version 6.0.x (**mandatory**),
12+
version 6.1.x (**mandatory**),
1313
* the `Boost <https://www.boost.org/>`__ C++ libraries (**mandatory**),
1414
* the `{fmt} <https://fmt.dev/latest/index.html>`__ library (**mandatory**),
1515
* the `TBB <https://github.com/oneapi-src/oneTBB>`__ library (**mandatory**),

heyoka/__init__.py

+2-36
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,11 @@
99
# Version setup.
1010
from ._version import __version__
1111

12-
import os as _os
1312
import cloudpickle as _cloudpickle
1413
from threading import Lock as _Lock
1514

16-
if _os.name == "posix":
17-
# NOTE: on some platforms Python by default opens extensions
18-
# with the RTLD_LOCAL flag, which creates problems because
19-
# public symbols used by heyoka (e.g., sleef functions, quad
20-
# precision math) are then not found by the LLVM jit machinery.
21-
# Thus, before importing core, we temporarily flip on the
22-
# RTLD_GLOBAL flag, which makes the symbols visible and
23-
# solves these issues. Another possible approach suggested
24-
# in the llvm discord is to manually and explicitly add
25-
# libheyoka.so to the DL search path:
26-
# DynamicLibrarySearchGenerator::Load(“/path/to/libheyoka.so”)
27-
# See:
28-
# https://docs.python.org/3/library/ctypes.html
29-
import ctypes as _ctypes
30-
import sys as _sys
31-
32-
_orig_dlopen_flags = _sys.getdlopenflags()
33-
_sys.setdlopenflags(_orig_dlopen_flags | _ctypes.RTLD_GLOBAL)
34-
35-
try:
36-
# We import the sub-modules into the root namespace.
37-
from .core import *
38-
finally:
39-
# Restore the original dlopen flags whatever
40-
# happens.
41-
_sys.setdlopenflags(_orig_dlopen_flags)
42-
43-
del _ctypes
44-
del _sys
45-
del _orig_dlopen_flags
46-
else:
47-
# We import the sub-modules into the root namespace.
48-
from .core import *
49-
50-
del _os
15+
# We import the sub-modules into the root namespace.
16+
from .core import *
5117

5218
# Explicitly import the submodules
5319
# NOTE: it is *important* that the import is performed

tools/gha_manylinux.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ else
4444
fi
4545

4646
# The heyoka version to be used for releases.
47-
export HEYOKA_VERSION_RELEASE="6.0.0"
47+
export HEYOKA_VERSION_RELEASE="6.1.0"
4848

4949
# Check if this is a release build.
5050
if [[ "${GITHUB_REF}" == "refs/tags/v"* ]]; then

tools/gha_osx_heyoka_head.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge
1111
export deps_dir=$HOME/local
1212
export PATH="$HOME/miniconda/bin:$PATH"
1313
bash miniconda.sh -b -p $HOME/miniconda
14-
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.*'
14+
conda create -y -p $deps_dir python=3.11 c-compiler cxx-compiler git pybind11 'numpy<2' \
15+
cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef fmt skyfield \
16+
spdlog sympy cloudpickle 'mppp=1.*' 'clang<19' 'clangxx<19'
1517
source activate $deps_dir
1618

1719
# Checkout, build and install heyoka's HEAD.

tools/gha_osx_heyoka_head_static.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge
1111
export deps_dir=$HOME/local
1212
export PATH="$HOME/miniconda/bin:$PATH"
1313
bash miniconda.sh -b -p $HOME/miniconda
14-
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
14+
conda create -y -p $deps_dir python=3.11 c-compiler cxx-compiler git pybind11 'numpy<2' \
15+
cmake llvmdev tbb-devel tbb astroquery libboost-devel sleef fmt skyfield \
16+
spdlog sympy cloudpickle 'mppp=1.*' numba 'clang<19' 'clangxx<19'
1517
source activate $deps_dir
1618

1719
# Checkout, build and install heyoka's HEAD.

0 commit comments

Comments
 (0)