Add package clBLAS (#2944)

* v2.12.2 ships outdated FindOpenCL.cmake

* clBLAS installs, passes checks, usable by 3rd party

* Added usage file

* [clblas] Convert to using a patch file

* [clfft] Revert removal of FindOpenCL -- this can be done, but it will require additional source patching
This commit is contained in:
Nagy-Egri Máté Ferenc 2018-03-09 06:28:00 +01:00 committed by Robert Schumacher
parent 7955320bf3
commit a506559ba9
3 changed files with 95 additions and 0 deletions

4
ports/clblas/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: clblas
Version: 2.12-1
Build-Depends: opencl
Description: clBLAS is an OpenCL 1.2 accelerated BLAS (Basic Linear Algebra Subsystem) library.

36
ports/clblas/cmake.patch Normal file
View File

@ -0,0 +1,36 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6a88c41..05b8029 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -276,6 +276,9 @@ endif()
# This will define OPENCL_FOUND
find_package( OpenCL ${OPENCL_VERSION} )
+set( OPENCL_FOUND ${OpenCL_FOUND})
+set( OPENCL_LIBRARIES ${OpenCL_LIBRARIES} )
+set( OPENCL_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS} )
# Find Boost on the system, and configure the type of boost build we want
set( Boost_USE_MULTITHREADED ON )
diff --git a/src/clBLASConfig.cmake.in b/src/clBLASConfig.cmake.in
index f52d1d6..464feca 100644
--- a/src/clBLASConfig.cmake.in
+++ b/src/clBLASConfig.cmake.in
@@ -1,3 +1,3 @@
include(${CMAKE_CURRENT_LIST_DIR}/clBLASTargets.cmake)
-get_filename_component(CLBLAS_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/@reldir@/include ABSOLUTE)
+get_filename_component(CLBLAS_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/@reldir@/../include ABSOLUTE)
set(CLBLAS_LIBRARIES clBLAS)
diff --git a/src/library/CMakeLists.txt b/src/library/CMakeLists.txt
index 5164898..f2d5a88 100644
--- a/src/library/CMakeLists.txt
+++ b/src/library/CMakeLists.txt
@@ -894,7 +894,7 @@ install( TARGETS clBLAS
EXPORT Library
RUNTIME DESTINATION bin${SUFFIX_BIN}
LIBRARY DESTINATION lib${SUFFIX_LIB}
- ARCHIVE DESTINATION lib${SUFFIX_LIB}/import
+ ARCHIVE DESTINATION lib${SUFFIX_LIB}
)
# For debug builds, include the debug runtimes into the package for testing on non-developer machines

View File

@ -0,0 +1,55 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO clMathLibraries/clBLAS
REF v2.12
SHA512 5d9b0c58adde69e83d95e9c713e0cdc5f64785fe7e05553a14c57fa483c4ef39e9dc780c26880a7f15924967d5ce4ea29035c29d63eac7ee5a2ae5ddacac2b72
HEAD_REF master
)
# v2.12 has a very old FindOpenCL.cmake using OPENCL_ vs. OpenCL_ var names
# conflicting with the built-in, more modern FindOpenCL.cmake
file(
REMOVE ${SOURCE_PATH}/src/FindOpenCL.cmake
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/cmake.patch
)
vcpkg_find_acquire_program(PYTHON3)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}/src
PREFER_NINJA
OPTIONS
-DBUILD_TEST=OFF
-DBUILD_KTEST=OFF
-DSUFFIX_LIB=
-DPYTHON_EXECUTABLE=${PYTHON3}
)
vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL
"${SOURCE_PATH}/LICENSE"
DESTINATION
${CURRENT_PACKAGES_DIR}/share/clblas
RENAME copyright
)
file(REMOVE
${CURRENT_PACKAGES_DIR}/debug/bin/clBLAS-tune.exe
${CURRENT_PACKAGES_DIR}/bin/clBLAS-tune.exe
${CURRENT_PACKAGES_DIR}/debug/bin/concrt140d.dll
${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140d.dll
${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140d.dll
)
vcpkg_fixup_cmake_targets(CONFIG_PATH "CMake")
vcpkg_copy_pdbs()