Skip to content

Commit 8ef7657

Browse files
committed
cleanup boost imports
1 parent 711a416 commit 8ef7657

1 file changed

Lines changed: 1 addition & 26 deletions

File tree

setup.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import glob
1010
import os
1111
import sys
12-
from ctypes.util import find_library
1312
from pathlib import Path
1413

1514
import numpy
@@ -33,30 +32,6 @@ def get_nanobind_config():
3332
nanobind_macros = [("NB_COMPACT_ASSERTIONS", None)]
3433

3534

36-
def get_boost_libraries():
37-
major, minor = sys.version_info[:2]
38-
candidates = [
39-
f"boost_python{major}{minor}",
40-
f"boost_python{major}",
41-
"boost_python",
42-
]
43-
44-
conda_prefix = os.environ.get("CONDA_PREFIX")
45-
if conda_prefix:
46-
libdir = os.path.join(conda_prefix, "lib")
47-
for name in candidates:
48-
so = f"lib{name}.so"
49-
if os.path.isfile(os.path.join(libdir, so)):
50-
return [name]
51-
52-
# fallback to ldconfig
53-
for name in candidates:
54-
found = find_library(name)
55-
if found:
56-
return [name]
57-
raise RuntimeError("Cannot find a suitable Boost.Python library.")
58-
59-
6035
def get_boost_config():
6136
boost_path = os.environ.get("BOOST_PATH", "")
6237
if boost_path:
@@ -121,7 +96,7 @@ def get_objcryst_libraries():
12196
objcryst_libs = get_objcryst_libraries()
12297

12398
ext_kws = {
124-
"libraries": ["diffpy"] + get_boost_libraries() + objcryst_libs,
99+
"libraries": ["diffpy"] + objcryst_libs,
125100
"extra_compile_args": compile_args,
126101
"extra_link_args": extra_link_args,
127102
"include_dirs": [numpy.get_include()] + boost_cfg["include_dirs"],

0 commit comments

Comments
 (0)