Skip to content

Commit 7ebaa7c

Browse files
committed
python 2.7 compatiblity
1 parent 9ad8de9 commit 7ebaa7c

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

conda-recipe/build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
#!/bin/bash
22

3-
DAAL4PY_VERSION=$PKG_VERSION CNCROOT=${PREFIX} TBBROOT=${PREFIX} DAALROOT=${PREFIX} ${PYTHON} setup.py install
3+
if [ -n "$PY_VER" ] && [ "${PY_VER:0:1}" -lt "3" ]; then
4+
ARG="--old-and-unmanageable"
5+
else
6+
ARG=""
7+
fi
8+
DAAL4PY_VERSION=$PKG_VERSION CNCROOT=${PREFIX} TBBROOT=${PREFIX} DAALROOT=${PREFIX} ${PYTHON} setup.py install $ARG

setup.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,19 @@
6565

6666
if 'linux' in sys.platform:
6767
IS_LIN = True
68-
lib_dir = jp('lib', 'intel64_lin')
68+
lib_dir = jp(daal_root, 'lib', 'intel64_lin')
6969
elif sys.platform == 'darwin':
7070
IS_MAC = True
71-
lib_dir = 'lib'
71+
lib_dir = jp(daal_root, 'lib')
7272
elif sys.platform in ['win32', 'cygwin']:
7373
IS_WIN = True
74-
lib_dir = jp('lib', 'intel64_win')
74+
lib_dir = jp(daal_root, 'lib', 'intel64_win')
7575
else:
7676
assert False, sys.platform + ' not supported'
7777

78+
if not IS_MAC:
79+
daal_lib_dir = lib_dir if os.path.isdir(lib_dir) else os.path.dirname(lib_dir)
80+
7881
DAAL_DEFAULT_TYPE = 'double'
7982

8083
def get_sdl_cflags():
@@ -125,7 +128,7 @@ def getpyexts():
125128

126129
if IS_MAC:
127130
ela.append('-stdlib=libc++')
128-
ela.append("-Wl,-rpath,{}".format(jp(daal_root, lib_dir)))
131+
ela.append("-Wl,-rpath,{}".format(daal_lib_dir))
129132
for x in DIST_LIBDIRS:
130133
ela.append("-Wl,-rpath,{}".format(x))
131134
ela.append("-Wl,-rpath,{}".format(jp(daal_root, '..', 'tbb', 'lib')))
@@ -141,7 +144,7 @@ def getpyexts():
141144
extra_compile_args=eca,
142145
extra_link_args=ela,
143146
libraries=libraries_plat,
144-
library_dirs=[jp(daal_root, lib_dir)] + DIST_LIBDIRS,
147+
library_dirs=[daal_lib_dir] + DIST_LIBDIRS,
145148
language='c++')])
146149

147150
cfg_vars = get_config_vars()

0 commit comments

Comments
 (0)