[halide] Update to version 10.0.0 (#13860)

* fix LLVM target-all feature

* [halide] bump Halide to version 10.0.0

* Use empty package policy to allow plugins to be located in lib.

This is following the recommendations in a conversation I had
with Robert Schumacher on the #vcpkg CppLang Slack channel.
This recommendation was derived from the fact that "cmake
defaults module DLLs into the lib folder, which makes vcpkg's
current policy very inconvenient for authors" and that I do not
plan to enable build systems other than CMake.

* [halide] skip x86-windows due to MSVC bug

* [halide] restore x64-windows-static fail status

* add usage file to Halide

* Update CONTROL version

* Remove '!emscripten` from ports/halide/CONTROL

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

Co-authored-by: Lily <47812810+LilyWangL@users.noreply.github.com>
Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
This commit is contained in:
Alex Reinking 2020-10-13 17:54:46 -07:00 committed by GitHub
parent 76031034d5
commit 7e3d3beac5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 131 additions and 187 deletions

View File

@ -1,49 +1,63 @@
Source: halide Source: halide
Version: master_2020_03_07 Version: 10.0.0
Homepage: https://github.com/halide/Halide 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. Description: Halide is a programming language designed to make it easier to write high-performance image and array processing code on modern machines.
Build-Depends: llvm[tools], openblas Supports: !uwp
Default-Features: jit
Build-Depends: llvm[enable-rtti,tools,clang]
Feature: app Feature: jit
Description: app support 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 Feature: target-all
Description: tutorials support 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 Feature: target-aarch64
Description: utils Description: Include AArch64 target
Build-Depends: llvm[core,target-aarch64]
Feature: nativeclient Feature: target-amdgpu
Description: nativeclient Description: Include AMDGPU target
Build-Depends: llvm[core,target-amdgpu]
Feature: hexagon Feature: target-arm
Description: hexagon Description: Include ARM target
Build-Depends: llvm[core,target-arm]
Feature: metal Feature: target-d3d12compute
Description: metal support Description: Include Direct3D 12 Compute target
Feature: mips Feature: target-hexagon
Description: mips support Description: Include Hexagon target
Build-Depends: llvm[core,target-hexagon]
Feature: powerpc Feature: target-metal
Description: powerpc support Description: Include Metal target
Feature: ptx Feature: target-mips
Description: ptx support Description: Include Mips target
Build-Depends: llvm[core,target-mips]
Feature: opencl Feature: target-nvptx
Build-Depends: opencl Description: Include NVPTX target
Description: opencl support Build-Depends: llvm[core,target-nvptx]
Feature: opengl Feature: target-opencl
Build-Depends: opengl Description: Include OpenCL-C target
Description: opengl support
Feature: rtti Feature: target-opengl
Description: rtti support Description: Include OpenGL/GLSL target
Feature: docs Feature: target-powerpc
Description: docs Description: Include PowerPC target
Build-Depends: llvm[core,target-powerpc]
Feature: test Feature: target-riscv
Description: test Description: Include RISCV target
Build-Depends: llvm[core,target-riscv]
Feature: target-x86
Description: Include X86 target
Build-Depends: llvm[core,target-x86]

View File

@ -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

View File

@ -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( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO halide/Halide REPO halide/Halide
REF f43293be3725bb959941e38c1b1fa9ae925f7389 REF fa9d6e1fa40c449883a7d64ca1fbc58ec94259af # refs/tags/v10.0.0
SHA512 f223185e208acf6c5b73353a6b5be815db5f2598f568596e800c35ea40b0babe4630da44229e14a5607e9d5e78298d07e7b36a9cbc7b71bf3e665bc12caff68e SHA512 e6da0b0798d921443a946159a67db8631e423d5bdd738c59ac872c1113cd40223f02f2bc63b3e7d6001eebb4c6b85a9229030f17f6082ae4e7c489d5612b966c
HEAD_REF master HEAD_REF release/10.x
PATCHES
fix-install-path.patch
) )
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 vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
app WITH_APPS target-aarch64 TARGET_AARCH64
test WITH_TESTS target-amdgpu TARGET_AMDGPU
tutorials WITH_TUTORIALS target-arm TARGET_ARM
docs WITH_DOCS target-d3d12compute TARGET_D3D12COMPUTE
utils WITH_UTILS target-hexagon TARGET_HEXAGON
nativeclient TARGET_NATIVE_CLIENT target-metal TARGET_METAL
hexagon TARGET_HEXAGON target-mips TARGET_MIPS
metal TARGET_METAL target-nvptx TARGET_NVPTX
mips TARGET_MIPS target-opencl TARGET_OPENCL
powerpc TARGET_POWERPC target-opengl TARGET_OPENGL
ptx TARGET_PTX target-powerpc TARGET_POWERPC
opencl TARGET_OPENCL target-riscv TARGET_RISCV
opengl TARGET_OPENGL target-x86 TARGET_X86
opengl TARGET_OPENGLCOMPUTE
rtti HALIDE_ENABLE_RTTI
) )
vcpkg_configure_cmake( vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH} SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA PREFER_NINJA
OPTIONS ${FEATURE_OPTIONS} OPTIONS ${FEATURE_OPTIONS}
-DTRIPLET_SYSTEM_ARCH=${TRIPLET_SYSTEM_ARCH} -DWITH_APPS=NO
-DHALIDE_SHARED_LIBRARY=${HALIDE_SHARED_LIBRARY} -DWITH_DOCS=NO
-DTARGET_X86=${TARGET_X86} -DWITH_PYTHON_BINDINGS=NO
-DTARGET_ARM=${TARGET_ARM} -DWITH_TESTS=NO
-DTARGET_AARCH64=${TARGET_AARCH64} -DWITH_TUTORIALS=NO
#-DTARGET_AMDGPU -DWITH_UTILS=NO
-DWARNINGS_AS_ERRORS=OFF -DCMAKE_INSTALL_LIBDIR=bin
-DCMAKE_INSTALL_DATADIR=share/${PORT}
-DHALIDE_INSTALL_CMAKEDIR=share/${PORT}
) )
vcpkg_install_cmake() 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() vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) vcpkg_fixup_cmake_targets()
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)
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 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})
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)

