aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/clfft
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/clfft')
-rw-r--r--vcpkg/ports/clfft/fix-build.patch25
-rw-r--r--vcpkg/ports/clfft/portfile.cmake34
-rw-r--r--vcpkg/ports/clfft/tweak-install.patch28
-rw-r--r--vcpkg/ports/clfft/vcpkg.json19
4 files changed, 106 insertions, 0 deletions
diff --git a/vcpkg/ports/clfft/fix-build.patch b/vcpkg/ports/clfft/fix-build.patch
new file mode 100644
index 0000000..65c3439
--- /dev/null
+++ b/vcpkg/ports/clfft/fix-build.patch
@@ -0,0 +1,25 @@
+diff --git a/src/library/generator.transpose.cpp b/src/library/generator.transpose.cpp
+index a04a43a..5c15882 100644
+--- a/src/library/generator.transpose.cpp
++++ b/src/library/generator.transpose.cpp
+@@ -1089,8 +1089,18 @@ clfftStatus genSwapKernelGeneral(const FFTGeneratedTransposeNonSquareAction::Sig
+
+ //std::string funcName = "swap_nonsquare_" + std::to_string(smaller_dim) + "_" + std::to_string(dim_ratio);
+ std::string funcName = "swap_nonsquare_";
+- std::string smaller_dim_str = static_cast<std::ostringstream*>(&(std::ostringstream() << smaller_dim))->str();
+- std::string dim_ratio_str = static_cast<std::ostringstream*>(&(std::ostringstream() << dim_ratio))->str();
++ std::string smaller_dim_str;
++ {
++ std::ostringstream oss;
++ oss << smaller_dim;
++ smaller_dim_str = oss.str();
++ }
++ std::string dim_ratio_str;
++ {
++ std::ostringstream oss;
++ oss << dim_ratio;
++ dim_ratio_str = oss.str();
++ }
+ if(params.fft_N[0] > params.fft_N[1])
+ funcName = funcName + smaller_dim_str + "_" + dim_ratio_str;
+ else
diff --git a/vcpkg/ports/clfft/portfile.cmake b/vcpkg/ports/clfft/portfile.cmake
new file mode 100644
index 0000000..64cda21
--- /dev/null
+++ b/vcpkg/ports/clfft/portfile.cmake
@@ -0,0 +1,34 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO clMathLibraries/clFFT
+ REF v2.12.2
+ SHA512 19e9a4e06f76ae7c7808d1188677d5553c43598886a75328b7801ab2ca68e35206839a58fe2f958a44a6f7c83284dc9461cd0e21c37d1042bf82e24aad066be8
+ HEAD_REF master
+ PATCHES
+ tweak-install.patch
+ fix-build.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}/src"
+ OPTIONS
+ -DCMAKE_CXX_STANDARD=11 # 17 removes std::unary_function
+ -DBUILD_LOADLIBRARIES=OFF
+ -DBUILD_EXAMPLES=OFF
+ -DSUFFIX_LIB=
+)
+
+vcpkg_cmake_install()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_cmake_config_fixup(CONFIG_PATH CMake)
+else()
+ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/clFFT)
+endif()
+
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/clfft/tweak-install.patch b/vcpkg/ports/clfft/tweak-install.patch
new file mode 100644
index 0000000..4595203
--- /dev/null
+++ b/vcpkg/ports/clfft/tweak-install.patch
@@ -0,0 +1,28 @@
+diff --git a/src/clFFTConfig.cmake.in b/src/clFFTConfig.cmake.in
+index 5b58c35..ee749a2 100644
+--- a/src/clFFTConfig.cmake.in
++++ b/src/clFFTConfig.cmake.in
+@@ -1,3 +1,3 @@
+ include(${CMAKE_CURRENT_LIST_DIR}/clFFTTargets.cmake)
+-get_filename_component(CLFFT_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/@reldir@/include ABSOLUTE)
++get_filename_component(CLFFT_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/@reldir@/../include ABSOLUTE)
+ set(CLFFT_LIBRARIES clFFT)
+diff --git a/src/library/CMakeLists.txt b/src/library/CMakeLists.txt
+index 132ef86..12ba905 100644
+--- a/src/library/CMakeLists.txt
++++ b/src/library/CMakeLists.txt
+@@ -90,6 +90,7 @@ target_link_libraries( clFFT ${OPENCL_LIBRARIES} ${CMAKE_DL_LIBS} )
+ set_target_properties( clFFT PROPERTIES VERSION ${CLFFT_VERSION} )
+ set_target_properties( clFFT PROPERTIES SOVERSION ${CLFFT_SOVERSION} )
+ set_target_properties( clFFT PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/staging" )
++set_target_properties( clFFT PROPERTIES INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:include> )
+
+ if( CMAKE_COMPILER_IS_GNUCC )
+ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/clFFT.pc.in
+@@ -104,5 +105,5 @@ install( TARGETS clFFT
+ EXPORT Library
+ RUNTIME DESTINATION bin${SUFFIX_BIN}
+ LIBRARY DESTINATION lib${SUFFIX_LIB}
+- ARCHIVE DESTINATION lib${SUFFIX_LIB}/import
++ ARCHIVE DESTINATION lib${SUFFIX_LIB}
+ )
diff --git a/vcpkg/ports/clfft/vcpkg.json b/vcpkg/ports/clfft/vcpkg.json
new file mode 100644
index 0000000..dbb4100
--- /dev/null
+++ b/vcpkg/ports/clfft/vcpkg.json
@@ -0,0 +1,19 @@
+{
+ "name": "clfft",
+ "version": "2.12.2",
+ "port-version": 7,
+ "description": "clFFT is an OpenCL 1.2 accelerated Fast Fourier Transform library.",
+ "homepage": "https://github.com/clMathLibraries/clFFT",
+ "license": "Apache-2.0",
+ "dependencies": [
+ "opencl",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}