Imported Upstream version 2.8.10.2
[platform/upstream/cmake.git] / Modules / FindBLAS.cmake
1 # - Find BLAS library
2 # This module finds an installed fortran library that implements the BLAS
3 # linear-algebra interface (see http://www.netlib.org/blas/).
4 # The list of libraries searched for is taken
5 # from the autoconf macro file, acx_blas.m4 (distributed at
6 # http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
7 #
8 # This module sets the following variables:
9 #  BLAS_FOUND - set to true if a library implementing the BLAS interface
10 #    is found
11 #  BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
12 #    and -L).
13 #  BLAS_LIBRARIES - uncached list of libraries (using full path name) to
14 #    link against to use BLAS
15 #  BLAS95_LIBRARIES - uncached list of libraries (using full path name)
16 #    to link against to use BLAS95 interface
17 #  BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
18 #    is found
19 #  BLA_STATIC  if set on this determines what kind of linkage we do (static)
20 #  BLA_VENDOR  if set checks only the specified vendor, if not set checks
21 #     all the possibilities
22 #  BLA_F95     if set on tries to find the f95 interfaces for BLAS/LAPACK
23 ##########
24 ### List of vendors (BLA_VENDOR) valid in this module
25 ##  Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model),
26 ##  Intel10_64lp_seq (intel mkl v10 64 bit,sequential code, lp64 model),
27 ##  Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic
28 # C/CXX should be enabled to use Intel mkl
29
30 #=============================================================================
31 # Copyright 2007-2009 Kitware, Inc.
32 #
33 # Distributed under the OSI-approved BSD License (the "License");
34 # see accompanying file Copyright.txt for details.
35 #
36 # This software is distributed WITHOUT ANY WARRANTY; without even the
37 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
38 # See the License for more information.
39 #=============================================================================
40 # (To distribute this file outside of CMake, substitute the full
41 #  License text for the above reference.)
42
43 include(CheckFunctionExists)
44 include(CheckFortranFunctionExists)
45
46 set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
47
48 # Check the language being used
49 get_property( _LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES )
50 if( _LANGUAGES_ MATCHES Fortran )
51   set( _CHECK_FORTRAN TRUE )
52 elseif( (_LANGUAGES_ MATCHES C) OR (_LANGUAGES_ MATCHES CXX) )
53   set( _CHECK_FORTRAN FALSE )
54 else()
55   if(BLAS_FIND_REQUIRED)
56     message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.")
57   else()
58     message(STATUS "Looking for BLAS... - NOT found (Unsupported languages)")
59     return()
60   endif()
61 endif()
62
63 macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
64 # This macro checks for the existence of the combination of fortran libraries
65 # given by _list.  If the combination is found, this macro checks (using the
66 # Check_Fortran_Function_Exists macro) whether can link against that library
67 # combination using the name of a routine given by _name using the linker
68 # flags given by _flags.  If the combination of libraries is found and passes
69 # the link test, LIBRARIES is set to the list of complete library paths that
70 # have been found.  Otherwise, LIBRARIES is set to FALSE.
71
72 # N.B. _prefix is the prefix applied to the names of all cached variables that
73 # are generated internally and marked advanced by this macro.
74
75 set(_libdir ${ARGN})
76
77 set(_libraries_work TRUE)
78 set(${LIBRARIES})
79 set(_combined_name)
80 if (NOT _libdir)
81   if (WIN32)
82     set(_libdir ENV LIB)
83   elseif (APPLE)
84     set(_libdir ENV DYLD_LIBRARY_PATH)
85   else ()
86     set(_libdir ENV LD_LIBRARY_PATH)
87   endif ()
88 endif ()
89
90 foreach(_library ${_list})
91   set(_combined_name ${_combined_name}_${_library})
92
93   if(_libraries_work)
94     if (BLA_STATIC)
95       if (WIN32)
96         set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
97       endif ()
98       if (APPLE)
99         set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
100       else ()
101         set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
102       endif ()
103     else ()
104       if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
105         # for ubuntu's libblas3gf and liblapack3gf packages
106         set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
107       endif ()
108     endif ()
109     find_library(${_prefix}_${_library}_LIBRARY
110       NAMES ${_library}
111       PATHS ${_libdir}
112       )
113     mark_as_advanced(${_prefix}_${_library}_LIBRARY)
114     set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
115     set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
116   endif()
117 endforeach()
118 if(_libraries_work)
119   # Test this combination of libraries.
120   set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread})
121 #  message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
122   if (_CHECK_FORTRAN)
123     check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
124   else()
125     check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
126   endif()
127   set(CMAKE_REQUIRED_LIBRARIES)
128   mark_as_advanced(${_prefix}${_combined_name}_WORKS)
129   set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
130 endif()
131 if(NOT _libraries_work)
132   set(${LIBRARIES} FALSE)
133 endif()
134 #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
135 endmacro()
136
137 set(BLAS_LINKER_FLAGS)
138 set(BLAS_LIBRARIES)
139 set(BLAS95_LIBRARIES)
140 if ($ENV{BLA_VENDOR} MATCHES ".+")
141   set(BLA_VENDOR $ENV{BLA_VENDOR})
142 else ()
143   if(NOT BLA_VENDOR)
144     set(BLA_VENDOR "All")
145   endif()
146 endif ()
147
148 if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
149  if(NOT BLAS_LIBRARIES)
150   # gotoblas (http://www.tacc.utexas.edu/tacc-projects/gotoblas2)
151   check_fortran_libraries(
152   BLAS_LIBRARIES
153   BLAS
154   sgemm
155   ""
156   "goto2"
157   ""
158   )
159  endif()
160 endif ()
161
162 if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
163  if(NOT BLAS_LIBRARIES)
164   # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
165   check_fortran_libraries(
166   BLAS_LIBRARIES
167   BLAS
168   dgemm
169   ""
170   "f77blas;atlas"
171   ""
172   )
173  endif()
174 endif ()
175
176 # BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
177 if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
178  if(NOT BLAS_LIBRARIES)
179   check_fortran_libraries(
180   BLAS_LIBRARIES
181   BLAS
182   sgemm
183   ""
184   "sgemm;dgemm;blas"
185   ""
186   )
187  endif()
188 endif ()
189
190 # BLAS in Alpha CXML library?
191 if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
192  if(NOT BLAS_LIBRARIES)
193   check_fortran_libraries(
194   BLAS_LIBRARIES
195   BLAS
196   sgemm
197   ""
198   "cxml"
199   ""
200   )
201  endif()
202 endif ()
203
204 # BLAS in Alpha DXML library? (now called CXML, see above)
205 if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
206  if(NOT BLAS_LIBRARIES)
207   check_fortran_libraries(
208   BLAS_LIBRARIES
209   BLAS
210   sgemm
211   ""
212   "dxml"
213   ""
214   )
215  endif()
216 endif ()
217
218 # BLAS in Sun Performance library?
219 if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
220  if(NOT BLAS_LIBRARIES)
221   check_fortran_libraries(
222   BLAS_LIBRARIES
223   BLAS
224   sgemm
225   "-xlic_lib=sunperf"
226   "sunperf;sunmath"
227   ""
228   )
229   if(BLAS_LIBRARIES)
230     set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
231   endif()
232  endif()
233 endif ()
234
235 # BLAS in SCSL library?  (SGI/Cray Scientific Library)
236 if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
237  if(NOT BLAS_LIBRARIES)
238   check_fortran_libraries(
239   BLAS_LIBRARIES
240   BLAS
241   sgemm
242   ""
243   "scsl"
244   ""
245   )
246  endif()
247 endif ()
248
249 # BLAS in SGIMATH library?
250 if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
251  if(NOT BLAS_LIBRARIES)
252   check_fortran_libraries(
253   BLAS_LIBRARIES
254   BLAS
255   sgemm
256   ""
257   "complib.sgimath"
258   ""
259   )
260  endif()
261 endif ()
262
263 # BLAS in IBM ESSL library? (requires generic BLAS lib, too)
264 if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
265  if(NOT BLAS_LIBRARIES)
266   check_fortran_libraries(
267   BLAS_LIBRARIES
268   BLAS
269   sgemm
270   ""
271   "essl;blas"
272   ""
273   )
274  endif()
275 endif ()
276
277 #BLAS in acml library?
278 if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
279  if( ((BLA_VENDOR STREQUAL "ACML") AND (NOT BLAS_ACML_LIB_DIRS)) OR
280      ((BLA_VENDOR STREQUAL "ACML_MP") AND (NOT BLAS_ACML_MP_LIB_DIRS)) OR
281      ((BLA_VENDOR STREQUAL "ACML_GPU") AND (NOT BLAS_ACML_GPU_LIB_DIRS))
282    )
283    # try to find acml in "standard" paths
284    if( WIN32 )
285     file( GLOB _ACML_ROOT "C:/AMD/acml*/ACML-EULA.txt" )
286    else()
287     file( GLOB _ACML_ROOT "/opt/acml*/ACML-EULA.txt" )
288    endif()
289    if( WIN32 )
290     file( GLOB _ACML_GPU_ROOT "C:/AMD/acml*/GPGPUexamples" )
291    else()
292     file( GLOB _ACML_GPU_ROOT "/opt/acml*/GPGPUexamples" )
293    endif()
294    list(GET _ACML_ROOT 0 _ACML_ROOT)
295    list(GET _ACML_GPU_ROOT 0 _ACML_GPU_ROOT)
296    if( _ACML_ROOT )
297     get_filename_component( _ACML_ROOT ${_ACML_ROOT} PATH )
298     if( SIZEOF_INTEGER EQUAL 8 )
299      set( _ACML_PATH_SUFFIX "_int64" )
300     else()
301     set( _ACML_PATH_SUFFIX "" )
302    endif()
303    if( CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" )
304     set( _ACML_COMPILER32 "ifort32" )
305     set( _ACML_COMPILER64 "ifort64" )
306    elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "SunPro" )
307     set( _ACML_COMPILER32 "sun32" )
308     set( _ACML_COMPILER64 "sun64" )
309    elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" )
310     set( _ACML_COMPILER32 "pgi32" )
311     if( WIN32 )
312      set( _ACML_COMPILER64 "win64" )
313     else()
314      set( _ACML_COMPILER64 "pgi64" )
315     endif()
316    elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "Open64" )
317     # 32 bit builds not supported on Open64 but for code simplicity
318     # We'll just use the same directory twice
319     set( _ACML_COMPILER32 "open64_64" )
320     set( _ACML_COMPILER64 "open64_64" )
321    elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
322     set( _ACML_COMPILER32 "nag32" )
323     set( _ACML_COMPILER64 "nag64" )
324    else()
325     set( _ACML_COMPILER32 "gfortran32" )
326     set( _ACML_COMPILER64 "gfortran64" )
327    endif()
328
329    if( BLA_VENDOR STREQUAL "ACML_MP" )
330     set(_ACML_MP_LIB_DIRS
331      "${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib"
332      "${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" )
333    else()
334     set(_ACML_LIB_DIRS
335      "${_ACML_ROOT}/${_ACML_COMPILER32}${_ACML_PATH_SUFFIX}/lib"
336      "${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" )
337    endif()
338   endif()
339  elseif(BLAS_${BLA_VENDOR}_LIB_DIRS)
340    set(_${BLA_VENDOR}_LIB_DIRS ${BLAS_${BLA_VENDOR}_LIB_DIRS})
341  endif()
342
343  if( BLA_VENDOR STREQUAL "ACML_MP" )
344   foreach( BLAS_ACML_MP_LIB_DIRS ${_ACML_MP_LIB_DIRS})
345    check_fortran_libraries (
346      BLAS_LIBRARIES
347      BLAS
348      sgemm
349      "" "acml_mp;acml_mv" "" ${BLAS_ACML_MP_LIB_DIRS}
350    )
351    if( BLAS_LIBRARIES )
352     break()
353    endif()
354   endforeach()
355  elseif( BLA_VENDOR STREQUAL "ACML_GPU" )
356   foreach( BLAS_ACML_GPU_LIB_DIRS ${_ACML_GPU_LIB_DIRS})
357    check_fortran_libraries (
358      BLAS_LIBRARIES
359      BLAS
360      sgemm
361      "" "acml;acml_mv;CALBLAS" "" ${BLAS_ACML_GPU_LIB_DIRS}
362    )
363    if( BLAS_LIBRARIES )
364     break()
365    endif()
366   endforeach()
367  else()
368   foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} )
369    check_fortran_libraries (
370      BLAS_LIBRARIES
371      BLAS
372      sgemm
373      "" "acml;acml_mv" "" ${BLAS_ACML_LIB_DIRS}
374    )
375    if( BLAS_LIBRARIES )
376     break()
377    endif()
378   endforeach()
379  endif()
380
381  # Either acml or acml_mp should be in LD_LIBRARY_PATH but not both
382  if(NOT BLAS_LIBRARIES)
383   check_fortran_libraries(
384   BLAS_LIBRARIES
385   BLAS
386   sgemm
387   ""
388   "acml;acml_mv"
389   ""
390   )
391  endif()
392  if(NOT BLAS_LIBRARIES)
393   check_fortran_libraries(
394   BLAS_LIBRARIES
395   BLAS
396   sgemm
397   ""
398   "acml_mp;acml_mv"
399   ""
400   )
401  endif()
402  if(NOT BLAS_LIBRARIES)
403   check_fortran_libraries(
404   BLAS_LIBRARIES
405   BLAS
406   sgemm
407   ""
408   "acml;acml_mv;CALBLAS"
409   ""
410   )
411  endif()
412 endif () # ACML
413
414 # Apple BLAS library?
415 if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
416 if(NOT BLAS_LIBRARIES)
417   check_fortran_libraries(
418   BLAS_LIBRARIES
419   BLAS
420   dgemm
421   ""
422   "Accelerate"
423   ""
424   )
425  endif()
426 endif ()
427
428 if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
429  if ( NOT BLAS_LIBRARIES )
430     check_fortran_libraries(
431     BLAS_LIBRARIES
432     BLAS
433     dgemm
434     ""
435     "vecLib"
436     ""
437     )
438  endif ()
439 endif ()
440 # Generic BLAS library?
441 if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
442  if(NOT BLAS_LIBRARIES)
443   check_fortran_libraries(
444   BLAS_LIBRARIES
445   BLAS
446   sgemm
447   ""
448   "blas"
449   ""
450   )
451  endif()
452 endif ()
453
454 #BLAS in intel mkl 10 library? (em64t 64bit)
455 if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
456  if (NOT WIN32)
457   set(LM "-lm")
458  endif ()
459  if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
460   if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
461     find_package(Threads)
462   else()
463     find_package(Threads REQUIRED)
464   endif()
465
466   set(BLAS_SEARCH_LIBS "")
467
468   if(BLA_F95)
469     set(BLAS_mkl_SEARCH_SYMBOL SGEMM)
470     set(_LIBRARIES BLAS95_LIBRARIES)
471     if (WIN32)
472       list(APPEND BLAS_SEARCH_LIBS
473         "mkl_blas95 mkl_intel_c mkl_intel_thread mkl_core libguide40")
474     else ()
475       if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
476         list(APPEND BLAS_SEARCH_LIBS
477           "mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide")
478       endif ()
479       if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
480         # old version
481         list(APPEND BLAS_SEARCH_LIBS
482           "mkl_blas95 mkl_intel_lp64 mkl_intel_thread mkl_core guide")
483
484         # mkl >= 10.3
485         if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
486           list(APPEND BLAS_SEARCH_LIBS
487             "mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core gomp")
488         else ()
489           list(APPEND BLAS_SEARCH_LIBS
490             "mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
491         endif ()
492       endif ()
493     endif ()
494     if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
495       list(APPEND BLAS_SEARCH_LIBS
496         "mkl_blas95_lp64 mkl_intel_lp64 mkl_sequential mkl_core")
497     endif ()
498   else ()
499     set(BLAS_mkl_SEARCH_SYMBOL sgemm)
500     set(_LIBRARIES BLAS_LIBRARIES)
501     if (WIN32)
502       list(APPEND BLAS_SEARCH_LIBS
503         "mkl_c_dll mkl_intel_thread_dll mkl_core_dll libguide40")
504     else ()
505       if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
506         list(APPEND BLAS_SEARCH_LIBS
507           "mkl_intel mkl_intel_thread mkl_core guide")
508       endif ()
509       if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
510
511         # old version
512         list(APPEND BLAS_SEARCH_LIBS
513           "mkl_intel_lp64 mkl_intel_thread mkl_core guide")
514
515         # mkl >= 10.3
516         if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
517           list(APPEND BLAS_SEARCH_LIBS
518             "mkl_intel_lp64 mkl_gnu_thread mkl_core gomp")
519         else ()
520           list(APPEND BLAS_SEARCH_LIBS
521             "mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
522         endif ()
523       endif ()
524
525       #older vesions of intel mkl libs
526       if (BLA_VENDOR STREQUAL "Intel" OR BLA_VENDOR STREQUAL "All")
527         list(APPEND BLAS_SEARCH_LIBS
528           "mkl")
529         list(APPEND BLAS_SEARCH_LIBS
530           "mkl_ia32")
531         list(APPEND BLAS_SEARCH_LIBS
532           "mkl_em64t")
533       endif ()
534     endif ()
535     if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
536       list(APPEND BLAS_SEARCH_LIBS
537         "mkl_intel_lp64 mkl_sequential mkl_core")
538     endif ()
539   endif ()
540
541   foreach (IT ${BLAS_SEARCH_LIBS})
542     string(REPLACE " " ";" SEARCH_LIBS ${IT})
543     if (${_LIBRARIES})
544     else ()
545       check_fortran_libraries(
546         ${_LIBRARIES}
547         BLAS
548         ${BLAS_mkl_SEARCH_SYMBOL}
549         ""
550         "${SEARCH_LIBS}"
551         "${CMAKE_THREAD_LIBS_INIT};${LM}"
552         )
553     endif ()
554   endforeach ()
555
556  endif ()
557 endif ()
558
559
560 if(BLA_F95)
561  if(BLAS95_LIBRARIES)
562     set(BLAS95_FOUND TRUE)
563   else()
564     set(BLAS95_FOUND FALSE)
565   endif()
566
567   if(NOT BLAS_FIND_QUIETLY)
568     if(BLAS95_FOUND)
569       message(STATUS "A library with BLAS95 API found.")
570     else()
571       if(BLAS_FIND_REQUIRED)
572         message(FATAL_ERROR
573         "A required library with BLAS95 API not found. Please specify library location.")
574       else()
575         message(STATUS
576         "A library with BLAS95 API not found. Please specify library location.")
577       endif()
578     endif()
579   endif()
580   set(BLAS_FOUND TRUE)
581   set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
582 else()
583   if(BLAS_LIBRARIES)
584     set(BLAS_FOUND TRUE)
585   else()
586     set(BLAS_FOUND FALSE)
587   endif()
588
589   if(NOT BLAS_FIND_QUIETLY)
590     if(BLAS_FOUND)
591       message(STATUS "A library with BLAS API found.")
592     else()
593       if(BLAS_FIND_REQUIRED)
594         message(FATAL_ERROR
595         "A required library with BLAS API not found. Please specify library location."
596         )
597       else()
598         message(STATUS
599         "A library with BLAS API not found. Please specify library location."
600         )
601       endif()
602     endif()
603   endif()
604 endif()
605
606 set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})