Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[blas/lapack] force vendor #24327

Merged
merged 92 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
ac1f57e
force bla vendor in blas
Neumann-A Jan 11, 2021
f2df1fa
force BLA_VENDOR for lapack.
Neumann-A Jan 11, 2021
f14cac7
fix wrapper install
Neumann-A Jan 19, 2021
995f5b2
add version info
Neumann-A Jan 19, 2021
b92ef3b
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Apr 22, 2022
ef59437
install wrapper if not exist.
Apr 22, 2022
d887061
cleanup stuff
Apr 22, 2022
c12bad7
rename to cmake.in
Apr 22, 2022
c50945d
details
Apr 22, 2022
16373d0
drastically simplify FindLAPACK by clapack
Apr 22, 2022
9759dd2
no find_dependency in modules!
Apr 22, 2022
a8df6e7
add missing @ONLY
Apr 22, 2022
1e1819c
move stuff around
Apr 22, 2022
63b429d
fix platform expr
Apr 22, 2022
dc751ce
be consistent as the comment says
Apr 22, 2022
6feaf6b
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Apr 22, 2022
677cb68
rename test ports with -test
Neumann-A Apr 22, 2022
5fe252b
use version-string to define blas impl.
Neumann-A Apr 22, 2022
272a28c
add version stuff
Neumann-A Apr 22, 2022
0fe4af8
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
May 4, 2022
ef73585
more pc files
May 4, 2022
d58573d
version stuff
May 4, 2022
244878c
adjust test to check for pc files.
May 4, 2022
55d4d09
revert openblas version
May 4, 2022
b7c002b
fix copy pasta
May 4, 2022
d77a77e
fix uwp regression
Neumann-A May 4, 2022
9896014
version stuff
Neumann-A May 4, 2022
4c2e724
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Jun 6, 2022
f0b472c
cleanup
Neumann-A Jun 6, 2022
bbf8ace
fix logic
Neumann-A Jun 6, 2022
1044e8d
fine tuning
Neumann-A Jun 7, 2022
b4e1bfc
format manifest
Neumann-A Jun 7, 2022
4b0a163
v db
Neumann-A Jun 7, 2022
e2193ee
fix platform expression
Neumann-A Jul 13, 2022
b40a3a9
overwrite version
Neumann-A Jul 13, 2022
1052fc6
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Jul 13, 2022
eba70b8
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A Sep 18, 2022
499886c
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A Sep 28, 2022
09ddd5e
fix mlpack by fixing armadillo config.
Neumann-A Sep 30, 2022
3cd56c9
v db
Neumann-A Sep 30, 2022
4339948
add licens to clapack
Neumann-A Sep 30, 2022
76c27e2
v db
Neumann-A Sep 30, 2022
f562fcb
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A Oct 27, 2022
8ab457d
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A Nov 10, 2022
a1ed890
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Jan 20, 2023
aa79c87
bump port versions
Neumann-A Jan 20, 2023
41111e1
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Jan 25, 2023
f3688f5
fix release pc path
Neumann-A Jan 25, 2023
7d7b076
fix urls
Neumann-A Jan 25, 2023
6d4ec44
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A Feb 3, 2023
d7485f8
v db
Neumann-A Feb 3, 2023
1b3df81
v db the rest
Neumann-A Feb 3, 2023
7ae0409
ci baseline
Neumann-A Feb 3, 2023
ad9405a
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Feb 26, 2023
0ceb6ca
v db
Neumann-A Feb 26, 2023
fd64330
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Mar 24, 2023
5e5852d
v db
Neumann-A Mar 24, 2023
f455709
trace failures
Neumann-A Mar 25, 2023
e838da1
add cblas feature as a dependency in static builds
Neumann-A Mar 25, 2023
f1aef26
Slip cblas into lapack for opencv.
Neumann-A Mar 25, 2023
e947d22
format manifest
Neumann-A Mar 25, 2023
e2e85f2
v db
Neumann-A Mar 25, 2023
9b41be6
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Mar 25, 2023
affdd7e
revert debug changes
Neumann-A Mar 25, 2023
a9f6f57
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Mar 27, 2023
164ec71
v db
Neumann-A Mar 27, 2023
6e12241
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Apr 14, 2023
2637ba6
v db
Neumann-A Apr 14, 2023
29fdcb5
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal Apr 14, 2023
ddac191
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Jun 10, 2023
5e89b43
v db
Neumann-A Jun 10, 2023
2699c49
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Dec 29, 2023
912b5d0
v db
Neumann-A Dec 29, 2023
b47cadb
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Jan 10, 2024
cc03e3d
v db
Neumann-A Jan 10, 2024
6db8250
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A Mar 5, 2024
343d986
remove invalid cblas patch in shogun
Neumann-A Mar 7, 2024
0a131bf
Fix shogun?
Neumann-A Mar 7, 2024
58f503d
add missing lapack dep
Neumann-A Mar 7, 2024
481085f
remove flags being nuked by shogun
Neumann-A Mar 7, 2024
9175648
fix accelerate detection
Neumann-A Mar 7, 2024
dd61a83
a bit of debugging shogun
Neumann-A Mar 7, 2024
771e1e4
run trace
Neumann-A Mar 7, 2024
42eb54e
retry with different regex
Neumann-A Mar 7, 2024
1f7cefd
disable lapack/blas usage for eigen on osx
Neumann-A Mar 7, 2024
31284db
v db
Neumann-A Mar 7, 2024
e1273ab
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A Mar 19, 2024
36c0019
add cblas port
Neumann-A Mar 19, 2024
e0bab30
v db
Neumann-A Mar 19, 2024
e372c9d
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A Apr 2, 2024
a36095e
Nitpicks:
BillyONeal Apr 3, 2024
a5f3174
Fix windows-arm64-static triplets and explain why backends are selected
BillyONeal Apr 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ports/blas-impl/blas.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
prefix=${pcfiledir}/../..

