summarylogtreecommitdiffstats
path: root/python_no_libs.patch
blob: fbd584c8544edd834ec7b20acbe5b3d4568e7908 (plain)
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
diff -ur a/python-package/setup.py b/python-package/setup.py
--- a/python-package/setup.py	2016-02-14 19:00:06.781604229 +0300
+++ b/python-package/setup.py	2016-02-14 19:17:42.078239558 +0300
@@ -5,19 +5,9 @@
 import os
 from setuptools import setup, find_packages
 #import subprocess
-sys.path.insert(0, '.')
 
 CURRENT_DIR = os.path.dirname(__file__)
 
-# We can not import `xgboost.libpath` in setup.py directly since xgboost/__init__.py
-# import `xgboost.core` and finally will import `numpy` and `scipy` which are setup
-# `install_requires`. That's why we're using `exec` here.
-libpath_py = os.path.join(CURRENT_DIR, 'xgboost/libpath.py')
-libpath = {'__file__': libpath_py}
-exec(compile(open(libpath_py, "rb").read(), libpath_py, 'exec'), libpath, libpath)
-
-LIB_PATH = libpath['find_lib_path']()
-print("Install libxgboost from: %s" % LIB_PATH)
 #Please use setup_pip.py for generating and deploying pip installation
 #detailed instruction in setup_pip.py
 setup(name='xgboost',
@@ -35,5 +25,4 @@
       #this will use MANIFEST.in during install where we specify additional files,
       #this is the golden line
       include_package_data=True,
-      data_files=[('xgboost', LIB_PATH)],
       url='https://github.com/dmlc/xgboost')
diff -ur a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py
--- a/python-package/xgboost/libpath.py	2016-02-14 15:42:15.705290125 +0300
+++ b/python-package/xgboost/libpath.py	2016-02-14 19:18:32.578238059 +0300
@@ -20,7 +20,8 @@
     """
     curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
     # make pythonpack hack: copy this directory one level upper for setup.py
-    dll_path = [curr_path, os.path.join(curr_path, '../../lib/'),
+    dll_path = ["/usr/lib", curr_path,
+                os.path.join(curr_path, '../../lib/'),
                 os.path.join(curr_path, './lib/')]
     if os.name == 'nt':
         if platform.architecture()[0] == '64bit':