@@ -90,6 +90,7 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
9090# N.B. _prefix is the prefix applied to the names of all cached variables that
9191# are generated internally and marked advanced by this macro.
9292
93+
9394set (_libdir ${ARGN} )
9495
9596set (_libraries_work TRUE )
@@ -105,8 +106,10 @@ if (NOT _libdir)
105106 endif ()
106107endif ()
107108
109+
108110foreach (_library ${_list} )
109111 set (_combined_name ${_combined_name} _${_library} )
112+ #message("DEBUG early stage variable: ${_prefix}${_combined_name}_WORKS is ${${_prefix}${_combined_name}_WORKS}")
110113
111114 if (_libraries_work)
112115 if (BLA_STATIC)
@@ -125,35 +128,50 @@ foreach(_library ${_list})
125128 set (CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES } .so.3gf)
126129 endif ()
127130 endif ()
128- message (${CMAKE_FIND_LIBRARY_SUFFIXES } )
131+ # message(${CMAKE_FIND_LIBRARY_SUFFIXES})
129132 find_library (${_prefix} _${_library}_LIBRARY
130133 NAMES ${_library}
131134 HINTS ${_libdir}
132135 )
133- message ("LIBDIR : ${_libdir} " )
134- message (${${_prefix} _${_library} _LIBRARY})
136+ # message("---- sik [begin] --- ")
137+ # message(" LIBDIR : ${_libdir}")
138+ # message(" PREFIX : ${_prefix}")
139+ # message(" LIBRARY : ${_libray}")
140+ # message(" COMMAND : mark advanced : ${${_prefix}_${_library}_LIBRARY}")
141+ # message(" COMMAND : set ${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY} ")
142+ # message(" COMMAND : set _libraries_work ${${_prefix}_${_library}_LIBRARY}")
143+ # message("---- sik [end] ---")
135144 mark_as_advanced (${_prefix} _${_library}_LIBRARY )
136145 set (${LIBRARIES} ${${LIBRARIES} } ${${_prefix} _${_library} _LIBRARY})
137146 set (_libraries_work ${${_prefix} _${_library} _LIBRARY})
138147 endif ()
139148endforeach ()
140149if (_libraries_work)
150+ message ("DEBUG: _libraries_work is ${_prefix}${_combined_name} _WORKS = ${${_prefix}${_combined_name} _WORKS}" )
141151 # Test this combination of libraries.
142152 set (CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES} } ${_thread} )
143- # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
153+ #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
154+ #message("DEBUG: before checking, ${LIBRARIES} = ${${LIBRARIES}}")
155+ #message("DEBUG: CMAKE_Fortran_COMPILER_LOADED = ${CMAKE_Fortran_COMPILER_LOADED}")
156+ #message("DEBUG: ${_prefix}${_combined_name}_WORKS before check is ${${_prefix}${_combined_name}_WORKS}")
144157 if (CMAKE_Fortran_COMPILER_LOADED)
158+ #message("DEBUG call: check_fortran_function_exists(\"${_name}\" ${_prefix}${_combined_name}_WORKS)")
145159 check_fortran_function_exists ("${_name} " ${_prefix}${_combined_name} _WORKS )
146160 else ()
161+ #message("DEBUG call: check_function_exists(\"${_name}_\" ${_prefix}${_combined_name}_WORKS)")
147162 check_function_exists ("${_name} _" ${_prefix}${_combined_name} _WORKS )
148163 endif ()
164+ #message("DEBUG: ${_prefix}${_combined_name}_WORKS after check is ${${_prefix}${_combined_name}_WORKS}")
149165 set (CMAKE_REQUIRED_LIBRARIES)
150166 mark_as_advanced (${_prefix}${_combined_name} _WORKS )
151167 set (_libraries_work ${${_prefix}${_combined_name} _WORKS})
168+ #message("DEBUG: CMAKE_REQUIRED_LIBRARIES is ${CMAKE_REQUIRED_LIBRARIES}")
169+ message ("DEBUG: _libraries_work is ${_prefix}${_combined_name} _WORKS = ${${_prefix}${_combined_name} _WORKS}" )
152170endif ()
153171if (NOT _libraries_work)
154172 set (${LIBRARIES} FALSE )
155173endif ()
156- # message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
174+ # message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
157175endmacro ()
158176
159177set (BLAS_LINKER_FLAGS)
@@ -501,7 +519,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
501519 else ()
502520 find_package (Threads REQUIRED )
503521 endif ()
504-
522+ # LIST(APPEND CMAKE_THREAD_LIBS_INIT ${LM})
505523 set (BLAS_SEARCH_LIBS "" )
506524
507525 if (BLA_F95)
@@ -654,12 +672,20 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
654672 endif ()
655673
656674 foreach (IT ${BLAS_SEARCH_LIBS} )
657- message ("----sik---- DB: get in" )
675+ # message("----sik---- DB: get in")
658676 string (REPLACE " " ";" SEARCH_LIBS ${IT} )
659677 if (${_LIBRARIES} )
660- message ("----sik---- DB: get in _libraries is true" )
678+ # message("----sik---- DB: get in _libraries is true")
661679 else ()
662- message ("----sik---- DB: get in _libraries is false" )
680+ # message("----sik---- DB: get in _libraries is false")
681+ message ("---check_fortran_libraries (call)-- ---- sik [begin] --- CHECK_FUNCTION_EXISTS --" )
682+ message ("---check_fortran_libraries (call)-- _LIBRARIES: ${_LIBRARIES} " )
683+ message ("---check_fortran_libraries (call)-- ${_LIBRARIES} : ${${_LIBRARIES} } " )
684+ message ("---check_fortran_libraries (call)-- BLAS_mkl_SEARCH_SYMBOL : ${BLAS_mkl_SEARCH_SYMBOL} " )
685+ message ("---check_fortran_libraries (call)-- SEARCH_LIBS : ${SEARCH_LIBS} " )
686+ message ("---check_fortran_libraries (call)-- CMAKE_THREAD_LIBS_INIT : ${CMAKE_THREAD_LIBS_INIT} " )
687+ message ("---check_fortran_libraries (call)-- LM : ${LM} " )
688+ message ("---check_fortran_libraries (call)-- ---- sik [end] --- CHECK_FUNCTION_EXISTS --" )
663689 check_fortran_libraries (
664690 ${_LIBRARIES}
665691 BLAS
@@ -668,8 +694,8 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
668694 "${SEARCH_LIBS} "
669695 "${CMAKE_THREAD_LIBS_INIT} ;${LM} "
670696 )
671- message ("----sik---- DB: libraries: ${_LIBRARIES} is ${${_LIBRARIES} }" )
672- message ("----sik---- DB: it : ${IT} " )
697+ # message("----sik---- DB: libraries: ${_LIBRARIES} is ${${_LIBRARIES}}")
698+ # message("----sik---- DB: it : ${IT} ")
673699 endif ()
674700 endforeach ()
675701
0 commit comments