Name: BLAS
Description: Implementation of BLAS
Version:
Requires: @requires@
Libs: @libs@
Cflags: @cflags@
44 changes: 44 additions & 0 deletions ports/blas-impl/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)

# OpenBLAS
if(VCPKG_TARGET_IS_OSX)
set(BLA_VENDOR Apple)
set(requires "") # TODO: figure out the flags required?
set(libs "-framework Accelerate")
set(cflags "-framework Accelerate")
else()
set(BLA_VENDOR OpenBLAS)
set(requires openblas)
endif()

if(NOT (VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static"))
configure_file("${CMAKE_CURRENT_LIST_DIR}/blas.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/blas.pc" @ONLY)
if(NOT VCPKG_BUILD_TYPE)
configure_file("${CMAKE_CURRENT_LIST_DIR}/blas.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/blas.pc" @ONLY)
endif()
endif()

# For possible overlays:

#NETLIB reference implementation (contained in lapack-reference)
#set(BLA_VENDOR Generic)

# Intel MKL
#if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
# set(BLA_VENDOR Intel10_64lp)
#elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
# set(BLA_VENDOR Intel10_32)
#else()
# message(FATAL_ERROR "Unsupported target architecture for Intel MKL!")
#endif()

# Apple Accelerate Framework
# set(BLA_VENDOR Apple)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(BLA_STATIC ON)
else()
set(BLA_STATIC OFF)
endif()

configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/blas/vcpkg-cmake-wrapper.cmake" @ONLY)
5 changes: 5 additions & 0 deletions ports/blas-impl/vcpkg-cmake-wrapper.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(BLA_VENDOR @BLA_VENDOR@)
set(BLA_STATIC @BLA_STATIC@)
_find_package(${ARGS})
unset(BLA_VENDOR)
unset(BLA_STATIC)
17 changes: 17 additions & 0 deletions ports/blas-impl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$comment": "Keep the platform expressions in sync with the wrappers installed by the portfiles!",
"name": "blas-impl",
"version-date": "2022-04-22",
"description": "Metapackage for packages which provide BLAS",
"license": null,
"dependencies": [
{
"name": "openblas",
"platform": "!osx | (static & windows)"
},
{
"name": "vcpkg-cmake",
"host": true
}
]
}
5 changes: 3 additions & 2 deletions ports/blas/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)

