@@ -2718,6 +2718,7 @@ def check_required_file(paths, required_regexs):
2718
2718
found = True
2719
2719
break
2720
2720
if not found :
2721
+ _logger .debug (f"Required file { req } not found" )
2721
2722
raise RuntimeError (f"Required file { req } not found" )
2722
2723
return libs
2723
2724
@@ -2779,9 +2780,14 @@ def check_libs(
2779
2780
res = try_blas_flag (flags )
2780
2781
if res :
2781
2782
if any ("mkl" in flag for flag in flags ):
2782
- check_mkl_openmp ()
2783
+ try :
2784
+ check_mkl_openmp ()
2785
+ except Exception as e :
2786
+ _logger .debug (e )
2787
+ _logger .debug (f"The following blas flags will be used { res } " )
2783
2788
return res
2784
2789
else :
2790
+ _logger .debug (f"Supplied flags { res } failed to compile" )
2785
2791
raise RuntimeError (f"Supplied flags { flags } failed to compile" )
2786
2792
2787
2793
# If no compiler is available we default to empty ldflags
@@ -2802,6 +2808,8 @@ def check_libs(
2802
2808
# directory. We will include both in our searched library dirs
2803
2809
searched_library_dirs .append (os .path .join (sys .prefix , "Library" , "bin" ))
2804
2810
searched_library_dirs .append (os .path .join (sys .prefix , "Library" , "lib" ))
2811
+ _logger .debug ("Will search for BLAS libraries in the following directories:" )
2812
+ _logger .debug ("{}" .format ("\n " .join (searched_library_dirs )))
2805
2813
all_libs = [
2806
2814
l
2807
2815
for path in [
@@ -2817,6 +2825,7 @@ def check_libs(
2817
2825
maybe_add_to_os_environ_pathlist ("PATH" , rpath )
2818
2826
try :
2819
2827
# 1. Try to use MKL with INTEL OpenMP threading
2828
+ _logger .debug ("Checking MKL flags with intel threading" )
2820
2829
return check_libs (
2821
2830
all_libs ,
2822
2831
required_libs = [
@@ -2829,40 +2838,44 @@ def check_libs(
2829
2838
extra_compile_flags = [f"-Wl,-rpath,{ rpath } " ] if rpath is not None else [],
2830
2839
cxx_library_dirs = cxx_library_dirs ,
2831
2840
)
2832
- except Exception :
2833
- pass
2841
+ except Exception as e :
2842
+ _logger . debug ( e )
2834
2843
try :
2835
2844
# 2. Try to use MKL with GNU OpenMP threading
2845
+ _logger .debug ("Checking MKL flags with GNU OpenMP threading" )
2836
2846
return check_libs (
2837
2847
all_libs ,
2838
2848
required_libs = ["mkl_core" , "mkl_rt" , "mkl_gnu_thread" , "gomp" , "pthread" ],
2839
2849
extra_compile_flags = [f"-Wl,-rpath,{ rpath } " ] if rpath is not None else [],
2840
2850
cxx_library_dirs = cxx_library_dirs ,
2841
2851
)
2842
- except Exception :
2843
- pass
2852
+ except Exception as e :
2853
+ _logger . debug ( e )
2844
2854
try :
2855
+ _logger .debug ("Checking Lapack + blas" )
2845
2856
# 3. Try to use LAPACK + BLAS
2846
2857
return check_libs (
2847
2858
all_libs ,
2848
2859
required_libs = ["lapack" , "blas" , "cblas" , "m" ],
2849
2860
extra_compile_flags = [f"-Wl,-rpath,{ rpath } " ] if rpath is not None else [],
2850
2861
cxx_library_dirs = cxx_library_dirs ,
2851
2862
)
2852
- except Exception :
2853
- pass
2863
+ except Exception as e :
2864
+ _logger . debug ( e )
2854
2865
try :
2855
2866
# 4. Try to use BLAS alone
2867
+ _logger .debug ("Checking blas alone" )
2856
2868
return check_libs (
2857
2869
all_libs ,
2858
2870
required_libs = ["blas" , "cblas" ],
2859
2871
extra_compile_flags = [f"-Wl,-rpath,{ rpath } " ] if rpath is not None else [],
2860
2872
cxx_library_dirs = cxx_library_dirs ,
2861
2873
)
2862
- except Exception :
2863
- pass
2874
+ except Exception as e :
2875
+ _logger . debug ( e )
2864
2876
try :
2865
2877
# 5. Try to use openblas
2878
+ _logger .debug ("Checking openblas" )
2866
2879
return check_libs (
2867
2880
all_libs ,
2868
2881
required_libs = ["openblas" , "gfortran" , "gomp" , "m" ],
@@ -2871,8 +2884,9 @@ def check_libs(
2871
2884
else ["-fopenmp" ],
2872
2885
cxx_library_dirs = cxx_library_dirs ,
2873
2886
)
2874
- except Exception :
2875
- pass
2887
+ except Exception as e :
2888
+ _logger .debug (e )
2889
+ _logger .debug ("Failed to identify blas ldflags. Will leave them empty." )
2876
2890
return ""
2877
2891
2878
2892
0 commit comments