14
ports/halide/usage Normal file
View File

@ -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

View File

@ -1,10 +1,10 @@
Source: llvm Source: llvm
Version: 10.0.0 Version: 10.0.0
Port-Version: 5 Port-Version: 6
Homepage: https://llvm.org/ Homepage: https://llvm.org/
Description: The LLVM Compiler Infrastructure Description: The LLVM Compiler Infrastructure
Supports: !uwp Supports: !uwp
Default-Features: tools, enable-rtti, disable-assertions, disable-abi-breaking-checks, clang, disable-clang-static-analyzer, lld Default-Features: tools, enable-rtti, disable-assertions, disable-abi-breaking-checks, clang, disable-clang-static-analyzer, lld, default-targets
Feature: tools Feature: tools
Description: Build LLVM tools. Description: Build LLVM tools.
@ -12,8 +12,13 @@ Description: Build LLVM tools.
Feature: utils Feature: utils
Description: Build LLVM utils. Description: Build LLVM utils.
Feature: default-targets
Description: Build with platform-specific default targets
Build-Depends: llvm[core,target-x86] (x86|x64), llvm[core,target-arm] (arm&!arm64), llvm[core,target-aarch64] (arm64), llvm[core,target-all] (!x86&!x64&!arm&!arm64)
Feature: target-all Feature: target-all
Description: Build with all backends. Description: Build with all backends.
Build-Depends: llvm[core,target-aarch64,target-amdgpu,target-arm,target-bpf,target-hexagon,target-lanai,target-mips,target-msp430,target-nvptx,target-powerpc,target-riscv,target-sparc,target-systemz,target-webassembly,target-x86,target-xcore]
Feature: target-aarch64 Feature: target-aarch64
Description: Build with AArch64 backend. Description: Build with AArch64 backend.

View File

@ -92,72 +92,18 @@ if("polly" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_PROJECTS "polly") list(APPEND LLVM_ENABLE_PROJECTS "polly")
endif() endif()
set(LLVM_TARGETS_TO_BUILD) set(known_llvm_targets
if("target-all" IN_LIST FEATURES) AArch64 AMDGPU ARM BPF Hexagon Lanai Mips
set(LLVM_TARGETS_TO_BUILD "all") MSP430 NVPTX PowerPC RISCV Sparc SystemZ
else() WebAssembly X86 XCore)
if("target-aarch64" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "AArch64")
endif()
if("target-amdgpu" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "AMDGPU")
endif()
if("target-arm" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "ARM")
endif()
if("target-bpf" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "BPF")
endif()
if("target-hexagon" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "Hexagon")
endif()
if("target-lanai" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "Lanai")
endif()
if("target-mips" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "Mips")
endif()
if("target-msp430" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "MSP430")
endif()
if("target-nvptx" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "NVPTX")
endif()
if("target-powerpc" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "PowerPC")
endif()
if("target-riscv" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "RISCV")
endif()
if("target-sparc" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "Sparc")
endif()
if("target-systemz" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "SystemZ")
endif()
if("target-webassembly" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "WebAssembly")
endif()
if("target-x86" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "X86")
endif()
if("target-xcore" IN_LIST FEATURES)
list(APPEND LLVM_TARGETS_TO_BUILD "XCore")
endif()
endif()
# Detect target to build if not specified set(LLVM_TARGETS_TO_BUILD "")
if("${LLVM_TARGETS_TO_BUILD}" STREQUAL "") foreach(llvm_target IN LISTS known_llvm_targets)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") string(TOLOWER "target-${llvm_target}" feature_name)
set(LLVM_TARGETS_TO_BUILD "X86") if(feature_name IN_LIST FEATURES)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") list(APPEND LLVM_TARGETS_TO_BUILD "${llvm_target}")
set(LLVM_TARGETS_TO_BUILD "ARM")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(LLVM_TARGETS_TO_BUILD "AArch64")
else()
set(LLVM_TARGETS_TO_BUILD "all")
endif() endif()
endif() endforeach()
# Use comma-separated string instead of semicolon-separated string. # Use comma-separated string instead of semicolon-separated string.
# See https://github.com/microsoft/vcpkg/issues/4320 # See https://github.com/microsoft/vcpkg/issues/4320

View File

@ -523,6 +523,9 @@ h3:arm64-windows=fail
h3:arm-uwp=fail h3:arm-uwp=fail
h3:x64-uwp=fail h3:x64-uwp=fail
halide:x64-windows-static=fail halide:x64-windows-static=fail
# Halide depends on LLVM, which is mis-compiled by MSVC in x86-windows-dbg.
# See https://developercommunity.visualstudio.com/content/problem/1179643/msvc-copies-overaligned-non-trivially-copyable-par.html
halide:x86-windows=skip
hdf5:arm64-windows=fail hdf5:arm64-windows=fail
hdf5:arm-uwp=fail hdf5:arm-uwp=fail
hdf5:x64-uwp=fail hdf5:x64-uwp=fail