Skip to content

Commit f9f07f3

Browse files
authored
Merge pull request #51 from SwayamInSync/sleef-3.9
Conda-forge happy build changes & switching to released sleef-3.9
2 parents 0872a58 + b6956ed commit f9f07f3

4 files changed

Lines changed: 16 additions & 20 deletions

File tree

‎meson.build‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@ endif
1616
qblas_dep = dependency('qblas', fallback: ['qblas', 'qblas_dep'])
1717

1818
# Try to find SLEEF system-wide first, fall back to subproject if not found
19-
sleef_dep = dependency('sleef', fallback: ['sleef', 'sleef_dep'], required: false)
19+
# Required SLEEF version (must match sleef.wrap revision)
20+
required_sleef_version = '3.9.0'
21+
sleef_dep = dependency('sleef', version: '>=' + required_sleef_version, fallback: ['sleef', 'sleef_dep'], required: false)
2022

2123
use_system_sleef = false
2224
fallback_reason = ''
2325

24-
if sleef_dep.found() and sleef_dep.type_name() != 'internal'
26+
if sleef_dep.found() and sleef_dep.type_name() != 'internal' and sleef_dep.version().startswith(required_sleef_version)
2527
# SLEEF found system-wide - verify quad-precision support
2628
cpp = meson.get_compiler('cpp')
2729
sleefquad_lib = cpp.find_library('sleefquad', required: false)
28-
tlfloat_lib = cpp.find_library('tlfloat', required: false)
2930

30-
if sleefquad_lib.found() and tlfloat_lib.found()
31+
if sleefquad_lib.found()
3132
sleefquad_test_code = '''
3233
#include <sleefquad.h>
3334
@@ -41,26 +42,27 @@ if sleef_dep.found() and sleef_dep.type_name() != 'internal'
4142
# this should compile and link
4243
quad_works = cpp.links(
4344
sleefquad_test_code,
44-
dependencies: [sleef_dep, sleefquad_lib, tlfloat_lib],
45+
dependencies: [sleef_dep, sleefquad_lib],
4546
name: 'SLEEF quad-precision support'
4647
)
4748

4849
if quad_works
4950
sleefquad_dep = declare_dependency(
5051
dependencies: [sleef_dep, sleefquad_lib]
5152
)
52-
tlfloat_dep = declare_dependency(
53-
dependencies: [tlfloat_lib]
54-
)
5553
use_system_sleef = true
5654
else
5755
fallback_reason = 'System-wide SLEEF installation found but a test for quad precision support failed.'
5856
endif
5957
else
60-
fallback_reason = 'System-wide SLEEF installation does not have a sleefquad library.'
58+
fallback_reason = 'System-wide SLEEF installation does not have the sleefquad library.'
6159
endif
6260
else
63-
fallback_reason = 'Cannot find system-wide SLEEF installation.'
61+
if sleef_dep.found() and sleef_dep.type_name() != 'internal'
62+
fallback_reason = 'System SLEEF version @0@ does not match required version @1@'.format(sleef_dep.version(), required_sleef_version)
63+
else
64+
fallback_reason = 'Cannot find system-wide SLEEF installation.'
65+
endif
6466
endif
6567

6668
if use_system_sleef
@@ -69,7 +71,6 @@ else
6971
sleef_subproj = subproject('sleef')
7072
sleef_dep = sleef_subproj.get_variable('sleef_dep')
7173
sleefquad_dep = sleef_subproj.get_variable('sleefquad_dep')
72-
tlfloat_dep = sleef_subproj.get_variable('tlfloat_dep')
7374
warning(fallback_reason)
7475
message('Proceeding with vendored SLEEF subproject instead')
7576
endif
@@ -93,7 +94,7 @@ message('Using NumPy version: @0@'.format(numpy_version))
9394
npymath_path = incdir_numpy / '..' / 'lib'
9495
npymath_lib = c.find_library('npymath', dirs: npymath_path)
9596

96-
dependencies = [py_dep, qblas_dep, sleef_dep, sleefquad_dep, tlfloat_dep, npymath_lib]
97+
dependencies = [py_dep, qblas_dep, sleef_dep, sleefquad_dep, npymath_lib]
9798

9899
# Add OpenMP dependency (optional, for threading)
99100
openmp_dep = dependency('openmp', required: false, static: false)

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ classifiers = [
2828
]
2929
requires-python = ">=3.11.0"
3030
dependencies = [
31-
"numpy>=2.0"
31+
"numpy>=2.4"
3232
]
3333

3434
[project.optional-dependencies]

‎subprojects/packagefiles/sleef/meson.build‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ sleef_configure = run_command([
3232
'-DSLEEF_BUILD_SHARED_LIBS=OFF',
3333
'-DSLEEF_BUILD_TESTS=OFF',
3434
'-DSLEEF_BUILD_INLINE_HEADERS=OFF',
35+
'-DSLEEF_ENABLE_TLFLOAT=OFF', # this is only used for testing in SLEEF, not runtime
3536
'-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
3637
'-DCMAKE_INSTALL_PREFIX=' + meson.current_build_dir() / sleef_install_dir
3738
] + sleef_simd_flags, check: false, capture: true)
@@ -72,10 +73,4 @@ sleefquad_dep = declare_dependency(
7273
dependencies: [sleef_build_dep, sleef_dep],
7374
compile_args: compile_args_list,
7475
link_args: ['-L' + meson.current_build_dir() / sleef_install_dir / 'lib', '-L' + meson.current_build_dir() / sleef_install_dir / 'lib64', '-lsleefquad']
75-
)
76-
77-
tlfloat_dep = declare_dependency(
78-
dependencies: [sleef_build_dep],
79-
compile_args: compile_args_list,
80-
link_args: ['-L' + meson.current_build_dir() / sleef_install_dir / 'lib', '-L' + meson.current_build_dir() / sleef_install_dir / 'lib64', '-ltlfloat']
8176
)

‎subprojects/sleef.wrap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[wrap-git]
22
directory=sleef
33
url=https://github.com/shibatch/sleef.git
4-
revision=43a0252ba9331adc7fb10755021f802863678c38
4+
revision=3.9.0
55
patch_directory=sleef
66

77
[provide]

0 commit comments

Comments
 (0)