diff options
Diffstat (limited to 'ports/halide')
| -rw-r--r-- | ports/halide/CONTROL | 80 | ||||
| -rw-r--r-- | ports/halide/fix-install-path.patch | 35 | ||||
| -rw-r--r-- | ports/halide/portfile.cmake | 103 | ||||
| -rw-r--r-- | ports/halide/usage | 14 |
4 files changed, 111 insertions, 121 deletions
diff --git a/ports/halide/CONTROL b/ports/halide/CONTROL index fe1f94474..5de3a27db 100644 --- a/ports/halide/CONTROL +++ b/ports/halide/CONTROL @@ -1,49 +1,63 @@ Source: halide
-Version: master_2020_03_07
+Version: 10.0.0
Homepage: https://github.com/halide/Halide
-Description: Halide is a programming language designed to make it easier to write high-performance image processing code on modern machines.
-Build-Depends: llvm[tools], openblas
+Description: Halide is a programming language designed to make it easier to write high-performance image and array processing code on modern machines.
+Supports: !uwp
+Default-Features: jit
+Build-Depends: llvm[enable-rtti,tools,clang]
-Feature: app
-Description: app support
+Feature: jit
+Description: Include targets required for jit compilation
+Build-Depends: halide[core,target-x86] (x86|x64), halide[core,target-arm] (arm&!arm64), halide[core,target-aarch64] (arm64), halide[target-all] (!x86&!x64&!arm&!arm64)
-Feature: tutorials
-Description: tutorials support
+Feature: target-all
+Description: Include all targets
+Build-Depends: halide[core,target-aarch64,target-amdgpu,target-arm,target-d3d12compute,target-hexagon,target-metal,target-mips,target-nvptx,target-opencl,target-opengl,target-powerpc,target-riscv,target-x86]
-Feature: utils
-Description: utils
+Feature: target-aarch64
+Description: Include AArch64 target
+Build-Depends: llvm[core,target-aarch64]
-Feature: nativeclient
-Description: nativeclient
+Feature: target-amdgpu
+Description: Include AMDGPU target
+Build-Depends: llvm[core,target-amdgpu]
-Feature: hexagon
-Description: hexagon
+Feature: target-arm
+Description: Include ARM target
+Build-Depends: llvm[core,target-arm]
-Feature: metal
-Description: metal support
+Feature: target-d3d12compute
+Description: Include Direct3D 12 Compute target
-Feature: mips
-Description: mips support
+Feature: target-hexagon
+Description: Include Hexagon target
+Build-Depends: llvm[core,target-hexagon]
-Feature: powerpc
-Description: powerpc support
+Feature: target-metal
+Description: Include Metal target
-Feature: ptx
-Description: ptx support
+Feature: target-mips
+Description: Include Mips target
+Build-Depends: llvm[core,target-mips]
-Feature: opencl
-Build-Depends: opencl
-Description: opencl support
+Feature: target-nvptx
+Description: Include NVPTX target
+Build-Depends: llvm[core,target-nvptx]
-Feature: opengl
-Build-Depends: opengl
-Description: opengl support
+Feature: target-opencl
+Description: Include OpenCL-C target
-Feature: rtti
-Description: rtti support
+Feature: target-opengl
+Description: Include OpenGL/GLSL target
-Feature: docs
-Description: docs
+Feature: target-powerpc
+Description: Include PowerPC target
+Build-Depends: llvm[core,target-powerpc]
-Feature: test
-Description: test
\ No newline at end of file +Feature: target-riscv
+Description: Include RISCV target
+Build-Depends: llvm[core,target-riscv]
+
+Feature: target-x86
+Description: Include X86 target
+Build-Depends: llvm[core,target-x86]
diff --git a/ports/halide/fix-install-path.patch b/ports/halide/fix-install-path.patch deleted file mode 100644 index 5fb24ea45..000000000 --- a/ports/halide/fix-install-path.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 577b61ed2..7c6dd8ac4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -432,7 +432,7 @@ install(FILES - DESTINATION include) - - install(DIRECTORY tutorial -- DESTINATION . -+ DESTINATION share/halide - FILES_MATCHING - PATTERN "*.cpp" - PATTERN "*.h" -@@ -463,10 +463,10 @@ install(FILES - README.md - README_rungen.md - README_webassembly.md -- DESTINATION .) -+ DESTINATION share/halide) - - # ---- halide.cmake --install(FILES halide.cmake DESTINATION .) -+install(FILES halide.cmake DESTINATION share/halide) - - # ---- halide_config - file(GLOB FILES "${Halide_SOURCE_DIR}/tools/halide_config.*.tpl") -@@ -475,7 +475,7 @@ foreach(F ${FILES}) - string(REGEX REPLACE "\\.tpl$" "" FNAME "${FNAME}") # Strip .tpl extension - configure_file("${F}" "${CMAKE_BINARY_DIR}/${FNAME}" @ONLY) - install(FILES "${CMAKE_BINARY_DIR}/${FNAME}" -- DESTINATION .) -+ DESTINATION share/halide) - endforeach() - - add_custom_target(distrib diff --git a/ports/halide/portfile.cmake b/ports/halide/portfile.cmake index 4a6a04f72..c10b55531 100644 --- a/ports/halide/portfile.cmake +++ b/ports/halide/portfile.cmake @@ -1,73 +1,70 @@ +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +# Halide distributes some loadable modules that belong in lib on all platforms. +# CMake defaults module DLLs into the lib folder, which is incompatible with +# vcpkg’s current policy. This sidesteps that issue, a bit bluntly. +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO halide/Halide - REF f43293be3725bb959941e38c1b1fa9ae925f7389 - SHA512 f223185e208acf6c5b73353a6b5be815db5f2598f568596e800c35ea40b0babe4630da44229e14a5607e9d5e78298d07e7b36a9cbc7b71bf3e665bc12caff68e - HEAD_REF master - PATCHES - fix-install-path.patch + REF fa9d6e1fa40c449883a7d64ca1fbc58ec94259af # refs/tags/v10.0.0 + SHA512 e6da0b0798d921443a946159a67db8631e423d5bdd738c59ac872c1113cd40223f02f2bc63b3e7d6001eebb4c6b85a9229030f17f6082ae4e7c489d5612b966c + HEAD_REF release/10.x ) -set(TARGET_X86 OFF) -set(TARGET_ARM OFF) -set(TARGET_AARCH64 OFF) -if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86 OR VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - # llvm x86 components are required for llvm x64 - set(TARGET_X86 ON) -elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL arm) - set(TARGET_X86 OFF) - if (TARGET_TRIPLET STREQUAL arm64) - set(TARGET_AARCH64 ON) - else() - set(TARGET_ARM ON) - endif() -endif() - -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(HALIDE_SHARED_LIBRARY ON) -else() - set(HALIDE_SHARED_LIBRARY OFF) -endif() - vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - app WITH_APPS - test WITH_TESTS - tutorials WITH_TUTORIALS - docs WITH_DOCS - utils WITH_UTILS - nativeclient TARGET_NATIVE_CLIENT - hexagon TARGET_HEXAGON - metal TARGET_METAL - mips TARGET_MIPS - powerpc TARGET_POWERPC - ptx TARGET_PTX - opencl TARGET_OPENCL - opengl TARGET_OPENGL - opengl TARGET_OPENGLCOMPUTE - rtti HALIDE_ENABLE_RTTI + target-aarch64 TARGET_AARCH64 + target-amdgpu TARGET_AMDGPU + target-arm TARGET_ARM + target-d3d12compute TARGET_D3D12COMPUTE + target-hexagon TARGET_HEXAGON + target-metal TARGET_METAL + target-mips TARGET_MIPS + target-nvptx TARGET_NVPTX + target-opencl TARGET_OPENCL + target-opengl TARGET_OPENGL + target-powerpc TARGET_POWERPC + target-riscv TARGET_RISCV + target-x86 TARGET_X86 ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS ${FEATURE_OPTIONS} - -DTRIPLET_SYSTEM_ARCH=${TRIPLET_SYSTEM_ARCH} - -DHALIDE_SHARED_LIBRARY=${HALIDE_SHARED_LIBRARY} - -DTARGET_X86=${TARGET_X86} - -DTARGET_ARM=${TARGET_ARM} - -DTARGET_AARCH64=${TARGET_AARCH64} - #-DTARGET_AMDGPU - -DWARNINGS_AS_ERRORS=OFF + -DWITH_APPS=NO + -DWITH_DOCS=NO + -DWITH_PYTHON_BINDINGS=NO + -DWITH_TESTS=NO + -DWITH_TUTORIALS=NO + -DWITH_UTILS=NO + -DCMAKE_INSTALL_LIBDIR=bin + -DCMAKE_INSTALL_DATADIR=share/${PORT} + -DHALIDE_INSTALL_CMAKEDIR=share/${PORT} ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/halide) +vcpkg_copy_tools( + TOOL_NAMES + featurization_to_sample + get_host_target + retrain_cost_model + weightsdir_to_weightsfile + AUTO_CLEAN +) vcpkg_copy_pdbs() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/halide_config.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/halide-config.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/halide_config.make ${CURRENT_PACKAGES_DIR}/share/${PORT}/halide-config.make) +vcpkg_fixup_cmake_targets() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/tutorial) + +file(GLOB readmes "${CURRENT_PACKAGES_DIR}/share/${PORT}/*.md") +file(REMOVE ${readmes}) -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) +configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage COPYONLY) diff --git a/ports/halide/usage b/ports/halide/usage new file mode 100644 index 000000000..aa40a7dec --- /dev/null +++ b/ports/halide/usage @@ -0,0 +1,14 @@ +The package halide provides CMake targets:
+
+ find_package(Halide REQUIRED)
+
+ # JIT mode:
+ target_link_libraries(main PRIVATE Halide::Halide)
+
+ # AOT mode:
+ target_link_libraries(gen PRIVATE Halide::Generator)
+ add_halide_library(filter FROM gen)
+ target_link_libraries(main PRIVATE filter)
+
+For more information see:
+ https://github.com/halide/Halide/blob/v10.0.0/README_cmake.md
|
