1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
Description: Patch for boost numpy support in Debian
Need to find appropriate boost_python library.
Be careful not to overmatch; eg. there may be multiple such as:
libboost_numpy38.so, libboost_numpy39.so
Author: Alastair McKinstry <mckinstry@debian.org>
Last-Updated: 2020-12-10
Forwarded: no
Index: python-escript-5.6/site_scons/dependencies.py
===================================================================
--- python-escript-5.6.orig/site_scons/dependencies.py
+++ python-escript-5.6/site_scons/dependencies.py
@@ -95,7 +95,7 @@ def get_external_python_sympy(env,bin):
tmp2 = ver[1]
if tmp2 == '.':
tmp2 = ver[2]
-
+
if int(tmp1) == 0 and int(tmp2) < 7:
env['sympy'] = False
env['warnings'].append("sympy version is too old.")
@@ -303,57 +303,16 @@ def checkBoost(env):
if boostversion >= 106300 and env['disable_boost_numpy'] is False:
try:
boost_numpy_inc_path,boost_numpy_lib_path=findLibWithHeader(env, env['boost_libs'], 'boost/python/numpy.hpp', env['boost_prefix'], lang='c++')
-
# Locate the boost numpy files
+ import sys
if env['IS_WINDOWS']:
- raise Exception # TODO: fix boost numpy dll ex/import compile errors
- import sys
for l in os.listdir(env['boost_prefix'] + '\\lib'):
if l.startswith('boost_numpy{}{}'.format(sys.version_info.major,sys.version_info.minor)):
libname = os.path.splitext(l)[0]
else:
- p = subprocess.Popen(["ld","--verbose"], stdout=subprocess.PIPE)
- out,err = p.communicate()
- spath = [x[13:-3] for x in out.split() if b'SEARCH_DIR' in x]
- spath.append(boost_lib_path)
- p2name = ''
- p3name = ''
- for name in spath:
- try:
- l=os.listdir(name)
-
- import sys
- if sys.version_info[0] == 3:
- string_type = str
- else:
- string_type = basestring
-
- p2res = ''
- p3res = ''
- for x in l:
- if isinstance(x,string_type):
- if x.startswith('libboost_numpy-py') and x.endswith('.so'):
- p2res = x
- if x.startswith('libboost_numpy-py3') and x.endswith('.so'):
- p3res = x
- else:
- if x.startswith(b'libboost_numpy-py') and x.endswith(b'.so'):
- p2res = x
- if x.startswith(b'libboost_numpy-py3') and x.endswith(b'.so'):
- p3res = x
-
- if len(p2name)==0 and len(p2res)>0:
- p2name=p2res[-1]
- if len(p3name)==0 and len(p3res)>0:
- p3name=p3res[-1]
- except OSError:
- pass
-
- # Pick the right one
- if int(env['python_version'][0]) == 2:
- libname = p2name[3:-3]
- else:
- libname = p3name[3:-3]
+ for l in os.listdir(env['boost_prefix'][1]):
+ if l == f'libboost_numpy{sys.version_info.major}{sys.version_info.minor}.so':
+ libname = l
# If found, add the necessary information to env
if len(libname) > 0:
|