# Make sure BLAS can be found
vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_PORT_DIR}
OPTIONS -DCMAKE_PREFIX_PATH="${CURRENT_PACKAGES_DIR}")
vcpkg_cmake_configure(SOURCE_PATH "${CURRENT_PORT_DIR}"
OPTIONS -DCMAKE_PREFIX_PATH="${CURRENT_PACKAGES_DIR}"
)
11 changes: 8 additions & 3 deletions ports/blas/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"$comment": "Keep the platform expressions in sync with the wrappers installed by the portfiles!",
"name": "blas",
"version-string": "1",
"port-version": 1,
"version-date": "2022-04-22",
"description": "Metapackage for packages which provide BLAS",
"license": null,
"dependencies": [
"openblas"
"blas-impl",
{
"name": "vcpkg-cmake",
"host": true
}
]
}
246 changes: 27 additions & 219 deletions ports/clapack/FindLAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,238 +2,46 @@
# clapack config for vcpkg
# ------------
#
# Find the clapack includes and library.
# Find clapack as a valid LAPACK implementation.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This script defines the following variables:
#
# ``CLAPACK_FOUND``
# True if clapack library found
#
# ``CLAPACK_VERSION``
# Containing the clapack version tag (manually defined)
#
# ``CLAPACK_INCLUDE_DIR``
# Location of clapack headers
#
# ``CLAPACK_LIBRARY``
# List of libraries to link with when using clapack
#
# Result Targets
# ^^^^^^^^^^^^^^
#
# This script defines the following targets:
#
# ``clapack::clapack``
# Target to use clapack
#
# Compatibility Variables
# ^^^^^^^^^^^^^^^^^^^^^^^
#
# This script defines the following variables for compatibility reasons:
#
# ``F2C_FOUND``
# True if f2c (fortran-to-c wrap layer) library found
#
# ``F2C_INCLUDE_DIR``
# Location of clapack headers
#
# ``F2C_LIBRARY``
# Library containing the fortran-to-c wrap layer, necessary for clapack and automatically included when used
#
# ``LAPACK_FOUND``
# True if clapack library found
#
# ``LAPACK_VERSION``
# Containing the clapack version tag (manually defined)
#
# ``LAPACK_INCLUDE_DIR``
# Location of clapack headers
#
# ``LAPACK_LIBRARY``
# List of libraries to link with when using clapack
#
# Compatibility Targets
# ^^^^^^^^^^^^^^
#
# This script defines the following targets for compatibility reasons:
#
# ``lapack``
# Target to use lapack
# The module defines the same outputs as FindLAPACK by cmake

