Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. diff --git a/src/trunk/swig/python/mkpy b/src/trunk/swig/python/mkpy
  2. index b566697..994cc51 100755
  3. --- a/src/trunk/swig/python/mkpy
  4. +++ b/src/trunk/swig/python/mkpy
  5. @@ -10,8 +10,9 @@ if [ -x /cygdrive/c/MinGW/msys/1.0/bin/bash ]; then
  6. exec /cygdrive/c/MinGW/msys/1.0/bin/bash $0 $optx $*
  7. fi
  8.  
  9. -INC="-I. -Ispams/linalg -Ispams/prox -Ispams/decomp -Ispams/dictLearn -I/usr/include/python3.5m/"
  10. -INC_PYTHON=-I/usr/include/python3.5m
  11. +PY_INC=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")
  12. +INC="-I. -Ispams/linalg -Ispams/prox -Ispams/decomp -Ispams/dictLearn -I${PY_INC}"
  13. +INC_PYTHON=-I${PY_INC}
  14. XCCFLAGS=""
  15. XLINKFLAGS=""
  16. # on MacOS, use following definition instead.
  17. @@ -22,7 +23,7 @@ OPTWIN=""
  18. EXTL=so
  19. CCFLAGS="-fPIC"
  20. OMPFLAGS="-fopenmp"
  21. -if [ -d /System/Library/Frameworks ]; then
  22. +if [ -d /System/Library/Frameworks ]; then
  23. # MacOs
  24. macos=1
  25. INC_PYTHON="-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include"
  26. @@ -30,7 +31,7 @@ if [ -d /System/Library/Frameworks ]; then
  27. XLINKFLAGS="-m32 -framework Python"
  28. fi
  29. case `uname` in
  30. - CYGWIN*|MINGW*)
  31. + CYGWIN*|MINGW*)
  32. OPTWIN=-mwindows
  33. EXTL=pyd
  34. flg_swig=0
  35. @@ -40,7 +41,7 @@ case `uname` in
  36. DBLAS='-LC:/Program Files/R/R-2.15.1/bin/i386'
  37. BLAS='-lRblas -lRlapack'
  38. if [ -d C:\Python27 ]; then
  39. - CCFLAGS="-DWIN32 -fopenmp"
  40. + CCFLAGS="-DWIN32 -fopenmp"
  41. INC_PYTHON="-IC:\Python27\include -IC:\Python27\Lib\site-packages\numpy\core\include"
  42. LIBS=" -LC:\Python27\libs -lpython27"
  43. fi
  44. @@ -83,7 +84,7 @@ if [ $debug -eq 0 ]; then
  45. OPT_DBG=""
  46. else
  47. OPT_DBG=-DDEBUG
  48. -fi
  49. +fi
  50.  
  51. err=0
  52. for nom in $lst; do
  53. @@ -105,5 +106,5 @@ for nom in $lst; do
  54. # /bin/rm -f $nom.o ${nom}_wrap.o
  55. done
  56. [ $err -ne 0 ] && die "ERROR"
  57. -
  58. +
  59. exit 0
  60. diff --git a/src/trunk/swig/python/setup.py.in b/src/trunk/swig/python/setup.py.in
  61. index 9ed3818..883ce66 100644
  62. --- a/src/trunk/swig/python/setup.py.in
  63. +++ b/src/trunk/swig/python/setup.py.in
  64. @@ -1,13 +1,14 @@
  65. import os
  66. #os.environ['DISTUTILS_DEBUG'] = "1"
  67. from distutils.core import setup, Extension
  68. +from distutils.sysconfig import get_python_inc
  69. import distutils.util
  70. import numpy
  71.  
  72. # includes numpy : package numpy.distutils , numpy.get_include()
  73. # python setup.py build --inplace
  74. -# python setup.py install --prefix=dist,
  75. -incs = ['.'] + [os.path.join('spams',x) for x in [ 'linalg', 'prox', 'decomp', 'dictLearn']] + [numpy.get_include()] + ['/usr/include/python3.5m/']
  76. +# python setup.py install --prefix=dist,
  77. +incs = ['.'] + [os.path.join('spams',x) for x in [ 'linalg', 'prox', 'decomp', 'dictLearn']] + [numpy.get_include()] + [get_python_inc()]
  78.  
  79. osname = distutils.util.get_platform()
  80. cc_flags = ['-fPIC', '-fopenmp']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement