Beruflich Dokumente
Kultur Dokumente
http://software.intel.com/en-us/articles/numpyscipy-with-...
App Development
Intel Technologies
Business Resources
or
by
on
numpy and mkl , numpy with mkl , mkl numpy , numpy mkl , scipy mkl , scipy with mkl , scipy and mkl , num
intended
fundamen
a powerful N-dimens sophisticated (broadc tools for integrating useful linear algebra, Besides For its obvious
sc
more
information
SciPy include modules for and more. The SciPy built to work with Nu (http://scipy.org/) for more d and optimization for p
Version Information
The in in this Intel M above Comp above Step 2 - Downloading NumPy and SciPy Source Code
1 of 6
06/17/2013 02:32 PM
http://software.intel.com/en-us/articles/numpyscipy-with-...
can
be
obt
of
ob
Intel
MKL
is
also
Intel Parallel Studio XE 2013 Intel Composer XE 2013 Intel (http://software.intel.com/en-us/intel-cluster-studio-xe/) Cluster Studio XE 2013 (http://software.intel.com/en-us/intel-cluster-studio-xe/) Step 3 - Configuration Use the following
com
$gunzip
numpy-x.x.x
The And
above to
will
create
extract
SciPy,
$gunzip
scipy-x.x.x.ta
The
scipy-x.x.x
direct
Make sure that C++ a and FORTRAN), and Step 4 - Building and Installing NumPy
follow
If
you
are
building
Nu
English
2 of 6
06/17/2013 02:32 PM
http://software.intel.com/en-us/articles/numpyscipy-with-...
in
cc_exe
num
Here we use, -O3, opt collapsing IF stateme instruction set availab Run icc --help for compiler flags.
mo
Modify the the Fortra Intel Fortran Compile For ia32 and Intel64
and
$python setup.py config --compiler=intel --fcompiler=intel build_clib --compiler=intel --fcompiler=intel build_ext --compiler=intel --fcompiler=intel install
Setup Library path for Intel MKL and Intel Compilers If you build
NumPY/S
$export If you
LD_LIBRAR NumPY
build
$export
LD_LIBRAR
It is possible that LD_ the standard ones. Th you've set the LD_RU
$export LD_RUN_PATH=/opt/intel/composer_xe_2013/lib/ia32:/opt/intel/composer_xe_2013/mkl/lib/ia32
English
3 of 6
06/17/2013 02:32 PM
http://software.intel.com/en-us/articles/numpyscipy-with-...
k_list = [64, 80, 96, 104, 112, 120, 128, 144, 160, 176, 192, 200, 208, 224, 240, 256, 384] def get_gflops(M, N, K): return M*N*(2.0*K-1.0) / 1000**3 np.show_config() for K a b A B in = = = = k_list: np.array(np.random.random((M, np.array(np.random.random((N, np.matrix(a, dtype=np.double, np.matrix(b, dtype=np.double,
N)), dtype=np.double, order='C', copy=False) K)), dtype=np.double, order='C', copy=False) copy=False) copy=False)
end = time.time() tm = (end-start) / 5.0 print "{0:4}, {1:9.7}, {2:9.7}".format(K, tm, get_gflops(M, N, K) / tm)
Please the
(http://software.intel.com/file/41177) to
cl do exam
Please no Intel MK
English
4 of 6
06/17/2013 02:32 PM
http://software.intel.com/en-us/articles/numpyscipy-with-...
For more complete information about compiler optimizations, see our Optimization Notice.
to
po
RSS
Back to Top
Comments
Pierre E. Tue, to 09/04/2012 -
post 10:1
The link to the intel.py file is broken! But I could find it here: http://software.intel.com/sites/default/files/m/d/4/1/d/8/intel.py
Note for Ubuntu and maybe Mac OS X users (<- from what I've read on the net), the building and install parts of Numpy and Scipy should be done in two steps: First to build (with intelem instead of intel for 64 bits processors): python setup.py config --compiler=intel build_clib --compiler=intel build_ext --compiler=intel Then install: sudo python setup.py install Same for Scipy. For numpy to find the libraries (in Ubuntu), add the path to the needed libraries in /etc/ld.so.conf and then run ldconfig Cheers
Top Pierre E. Wed,
Note for Ubuntu and maybe Mac OS X users (<- from what I've read on the net), the building and install parts of Numpy and Scipy should be done in two steps: First to build (with intelem instead of intel for 64 bits processors): python setup.py config --compiler=intel build_clib --compiler=intel build_ext --compiler=intel Then install: sudo python setup.py install Same for Scipy. For numpy to find the libraries (in Ubuntu), add the path to the needed libraries in /etc/ld.so.conf and then run ldconfig Cheers
Top Pierre E. Wed,
In order to be able to install Scipy you must first set the path to the libraries (as explained in the previous comment) for Numpy, because Scipy import Numpy during the building or installation process.
English
5 of 6
06/17/2013 02:32 PM
http://software.intel.com/en-us/articles/numpyscipy-with-...
Top
to post 10/10/2012 2
If you are using the latest NumPy/SciPy, you don't need to replace the intel.py, since has been updated in the NumPy/SciPy source.
post 14:
I used this page as a guide to build NumPy with Intel Composer 2013 and the latest MKL. I would like to clarify the modifications that need to be made to the distutils files: When you edit intelccompiler.py, make sure you are editing the section of the file that corresponds to the command-line flag that you will use when you run setup.py. For example, for a 64-bit system, you need to edit the class called IntelEM64TCCompiler. In the __init__ function, set
self.cc_exe = 'icc -m64 -O3 -g -fPIC -fp-model strict -fomit-frame-pointer -openmp -xhos should then
You 1
bu
Then modify the file numpy/distutils/fcompiler/intelccompiler.py Modify the class that corresponds to the command-line flags you will use to build NumPy. For a 64-bit system, modify the class IntelEM64TFCompiler. Look for the function called get_flags_arch and add the command-line options as follows:
Thanks for posting this article! More information can be found on my blog (see link below).
Craig
Finch
http://
Top
John P. Wed,
After building both numpy and scipy using the instructions above, I get the error when importing scipy: ImportError: /usr/lib/atlas/libblas.so.3gf: undefined symbol: _gfortran_st_write_done http://www.scipy.org/Installing_SciPy/BuildingGeneral states that I should NOT use ifort when building numpy ... otherwise I'll get this error ...which defeats the point of using the Intel compilers, right? Any suggestions on how to fix this problem? Thanks! John
Top
Intel DZ Content
Software Resources
Publications
Content Intel Library Intel Black McAfe (http: Softw Bel (http://softw Developer Magazine Progra Havok (http:/ Code and Downloads
/sites/billboar Intel Software Wind R Forums Intel Paral (http://w Blog Membership Magazine Intel Software Videos Intel Deve Products Newsletter
FAQs
English
6 of 6
06/17/2013 02:32 PM