Commit 4005ed4c authored by PRUVOST Florent's avatar PRUVOST Florent

avoid to look into default system path automatically to find blas/lapack, we...

avoid to look into default system path automatically to find blas/lapack, we handle it precisely with HINTS keyword to use these paths only when necessary
parent 04132049
......@@ -279,6 +279,7 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
HINTS ${_libdir}
NO_DEFAULT_PATH
)
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
# Print status if not found
......@@ -293,6 +294,10 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
if(_libraries_work)
# Test this combination of libraries.
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND BLA_STATIC)
list(INSERT ${LIBRARIES} 0 "-Wl,--start-group")
list(APPEND ${LIBRARIES} "-Wl,--end-group")
endif()
set(CMAKE_REQUIRED_LIBRARIES "${_flags};${${LIBRARIES}};${_thread}")
set(CMAKE_REQUIRED_FLAGS "${BLAS_COMPILER_FLAGS}")
if (BLAS_VERBOSE)
......
......@@ -263,6 +263,7 @@ foreach(_library ${_list})
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
HINTS ${_libdir}
NO_DEFAULT_PATH
)
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
# Print status if not found
......@@ -277,6 +278,10 @@ endforeach(_library ${_list})
if(_libraries_work)
# Test this combination of libraries.
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND BLA_STATIC)
list(INSERT ${LIBRARIES} 0 "-Wl,--start-group")
list(APPEND ${LIBRARIES} "-Wl,--end-group")
endif()
if(UNIX AND BLA_STATIC)
set(CMAKE_REQUIRED_LIBRARIES ${_flags} "-Wl,--start-group" ${${LIBRARIES}} ${_blas} "-Wl,--end-group" ${_threads})
else(UNIX AND BLA_STATIC)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment