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

[vcpkg baseline] Re-fix lapack-reference to find blas on windows-static #19608

Closed
wants to merge 16 commits into from
Closed
4 changes: 0 additions & 4 deletions ports/blas/CMakeLists.txt

This file was deleted.

4 changes: 0 additions & 4 deletions ports/blas/CONTROL

This file was deleted.

5 changes: 5 additions & 0 deletions ports/blas/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The reference BLAS is a freely-available software package. It is available from netlib via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software packages (and has been). We only ask that proper credit be given to the authors.

Like all software, it is copyrighted. It is not trademarked, but we do ask the following:
If you modify the source for these routines we ask that you change the name of the routine and comment the changes made to the original.
We will gladly answer any questions regarding the software. If a modification is done, however, it is the responsibility of the person who modified the routine to provide support.
13 changes: 13 additions & 0 deletions ports/blas/fix-install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e8d1c1b..d1f320e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,7 +62,7 @@ macro(blas_install_library lib)
EXPORT ${BLAS_INSTALL_EXPORT_NAME}
ARCHIVE DESTINATION lib COMPONENT Development
LIBRARY DESTINATION lib COMPONENT RuntimeLibraries
- RUNTIME DESTINATION lib COMPONENT RuntimeLibraries
+ RUNTIME DESTINATION bin COMPONENT RuntimeLibraries
)
endmacro()

52 changes: 48 additions & 4 deletions ports/blas/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
SET(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)

# Make sure BLAS can be found
vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_PORT_DIR}
OPTIONS -DCMAKE_PREFIX_PATH="${CURRENT_PACKAGES_DIR}")
vcpkg_download_distfile(ARCHIVE
URLS "http://www.netlib.org/blas/blas-3.10.0.tgz"
FILENAME "blas-3.10.0.tgz"
SHA512 1f243ce4f7e0974e62c03c49da2741509662e20e82d0ebb73e10a940cff6458739b9dc238125d5e1ae7c179eaba06155bb502327bd58eaf246c29a16e554eeb0
)

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES fix-install.patch
)


vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
single BUILD_SINGLE
double BUILD_DOUBLE
complex BUILD_COMPLEX
complex16 BUILD_COMPLEX16
)

if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(BUILD_X64 ON)
else()
set(BUILD_X64 OFF)
endif()

include(vcpkg_find_fortran)
vcpkg_find_fortran(FORTRAN_CMAKE)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
${FEATURE_OPTIONS}
${FORTRAN_CMAKE}
-DBUILD_INDEX64=${BUILD_X64}
-DBUILD_TESTING=OFF
)

vcpkg_install_cmake()
vcpkg_copy_pdbs()

vcpkg_fixup_pkgconfig()

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/copyright" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
5 changes: 5 additions & 0 deletions ports/blas/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Use this package via the module FindBLAS that comes with CMake. To use in your CMakeLists.txt:

find_package(BLAS REQUIRED)
target_compile_options(main PRIVATE ${BLAS_LINKER_FLAGS})
target_link_libraries(main PRIVATE ${BLAS_LIBRARIES})
26 changes: 26 additions & 0 deletions ports/blas/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "blas",
"version-semver": "3.10.0",
"description": "Metapackage for packages which provide BLAS",
"homepage": "http://www.netlib.org/blas/",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
}
],
"features": {
"complex": {
"description": "Build single precision complex"
},
"complex16": {
"description": "Build double precision complex"
},
"double": {
"description": "Build double precision real"
},
"single": {
"description": "Build single precision real"
}
}
}