include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
include(${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
include(${CMAKE_ROOT}/Modules/CMakeFindDependencyMacro.cmake)

set(CLAPACK_VERSION "3.2.1")
set(LAPACK_VERSION "${CLAPACK_VERSION}")
#set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
BillyONeal marked this conversation as resolved.
Show resolved Hide resolved
find_package(Threads)

set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_dependency(Threads)
find_package(clapack CONFIG REQUIRED) # This will be found !

if(UNIX)
find_library(ADDITIONAL_LAPACK_LIBRARY m)
set(PTHREAD_LINK_NAME "-pthread")
if(NOT TARGET lapack)
message(FATAL_ERROR "Target lapack was not created by find_package(clapack)!")
endif()

if(NOT F2C_LIBRARY)
find_library(F2C_LIBRARY_RELEASE NAMES f2c libf2c)
find_library(F2C_LIBRARY_DEBUG NAMES f2cd libf2cd)
select_library_configurations(F2C)
if(NOT TARGET LAPACK::LAPACK)
add_library(LAPACK::LAPACK INTERFACE IMPORTED)
target_link_libraries(LAPACK::LAPACK INTERFACE lapack)

#keep a list of "pure" f2c libs, without dependencies
set(oF2C_LIBRARY_RELEASE ${F2C_LIBRARY_RELEASE})
set(oF2C_LIBRARY_DEBUG ${F2C_LIBRARY_DEBUG})
set(oF2C_LIBRARY ${F2C_LIBRARY})
set(lib_prop IMPORTED_LOCATION)
#if(@VCPKG_LIBRARY_LINKAGE@ STREQUAL "dynamic" AND WIN32)
# set(lib_prop IMPORTED_IMPLIB)
#endif()

list(APPEND F2C_LIBRARY ${ADDITIONAL_LAPACK_LIBRARY})
endif()

if(NOT LAPACK_LIBRARY)
find_library(LAPACK_LIBRARY_RELEASE NAMES lapack)
find_library(LAPACK_LIBRARY_DEBUG NAMES lapackd)

#keep a list of "pure" lapack libs, without dependencies
set(oLAPACK_LIBRARY_RELEASE ${LAPACK_LIBRARY_RELEASE})
set(oLAPACK_LIBRARY_DEBUG ${LAPACK_LIBRARY_DEBUG})
select_library_configurations(oLAPACK)

list(APPEND LAPACK_LIBRARY_RELEASE ${F2C_LIBRARY_RELEASE})
list(APPEND LAPACK_LIBRARY_DEBUG ${F2C_LIBRARY_DEBUG})

find_dependency(OpenBLAS)
get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY IMPORTED_IMPLIB_RELEASE)
if(NOT _loc)
get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY LOCATION_RELEASE)
endif()
set(LAPACK_BLAS_LIBRARY_RELEASE ${_loc})
get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY IMPORTED_IMPLIB_DEBUG)
if(NOT _loc)
get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY LOCATION_DEBUG)
endif()
set(LAPACK_BLAS_LIBRARY_DEBUG ${_loc})
select_library_configurations(LAPACK_BLAS)
list(APPEND LAPACK_LIBRARY_RELEASE ${LAPACK_BLAS_LIBRARY_RELEASE})
list(APPEND LAPACK_LIBRARY_DEBUG ${LAPACK_BLAS_LIBRARY_DEBUG})

select_library_configurations(LAPACK)
if(UNIX)
list(APPEND LAPACK_LIBRARY ${PTHREAD_LINK_NAME})
endif()
endif()

if(NOT F2C_INCLUDE_DIR)
find_path(F2C_INCLUDE_DIR NAMES f2c.h)
endif()

if(NOT LAPACK_INCLUDE_DIR)
find_path(LAPACK_INCLUDE_DIR NAMES clapack.h)
endif()

list(APPEND LAPACK_INCLUDE_DIR ${F2C_INCLUDE_DIR})
set(LAPACK_INCLUDE_DIR "${LAPACK_INCLUDE_DIR}" CACHE PATH "" FORCE)
set(LAPACK_INCLUDE_DIRS "${LAPACK_INCLUDE_DIR}" CACHE PATH "" FORCE)
set(CLAPACK_INCLUDE_DIR "${LAPACK_INCLUDE_DIR}" CACHE PATH "" FORCE)
set(CLAPACK_INCLUDE_DIRS "${LAPACK_INCLUDE_DIR}" CACHE PATH "" FORCE)
set(F2C_INCLUDE_DIRS "${F2C_INCLUDE_DIR}" CACHE PATH "" FORCE)

set(LAPACK_DLL_DIR ${LAPACK_INCLUDE_DIR})
list(TRANSFORM LAPACK_DLL_DIR APPEND "/../bin")
message(STATUS "LAPACK_DLL_DIR: ${LAPACK_DLL_DIR}")

if(WIN32)
find_file(LAPACK_LIBRARY_RELEASE_DLL NAMES lapack.dll PATHS ${LAPACK_DLL_DIR})
find_file(LAPACK_LIBRARY_DEBUG_FOLDER NAMES lapackd.dll PATHS ${LAPACK_DLL_DIR})
find_file(F2C_LIBRARY_RELEASE_DLL NAMES f2c.dll libf2c.dll PATHS ${LAPACK_DLL_DIR})
find_file(F2C_LIBRARY_DEBUG_DLL NAMES f2cd.dll libf2cd.dll PATHS ${LAPACK_DLL_DIR})
endif()
get_property(LAPACK_LIBRARY_RELEASE TARGET lapack PROPERTY ${lib_prop}_RELEASE)
get_property(LAPACK_LIBRARY_DEBUG TARGET lapack PROPERTY ${lib_prop}_DEBUG)

