Skip to content

Commit 6fb2df3

Browse files
committed
fixing macos sleef not found
1 parent d475bee commit 6fb2df3

File tree

2 files changed

+13
-27
lines changed

2 files changed

+13
-27
lines changed

quaddtype/meson.build

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,17 @@ c = meson.get_compiler('c')
88
# Get the conda prefix
99
conda_prefix = run_command('bash', '-c', 'echo $CONDA_PREFIX', check: true).stdout().strip()
1010

11-
message('Conda prefix: ' + conda_prefix)
12-
13-
# Add conda lib and include directories
11+
# Add conda lib directory to library path
1412
add_project_link_arguments('-L' + conda_prefix + '/lib', language: ['c', 'cpp'])
15-
add_project_arguments('-I' + conda_prefix + '/include', language: ['c', 'cpp'])
13+
add_project_link_arguments('-I' + conda_prefix + '/include', language: ['c', 'cpp'])
1614

17-
# Try to find SLEEF using pkg-config first
18-
sleef_dep = dependency('sleef', required: false)
15+
sleef_dep = c.find_library('sleef', dirs: [conda_prefix + '/lib'])
16+
sleefquad_dep = c.find_library('sleefquad', dirs: [conda_prefix + '/lib'])
1917

20-
if not sleef_dep.found()
21-
# If pkg-config fails, try to find the library manually
22-
sleef_dep = c.find_library('sleef', dirs: [conda_prefix + '/lib'])
23-
sleefquad_dep = c.find_library('sleefquad', dirs: [conda_prefix + '/lib'])
24-
25-
if not sleef_dep.found() or not sleefquad_dep.found()
26-
error('SLEEF library not found. Please ensure it is installed in your conda environment\nconda install sleef.')
27-
endif
28-
else
29-
sleefquad_dep = sleef_dep
18+
if not sleef_dep.found() or not sleefquad_dep.found()
19+
error('SLEEF library not found. Please ensure it is installed in your conda environment\nconda install sleef.')
3020
endif
3121

32-
message('SLEEF library found: ' + sleef_dep.found().to_string())
33-
3422
incdir_numpy = run_command(py,
3523
[
3624
'-c',
@@ -43,7 +31,6 @@ includes = include_directories(
4331
[
4432
incdir_numpy,
4533
'quaddtype/src',
46-
conda_prefix + '/include',
4734
]
4835
)
4936

@@ -71,11 +58,10 @@ py.install_sources(
7158
)
7259

7360
py.extension_module('_quaddtype_main',
74-
srcs,
75-
c_args: ['-g', '-O0'],
76-
link_args: ['-lsleef', '-lsleefquad'],
77-
dependencies: [sleef_dep, sleefquad_dep],
78-
install: true,
79-
subdir: 'quaddtype',
80-
include_directories: includes
61+
srcs,
62+
c_args: ['-g', '-O0', '-lsleef', '-lsleefquad'],
63+
dependencies: [sleef_dep, sleefquad_dep],
64+
install: true,
65+
subdir: 'quaddtype',
66+
include_directories: includes
8167
)

quaddtype/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ EOF
9393
export PKG_CONFIG_PATH="$HOME/minoconda/lib/pkgconfig:$PKG_CONFIG_PATH"
9494
pkg-config --libs --cflags sleef
9595
"""
96-
environment = {DYLD_LIBRARY_PATH = "$HOME/miniconda/lib:$DYLD_LIBRARY_PATH", LIBRARY_PATH = "$HOME/miniconda/lib:$LIBRARY_PATH", CFLAGS = "-I$HOME/miniconda/include $CFLAGS", CXXFLAGS = "-I$HOME/miniconda/include $CXXFLAGS", LDFLAGS = "-L$HOME/miniconda/lib $LDFLAGS", PKG_CONFIG_PATH = "$HOME/miniconda/lib/pkgconfig:$PKG_CONFIG_PATH", CONDA_PREFIX = "$HOME/miniconda"}
96+
environment = {DYLD_LIBRARY_PATH = "$HOME/miniconda/lib:$DYLD_LIBRARY_PATH", LIBRARY_PATH = "$HOME/miniconda/lib:$LIBRARY_PATH", CFLAGS = "-I$HOME/miniconda/include $CFLAGS", CXXFLAGS = "-I$HOME/miniconda/include $CXXFLAGS", LDFLAGS = "-L$HOME/miniconda/lib $LDFLAGS", PKG_CONFIG_PATH = "$HOME/miniconda/lib/pkgconfig:$PKG_CONFIG_PATH"}
9797
repair-wheel-command = "delocate-wheel -w {dest_dir} -v {wheel}"
9898

9999
# [tool.cibuildwheel.windows]

0 commit comments

Comments
 (0)