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
作者:jonn
出处:http://www.cnblogs.com/jonn/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
该文章也同时发布在我的独立博客中-jonn。