set(LAPACK_BLAS_LIBRARY "${LAPACK_BLAS_LIBRARY}" CACHE STRING "" FORCE)
set(F2C_LIBRARIES "${F2C_LIBRARY}" CACHE STRING "" FORCE)
set(LAPACK_VERSION "${CLAPACK_VERSION}" CACHE STRING "" FORCE)
set(LAPACK_LIBRARIES "${LAPACK_LIBRARY}" CACHE STRING "" FORCE)
set(CLAPACK_LIBRARY "${LAPACK_LIBRARY}" CACHE STRING "" FORCE)
set(CLAPACK_LIBRARIES "${LAPACK_LIBRARY}" CACHE STRING "" FORCE)
get_property(LAPACK_INCLUDE_DIR TARGET lapack PROPERTY INTERFACE_INCLUDE_DIRECTORIES) # Doesn't make much sense but ok.
select_library_configurations(LAPACK)

set(LAPACK_LIBRARY "${LAPACK_LIBRARY}" CACHE STRING "" FORCE)
set(F2C_LIBRARY "${F2C_LIBRARY}" CACHE STRING "" FORCE)
set(LAPACK_LIBRARY_RELEASE "${LAPACK_LIBRARY_RELEASE}" CACHE STRING "" FORCE)
set(LAPACK_LIBRARY_DEBUG "${LAPACK_LIBRARY_DEBUG}" CACHE STRING "" FORCE)
set(F2C_LIBRARY_RELEASE "${F2C_LIBRARY_RELEASE}" CACHE STRING "" FORCE)
set(F2C_LIBRARY_DEBUG "${F2C_LIBRARY_DEBUG}" CACHE STRING "" FORCE)

find_package_handle_standard_args(LAPACK DEFAULT_MSG LAPACK_LIBRARY LAPACK_INCLUDE_DIR)
mark_as_advanced(LAPACK_INCLUDE_DIR LAPACK_LIBRARY)

