2626
2727from __future__ import division , print_function
2828
29- from os . path import join , split , dirname , abspath
29+ import os
3030import sys
31+ from os .path import join , split , dirname , abspath
3132from distutils .msvccompiler import get_build_version as get_msvc_build_version
3233from numpy import get_include as get_numpy_include
3334from distutils .sysconfig import get_python_inc as get_python_include
@@ -48,8 +49,19 @@ def configuration(parent_package='',top_path=None):
4849 from numpy .distutils .system_info import get_info
4950
5051 config = Configuration ('mkl_random' , parent_package , top_path )
51-
52- libs = get_info ('mkl' ).get ('libraries' , ['mkl_rt' ])
52+ mkl_root = os .getenv ('MKLROOT' , None )
53+ if mkl_root :
54+ mkl_info = {
55+ 'include_dirs' : [join (mkl_root , 'include' )],
56+ 'library_dirs' : [join (mkl_root , 'lib' ), join (mkl_root , 'lib' , 'intel64' )],
57+ 'libraries' : ['mkl_rt' ]
58+ }
59+ else :
60+ mkl_info = get_info ('mkl' )
61+
62+ mkl_include_dirs = mkl_info .get ('include_dirs' , [])
63+ mkl_library_dirs = mkl_info .get ('library_dirs' , [])
64+ libs = mkl_info .get ('libraries' , ['mkl_rt' ])
5365 if sys .platform == 'win32' :
5466 libs .append ('Advapi32' )
5567
@@ -95,7 +107,8 @@ def configuration(parent_package='',top_path=None):
95107 name = 'mklrand' ,
96108 sources = sources ,
97109 libraries = libs ,
98- include_dirs = [wdir ,pdir ],
110+ include_dirs = [wdir ,pdir ] + mkl_include_dirs ,
111+ library_dirs = mkl_library_dirs ,
99112 define_macros = defs ,
100113 )
101114
0 commit comments