2727import sys
2828from os .path import join , exists , abspath , dirname
2929from os import getcwd
30+ from os import environ
3031
3132def configuration (parent_package = '' ,top_path = None ):
3233 from numpy .distutils .misc_util import Configuration
3334 from numpy .distutils .system_info import get_info
3435 config = Configuration ('mkl_fft' , parent_package , top_path )
3536
37+ mkl_root = environ .get ('MKLROOT' , None )
38+ if mkl_root :
39+ mkl_info = {
40+ 'include_dirs' : [join (mkl_root , 'include' )],
41+ 'library_dirs' : [join (mkl_root , 'lib' ), join (mkl_root , 'lib' , 'intel64' )],
42+ 'libraries' : ['mkl_rt' ]
43+ }
44+ else :
45+ mkl_info = get_info ('mkl' )
46+
47+ mkl_include_dirs = mkl_info .get ('include_dirs' , [])
48+ mkl_library_dirs = mkl_info .get ('library_dirs' , [])
49+ mkl_libraries = mkl_info .get ('libraries' , ['mkl_rt' ])
50+
3651 pdir = dirname (__file__ )
3752 wdir = join (pdir , 'src' )
3853 mkl_info = get_info ('mkl' )
39- libs = mkl_info .get ('libraries' , ['mkl_rt' ])
4054
4155 try :
4256 from Cython .Build import cythonize
@@ -58,8 +72,9 @@ def configuration(parent_package='',top_path=None):
5872 join (wdir , 'mklfft.h' ),
5973 join (wdir , 'multi_iter.h' )
6074 ],
61- include_dirs = [wdir ],
62- libraries = libs ,
75+ include_dirs = [wdir ] + mkl_include_dirs ,
76+ libraries = mkl_libraries ,
77+ library_dirs = mkl_library_dirs ,
6378 extra_compile_args = [
6479 '-DNDEBUG' ,
6580 # '-ggdb', '-O0', '-Wall', '-Wextra', '-DDEBUG',
0 commit comments