puneet

python numpy support

Dec 13th, 2011
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. if test "$_python_static" != no || test "$_python_modular" != no
  2. then
  3. echocheck "Python numpy support"
  4. if $PYTHON -c "import sys; import numpy" >/dev/null 2>&1
  5. then
  6. if [ `$PYTHON -c 'import numpy; print numpy.__version__' | cut -c 1` -gt 0 ]
  7. then
  8. echores "`$PYTHON -c 'import numpy; print numpy.__version__'`"
  9. else
  10. echores "`$PYTHON -c 'import numpy; print numpy.__version__'`... too old version 1.0 or later required"
  11. if test "$_python" = yes
  12. then
  13. die "python numpy outdated"
  14. fi
  15. _python="no"
  16. fi
  17. else
  18. echores "no"
  19. if test "$_python" = yes || test "$_python_static" = yes \
  20. || test "$_python_modular" = yes
  21. then
  22. die "python numpy package missing"
  23. fi
  24. _python="no"
  25. fi
  26.  
  27. if test "$_python" != no
  28. then
  29. PRE_LIB_SWIG_PYTHON_MODULAR=_
  30. EXT_IF_SWIG_PYTHON_MODULAR='.py'
  31. test -n "$_pyinclude" && _pyinclude="-I$_pyinclude"
  32. test -n "$_pyinclude" || _pyinclude=`$PYTHON -c "from distutils.sysconfig import get_python_inc; import numpy; print '-I%s -I%s' % (get_python_inc(), numpy.get_include())"`
  33. _pylibpath=`$PYTHON -c 'from distutils.sysconfig import get_config_vars; print "-L%(LIBPL)s" % get_config_vars()'`
  34. EXT_LIB_SWIG_PYTHON_MODULAR=`$PYTHON -c 'from distutils.sysconfig import get_config_vars; print "%(SO)s" % get_config_vars()'`
  35. test -n "$_pylibs" || _pylibs=`$PYTHON -c "import sys; print 'python'+sys.version[0:3]"`${EXT_LIB_SWIG_PYTHON_MODULAR%.*}
  36. INCLUDES_PYTHON="$_pyinclude $INCLUDES_PYTHON"
  37. COMPFLAGS_CPP_PYTHON="-fno-strict-aliasing -fPIC $COMPFLAGS_CPP_PYTHON"
  38. COMPFLAGS_C_PYTHON="-fno-strict-aliasing -fPIC $COMPFLAGS_C_PYTHON"
  39.  
  40. if darwin
  41. then
  42. LINKFLAGS_PYTHON="$_pylibpath -l$_pylibs -ldl -bundle -Wl,-flat_namespace $LINKFLAGS_PYTHON"
  43. POSTLINKFLAGS_PYTHON="$_pylibpath -l$_pylibs -ldl -bundle -Wl,-flat_namespace $POSTLINKFLAGS_PYTHON"
  44. else
  45. LINKFLAGS_PYTHON="-shared $_pylibpath -l$_pylibs $LINKFLAGS_PYTHON"
  46. POSTLINKFLAGS_PYTHON="-shared $_pylibpath -l$_pylibs $POSTLINKFLAGS_PYTHON"
  47. fi
  48.  
  49. PYTHON_TARGET="sg$EXT_LIB_SWIG_PYTHON_MODULAR"
  50.  
  51.  
Advertisement
Add Comment
Please, Sign In to add comment