#TARGETS
if(CLAPACK_FOUND AND NOT TARGET clapack::clapack)
BillyONeal marked this conversation as resolved.
Show resolved Hide resolved
if(EXISTS "${LAPACK_LIBRARY_RELEASE_DLL}")
add_library(clapack::clapack SHARED IMPORTED)
set_target_properties(clapack::clapack PROPERTIES
IMPORTED_LOCATION_RELEASE "${LAPACK_LIBRARY_RELEASE_DLL}"
IMPORTED_IMPLIB_RELEASE "${oLAPACK_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:DEBUG>>:${oF2C_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${oF2C_LIBRARY_DEBUG}>;$<$<NOT:$<CONFIG:DEBUG>>:${LAPACK_BLAS_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${LAPACK_BLAS_LIBRARY_DEBUG}>;$<LINK_ONLY:${ADDITIONAL_LAPACK_LIBRARY}>;$<LINK_ONLY:${PTHREAD_LINK_NAME}>"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
if(EXISTS "${LAPACK_LIBRARY_DEBUG_DLL}")
set_property(TARGET clapack::clapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
set_target_properties(clapack::clapack PROPERTIES
IMPORTED_LOCATION_DEBUG "${LAPACK_LIBRARY_DEBUG_DLL}"
IMPORTED_IMPLIB_DEBUG "${oLAPACK_LIBRARY_DEBUG}")
endif()
else()
add_library(clapack::clapack UNKNOWN IMPORTED)
set_target_properties(clapack::clapack PROPERTIES
IMPORTED_LOCATION_RELEASE "${oLAPACK_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:DEBUG>>:${oF2C_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${oF2C_LIBRARY_DEBUG}>;$<$<NOT:$<CONFIG:DEBUG>>:${LAPACK_BLAS_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${LAPACK_BLAS_LIBRARY_DEBUG}>;$<LINK_ONLY:${ADDITIONAL_LAPACK_LIBRARY}>;$<LINK_ONLY:${PTHREAD_LINK_NAME}>"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
if(EXISTS "${LAPACK_LIBRARY_DEBUG}")
set_property(TARGET clapack::clapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
set_target_properties(clapack::clapack PROPERTIES
IMPORTED_LOCATION_DEBUG "${oLAPACK_LIBRARY_DEBUG}")
endif()
endif()
endif()

# Ensure consistency with both CMake's vanilla as well as lapack-reference's FindLAPACK.cmake module and register the LAPACK::LAPACK target
if(CLAPACK_FOUND AND NOT TARGET LAPACK::LAPACK)
if(EXISTS "${LAPACK_LIBRARY_RELEASE_DLL}")
add_library(LAPACK::LAPACK SHARED IMPORTED)
set_target_properties(LAPACK::LAPACK PROPERTIES
IMPORTED_LOCATION_RELEASE "${LAPACK_LIBRARY_RELEASE_DLL}"
IMPORTED_IMPLIB_RELEASE "${oLAPACK_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:DEBUG>>:${oF2C_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${oF2C_LIBRARY_DEBUG}>;$<$<NOT:$<CONFIG:DEBUG>>:${LAPACK_BLAS_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${LAPACK_BLAS_LIBRARY_DEBUG}>;$<LINK_ONLY:${ADDITIONAL_LAPACK_LIBRARY}>;$<LINK_ONLY:${PTHREAD_LINK_NAME}>"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
if(EXISTS "${LAPACK_LIBRARY_DEBUG_DLL}")
set_property(TARGET LAPACK::LAPACK APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
set_target_properties(LAPACK::LAPACK PROPERTIES
IMPORTED_LOCATION_DEBUG "${LAPACK_LIBRARY_DEBUG_DLL}"
IMPORTED_IMPLIB_DEBUG "${oLAPACK_LIBRARY_DEBUG}")
endif()
else()
add_library(LAPACK::LAPACK UNKNOWN IMPORTED)
set_target_properties(LAPACK::LAPACK PROPERTIES
IMPORTED_LOCATION_RELEASE "${oLAPACK_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
IMPORTED_CONFIGURATIONS Release
INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:DEBUG>>:${oF2C_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${oF2C_LIBRARY_DEBUG}>;$<$<NOT:$<CONFIG:DEBUG>>:${LAPACK_BLAS_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${LAPACK_BLAS_LIBRARY_DEBUG}>;$<LINK_ONLY:${ADDITIONAL_LAPACK_LIBRARY}>;$<LINK_ONLY:${PTHREAD_LINK_NAME}>"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
if(EXISTS "${LAPACK_LIBRARY_DEBUG}")
set_property(TARGET LAPACK::LAPACK APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
set_target_properties(LAPACK::LAPACK PROPERTIES
IMPORTED_LOCATION_DEBUG "${oLAPACK_LIBRARY_DEBUG}")
endif()
endif()
endif()
get_property(LAPACK_LINKER_FLAGS_RELEASE TARGET lapack PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE)
get_property(LAPACK_LINKER_FLAGS_DEBUG TARGET lapack PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG)

# Preserve backwards compatibility and also register the 'lapack' target
if(CLAPACK_FOUND AND NOT TARGET lapack)
add_library(lapack ALIAS LAPACK::LAPACK)
set(LAPACK_LIBRARIES "${LAPACK_LIBRARIES};$<$<CONFIG:DEBUG>:${IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG}>;$<$<NOT:$<CONFIG:DEBUG>>:${IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE}>")
set(LAPACK95_LIBRARIES "${LAPACK_LIBRARIES}")
set(LAPACK95_FOUND "TRUE")
set(LAPACK_LINKER_FLAGS "${LAPACK_LIBRARIES}")
endif()
find_package_handle_standard_args(LAPACK DEFAULT_MSG LAPACK_LIBRARY LAPACK_INCLUDE_DIR )
mark_as_advanced(LAPACK_INCLUDE_DIR LAPACK_LIBRARY)
Loading