-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[blas/lapack] force vendor #24327
Changes from all commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
ac1f57e
force bla vendor in blas
Neumann-A f2df1fa
force BLA_VENDOR for lapack.
Neumann-A f14cac7
fix wrapper install
Neumann-A 995f5b2
add version info
Neumann-A b92ef3b
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
ef59437
install wrapper if not exist.
d887061
cleanup stuff
c12bad7
rename to cmake.in
c50945d
details
16373d0
drastically simplify FindLAPACK by clapack
9759dd2
no find_dependency in modules!
a8df6e7
add missing @ONLY
1e1819c
move stuff around
63b429d
fix platform expr
dc751ce
be consistent as the comment says
6feaf6b
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A 677cb68
rename test ports with -test
Neumann-A 5fe252b
use version-string to define blas impl.
Neumann-A 272a28c
add version stuff
Neumann-A 0fe4af8
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
ef73585
more pc files
d58573d
version stuff
244878c
adjust test to check for pc files.
55d4d09
revert openblas version
b7c002b
fix copy pasta
d77a77e
fix uwp regression
Neumann-A 9896014
version stuff
Neumann-A 4c2e724
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A f0b472c
cleanup
Neumann-A bbf8ace
fix logic
Neumann-A 1044e8d
fine tuning
Neumann-A b4e1bfc
format manifest
Neumann-A 4b0a163
v db
Neumann-A e2193ee
fix platform expression
Neumann-A b40a3a9
overwrite version
Neumann-A 1052fc6
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A eba70b8
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A 499886c
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A 09ddd5e
fix mlpack by fixing armadillo config.
Neumann-A 3cd56c9
v db
Neumann-A 4339948
add licens to clapack
Neumann-A 76c27e2
v db
Neumann-A f562fcb
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A 8ab457d
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A a1ed890
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A aa79c87
bump port versions
Neumann-A 41111e1
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A f3688f5
fix release pc path
Neumann-A 7d7b076
fix urls
Neumann-A 6d4ec44
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A d7485f8
v db
Neumann-A 1b3df81
v db the rest
Neumann-A 7ae0409
ci baseline
Neumann-A ad9405a
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A 0ceb6ca
v db
Neumann-A fd64330
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A 5e5852d
v db
Neumann-A f455709
trace failures
Neumann-A e838da1
add cblas feature as a dependency in static builds
Neumann-A f1aef26
Slip cblas into lapack for opencv.
Neumann-A e947d22
format manifest
Neumann-A e2e85f2
v db
Neumann-A 9b41be6
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A affdd7e
revert debug changes
Neumann-A a9f6f57
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A 164ec71
v db
Neumann-A 6e12241
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A 2637ba6
v db
Neumann-A 29fdcb5
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal ddac191
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A 5e89b43
v db
Neumann-A 2699c49
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A 912b5d0
v db
Neumann-A b47cadb
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A cc03e3d
v db
Neumann-A 6db8250
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A 343d986
remove invalid cblas patch in shogun
Neumann-A 0a131bf
Fix shogun?
Neumann-A 58f503d
add missing lapack dep
Neumann-A 481085f
remove flags being nuked by shogun
Neumann-A 9175648
fix accelerate detection
Neumann-A dd61a83
a bit of debugging shogun
Neumann-A 771e1e4
run trace
Neumann-A 42eb54e
retry with different regex
Neumann-A 1f7cefd
disable lapack/blas usage for eigen on osx
Neumann-A 31284db
v db
Neumann-A e1273ab
Merge remote-tracking branch 'upstream/master' into force_bla_vendor
Neumann-A 36c0019
add cblas port
Neumann-A e0bab30
v db
Neumann-A e372c9d
Merge branch 'microsoft:master' into force_bla_vendor
Neumann-A a36095e
Nitpicks:
BillyONeal a5f3174
Fix windows-arm64-static triplets and explain why backends are selected
BillyONeal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,72 @@ | ||
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
|
||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/blas") | ||
|
||
# Make sure BLAS can be found | ||
vcpkg_list(SET CMAKE_IGNORE_PATH) | ||
if(NOT DEFINED ENV{MKLROOT}) | ||
list(APPEND CMAKE_IGNORE_PATH "${CURRENT_INSTALLED_DIR}/lib/intel64") | ||
endif() | ||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${CURRENT_PORT_DIR}" | ||
OPTIONS | ||
"-DCMAKE_PREFIX_PATH=${CURRENT_PACKAGES_DIR}" | ||
"-DCMAKE_IGNORE_PATH=${CMAKE_IGNORE_PATH}" | ||
) | ||
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
|
||
# Due to the interaction between BLAS and LAPACK, we need to choose implementations consistent with | ||
# each other. | ||
# | ||
# First, if we are on Apple, we use the Accelerate framework. | ||
# | ||
# Then, we prefer to use openblas and lapack-reference for blas and lapack, respectively, but | ||
# sometimes are unable. | ||
# | ||
# If we are on Windows and arm or uwp, that we use gfortran as our fortran compiler creates an issue | ||
# because there is no available libgfortran. This means ew can't use lapack-reference at all. | ||
# | ||
# If we are on Windows and static, there is a linking problem caused by static gfortran in the same | ||
# link as openblas, so we have to use the blas implementation from lapack-reference. | ||
# | ||
# That results in roughly the following decision tree: | ||
# | ||
# no_libgfortran = (uwp || (windows && arm)) | ||
# can_link_mixed_static_libgfortran = !windows || !static | ||
# | ||
# if (no_libgfortran) { | ||
# return { | ||
# "blas": "openblas", | ||
# "lapack": "clapack" | ||
# }; | ||
# } else if (can_link_mixed_static_libgfortran) { | ||
# return { | ||
# "blas": "openblas", | ||
# "lapack": "lapack-reference[noblas]" | ||
# }; | ||
# } else { | ||
# return { | ||
# "blas": "lapack-reference[blas]", | ||
# "lapack": "lapack-reference[blas]" | ||
# }; | ||
# } | ||
# | ||
# Scoping this to just the 'can use openblas' question, we get: | ||
# uwp || (windows && arm) || !windows || !static | ||
# and for lapack-reference[blas], the DeMorgan'd inverse of that: | ||
# !uwp && !(windows && arm) && windows && static | ||
|
||
if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS) | ||
# Use Apple's accelerate framework where available | ||
set(BLA_VENDOR Apple) | ||
set(requires "") | ||
set(libs "-framework Accelerate") | ||
set(cflags "-framework Accelerate") | ||
elseif(VCPKG_TARGET_IS_UWP | ||
OR (VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "arm") | ||
OR NOT VCPKG_TARGET_IS_WINDOWS | ||
OR NOT (VCPKG_LIBRARY_LINKAGE STREQUAL "static")) | ||
set(BLA_VENDOR OpenBLAS) | ||
set(requires openblas) | ||
else() | ||
set(BLA_VENDOR Generic) | ||
set(requires "blas-reference") | ||
endif() | ||
|
||
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() | ||
|
||
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) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# BLA_VENDOR and BLA_STATIC are documented at: | ||
# * https://cmake.org/cmake/help/latest/module/FindBLAS.html | ||
# * https://cmake.org/cmake/help/latest/module/FindLAPACK.html | ||
|
||
set(BLA_VENDOR @BLA_VENDOR@) | ||
set(BLA_STATIC @BLA_STATIC@) | ||
_find_package(${ARGS}) | ||
unset(BLA_VENDOR) | ||
unset(BLA_STATIC) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
prefix=${pcfiledir}/../.. | ||
|
||
Name: CBLAS | ||
Description: Implementation of CBLAS | ||
Version: | ||
Requires: @requires@ | ||
Libs: @libs@ | ||
Cflags: @cflags@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
|
||
# This block should be kept in sync with the port 'blas' | ||
if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS) | ||
# Use Apple's accelerate framework where available | ||
set(BLA_VENDOR Apple) | ||
set(requires "") | ||
set(libs "-framework Accelerate") | ||
set(cflags "-framework Accelerate") | ||
elseif(VCPKG_TARGET_IS_UWP | ||
OR (VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "arm") | ||
OR NOT VCPKG_TARGET_IS_WINDOWS | ||
OR NOT (VCPKG_LIBRARY_LINKAGE STREQUAL "static")) | ||
set(BLA_VENDOR OpenBLAS) | ||
set(requires openblas) | ||
else() | ||
set(BLA_VENDOR Generic) | ||
set(requires "cblas-reference") | ||
endif() | ||
|
||
configure_file("${CMAKE_CURRENT_LIST_DIR}/cblas.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/cblas.pc" @ONLY) | ||
if(NOT VCPKG_BUILD_TYPE) | ||
configure_file("${CMAKE_CURRENT_LIST_DIR}/cblas.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/cblas.pc" @ONLY) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$comment": "Keep the platform expressions in sync with the wrappers installed by the portfiles!", | ||
"name": "cblas", | ||
"version-date": "2024-03-19", | ||
"description": "Metapackage for packages which provide CBLAS", | ||
BillyONeal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"license": null, | ||
"dependencies": [ | ||
{ | ||
"name": "lapack-reference", | ||
"features": [ | ||
"cblas" | ||
], | ||
"platform": "!osx & !ios & !uwp & !(windows & arm) & windows & static" | ||
}, | ||
{ | ||
"name": "openblas", | ||
"platform": "!osx & !ios & (uwp | (windows & arm) | !windows | !static)" | ||
}, | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
} | ||
] | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove
PACKAGE_NAME Armadillo
? It creates inconsistencies depending on filesystem case-sensitivity, and the default is good enough here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I try to keep upstream case convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we care for upstream, we should leave the config in share/Armadillo/CMake...
Do you see share/Armadillo when vcpkg creates share/${PORT} first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will
vcpkg_cmake_config_fixup
fixup the case in the include below? If not -> Never mess with upstream case you are just asking for includes not being found ;)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even the do-not-mess-with-directory-name policy could be handled for omitting
PACKAGE_NAME
...From a strict point of view, vcpkg shouldn't move config out of any location which is fully supported by CMake.
But given that the include is already treated with
vcpkg_replace_string
, it would be easy to handle this particular case.