maya2105 - windows8 - numpy/scipy

To compile numpy, create a site.cfg file in numpy's source directory with 
the following or similar content:

[mkl]

include_dirs = C:/Program Files (x86)/Intel/Composer XE/mkl/include

library_dirs = C:/Program Files (x86)/Intel/Composer 
XE/mkl/lib/intel64;C:/Program Files (x86)/Intel/Composer 
XE/compiler/lib/intel64

mkl_libs = 
mkl_lapack95_lp64,mkl_blas95_lp64,mkl_intel_lp64,mkl_intel_thread,mkl_core,libiomp5md,libifportmd

lapack_libs = 
mkl_lapack95_lp64,mkl_blas95_lp64,mkl_intel_lp64,mkl_intel_thread,mkl_core,libiomp5md,libifportmd

Also patch .\numpy-1.9.1\numpy\core\setup.py

   #mathlibs_choices = [[], ['m'], ['cpml']] #BEFORE

   mathlibs_choices = [[], ['cpml']] #AFTER


On a command prompt in the numpy (and then scipy) source directory, 
initialize Visual Studio and Intel compilers and then build numpy/scipy, 
e.g.:


# numpy (assuming exists in c:\numpy_scipy_build\numpy-1.9.1)

# from a new admin cmd prompt

# run the following


cd c:\numpy_scipy_build\numpy-1.9.1

rd /S /Q build

"C:\Program Files (x86)\Intel\Composer XE\bin\iclvars.bat" intel64 vs2010

"C:\Program Files (x86)\Intel\Composer XE\bin\ifortvars.bat" intel64 vs2010

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" amd64

set DISTUTILS_USE_SDK=1

set INCLUDE=%INCLUDE%;"C:\Program 
Files\Autodesk\Maya2015\include\python2.7";C:\Program Files (x86)\Microsoft 
Visual Studio 11.0\VC\include

set LIB=%LIB%;"C:\Program Files\Autodesk\Maya2015\lib";C:\Program Files 
(x86)\Microsoft Visual Studio 11.0\VC\include

"c:\Program Files\Autodesk\Maya2015\bin\mayapy.exe" setup.py build 

"c:\Program Files\Autodesk\Maya2015\bin\mayapy.exe" setup.py install


# scipy (assuming exists in c:\numpy_scipy_build\scipy-0.14.1)

# from a new admin cmd prompt

# run the following


cd c:\numpy_scipy_build\scipy-0.14.1

rd /S /Q build

"C:\Program Files (x86)\Intel\Composer XE\bin\iclvars.bat" intel64 vs2010

"C:\Program Files (x86)\Intel\Composer XE\bin\ifortvars.bat" intel64 vs2010

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" amd64

set DISTUTILS_USE_SDK=1

set INCLUDE=%INCLUDE%;"C:\Program 
Files\Autodesk\Maya2015\include\python2.7";C:\Program Files (x86)\Microsoft 
Visual Studio 11.0\VC\include

set LIB=%LIB%;"C:\Program Files\Autodesk\Maya2015\lib";C:\Program Files 
(x86)\Microsoft Visual Studio 11.0\VC\include;"C:\Program 
Files\Autodesk\Maya2015\Python\Lib\site-packages\numpy\core\lib"

"c:\Program Files\Autodesk\Maya2015\bin\mayapy.exe" setup.py build 

"c:\Program Files\Autodesk\Maya2015\bin\mayapy.exe" setup.py build 

"c:\Program Files\Autodesk\Maya2015\bin\mayapy.exe" setup.py install 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

This was tested w/ nose in a mayapy.exe prompt
###########
import numpy
numpy.test()

import scipy
scipy.test()
###########

Hope this helps anyone else who wants some fancy numpy/scipy in maya2015

Thanks,

+josh

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/27f0a1c9-5426-48f4-a921-9488f91485b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

参考 https://software.intel.com/zh-cn/articles/numpyscipy-with-intel-mkl
 



posted @ 2015-08-11 13:26  Jonn.  阅读(639)  评论(0编辑  收藏  举报