aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNagy-Egri Máté Ferenc <csiga.biga@aol.com>2018-03-09 06:28:00 +0100
committerRobert Schumacher <roschuma@microsoft.com>2018-03-08 21:28:00 -0800
commita506559ba9ff9aab7a6176b43313a8ce26891269 (patch)
tree584de456438ba0b06d0e0bbeff5e299328057566
parent7955320bf358b27d1fa30cc650a254bfb48825a3 (diff)
downloadvcpkg-a506559ba9ff9aab7a6176b43313a8ce26891269.tar.gz
vcpkg-a506559ba9ff9aab7a6176b43313a8ce26891269.zip
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
-rw-r--r--ports/clblas/CONTROL4
-rw-r--r--ports/clblas/cmake.patch36
-rw-r--r--ports/clblas/portfile.cmake55
3 files changed, 95 insertions, 0 deletions
diff --git a/ports/clblas/CONTROL b/ports/clblas/CONTROL
new file mode 100644
index 000000000..416376579
--- /dev/null
+++ b/ports/clblas/CONTROL
@@ -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.
diff --git a/ports/clblas/cmake.patch b/ports/clblas/cmake.patch
new file mode 100644
index 000000000..ebe2c0e85
--- /dev/null
+++ b/ports/clblas/cmake.patch
@@ -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
diff --git a/ports/clblas/portfile.cmake b/ports/clblas/portfile.cmake
new file mode 100644
index 000000000..b18377cdf
--- /dev/null
+++ b/ports/clblas/portfile.cmake
@@ -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() \ No newline at end of file