-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marc-André Moreau
committed
Nov 7, 2023
1 parent
539c808
commit adc8493
Showing
6 changed files
with
267 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
patches/halide-16-add-halide-host-tools-dir-cmake-option.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
From 58ad85758391a8058d6fdfebfefc0abae5539630 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= <[email protected]> | ||
Date: Sat, 21 Jan 2023 10:15:38 -0500 | ||
Subject: [PATCH] add HALIDE_HOST_TOOLS_DIR cmake option | ||
|
||
--- | ||
tools/CMakeLists.txt | 26 ++++++++++++++++++++------ | ||
1 file changed, 20 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt | ||
index 0d8ff8e8b..23d7b2496 100644 | ||
--- a/tools/CMakeLists.txt | ||
+++ b/tools/CMakeLists.txt | ||
@@ -2,14 +2,28 @@ | ||
# Build time tools | ||
## | ||
|
||
-add_executable(build_halide_h build_halide_h.cpp) | ||
-target_compile_options(build_halide_h PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/wd4996>) | ||
+if(DEFINED HALIDE_HOST_TOOLS_DIR) | ||
+ add_executable(build_halide_h IMPORTED GLOBAL) | ||
+ set_property(TARGET build_halide_h PROPERTY IMPORTED_LOCATION | ||
+ "${HALIDE_HOST_TOOLS_DIR}/build_halide_h${CMAKE_EXECUTABLE_SUFFIX}") | ||
|
||
-add_executable(binary2cpp binary2cpp.cpp) | ||
-target_compile_options(binary2cpp PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/wd4996>) | ||
+ add_executable(binary2cpp IMPORTED GLOBAL) | ||
+ set_property(TARGET binary2cpp PROPERTY IMPORTED_LOCATION | ||
+ "${HALIDE_HOST_TOOLS_DIR}/binary2cpp${CMAKE_EXECUTABLE_SUFFIX}") | ||
|
||
-add_executable(regexp_replace regexp_replace.cpp) | ||
-target_compile_options(regexp_replace PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/wd4996>) | ||
+ add_executable(regexp_replace IMPORTED GLOBAL) | ||
+ set_property(TARGET regexp_replace PROPERTY IMPORTED_LOCATION | ||
+ "${HALIDE_HOST_TOOLS_DIR}/regexp_replace${CMAKE_EXECUTABLE_SUFFIX}") | ||
+else() | ||
+ add_executable(build_halide_h build_halide_h.cpp) | ||
+ target_compile_options(build_halide_h PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/wd4996>) | ||
+ | ||
+ add_executable(binary2cpp binary2cpp.cpp) | ||
+ target_compile_options(binary2cpp PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/wd4996>) | ||
+ | ||
+ add_executable(regexp_replace regexp_replace.cpp) | ||
+ target_compile_options(regexp_replace PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/wd4996>) | ||
+endif() | ||
|
||
## | ||
# Interface target for enabling PNG/JPEG support in Halide | ||
-- | ||
2.25.1 | ||
|
54 changes: 54 additions & 0 deletions
54
patches/halide-16-add-llvm-host-bin-dir-cmake-option.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
From 7c51e8dfd9fa384b8a46574412238f9f0a1b2595 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= <[email protected]> | ||
Date: Tue, 7 Nov 2023 15:38:24 -0500 | ||
Subject: [PATCH] [PATCH] add LLVM_HOST_BIN_DIR cmake option | ||
|
||
--- | ||
dependencies/llvm/CMakeLists.txt | 22 ++++++++++++++++++---- | ||
1 file changed, 18 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/dependencies/llvm/CMakeLists.txt b/dependencies/llvm/CMakeLists.txt | ||
index bfb6967f3..85609e652 100644 | ||
--- a/dependencies/llvm/CMakeLists.txt | ||
+++ b/dependencies/llvm/CMakeLists.txt | ||
@@ -11,7 +11,7 @@ set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release MinSizeRel " | ||
set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE Release MinSizeRel RelWithDebInfo "") | ||
|
||
find_package(LLVM ${Halide_REQUIRE_LLVM_VERSION} REQUIRED) | ||
-find_package(Clang REQUIRED CONFIG HINTS "${LLVM_DIR}/../clang" "${LLVM_DIR}/../lib/cmake/clang") | ||
+find_package(Clang REQUIRED CONFIG HINTS "${Clang_DIR}" "${LLVM_DIR}/../clang" "${LLVM_DIR}/../lib/cmake/clang") | ||
|
||
set(LLVM_PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}" | ||
CACHE INTERNAL "LLVM version") | ||
@@ -58,11 +58,25 @@ cmake_dependent_option(Halide_BUNDLE_LLVM "When built as a static library, inclu | ||
# Promote LLVM/Clang executable targets | ||
## | ||
|
||
-set_target_properties(llvm-as clang PROPERTIES IMPORTED_GLOBAL TRUE) | ||
+if (LLVM_HOST_BIN_DIR) | ||
+ set_target_properties(llvm-as clang PROPERTIES IMPORTED_GLOBAL TRUE) | ||
+ set_property(TARGET llvm-as PROPERTY IMPORTED_LOCATION | ||
+ "${LLVM_HOST_BIN_DIR}/llvm-as${CMAKE_EXECUTABLE_SUFFIX}") | ||
+ set_property(TARGET clang PROPERTY IMPORTED_LOCATION | ||
+ "${LLVM_HOST_BIN_DIR}/clang${CMAKE_EXECUTABLE_SUFFIX}") | ||
|
||
-# clang-tools-extra is optional, but provides the clang-format target | ||
-if (TARGET clang-format) | ||
+ if (TARGET clang-format) | ||
set_target_properties(clang-format PROPERTIES IMPORTED_GLOBAL TRUE) | ||
+ set_property(TARGET clang-format PROPERTY IMPORTED_LOCATION | ||
+ "${LLVM_HOST_BIN_DIR}/clang-format${CMAKE_EXECUTABLE_SUFFIX}") | ||
+ endif () | ||
+else () | ||
+ set_target_properties(llvm-as clang PROPERTIES IMPORTED_GLOBAL TRUE) | ||
+ | ||
+ # clang-tools-extra is optional, but provides the clang-format target | ||
+ if (TARGET clang-format) | ||
+ set_target_properties(clang-format PROPERTIES IMPORTED_GLOBAL TRUE) | ||
+ endif () | ||
endif () | ||
|
||
## | ||
-- | ||
2.25.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From 644b27083565e1f6f2b010dc3cdc21259ade9880 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= <[email protected]> | ||
Date: Sun, 22 Jan 2023 08:01:56 -0500 | ||
Subject: [PATCH] disable autoschedulers | ||
|
||
--- | ||
src/CMakeLists.txt | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index 809b3efdd..8202c49d5 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -524,8 +524,8 @@ endif () | ||
## | ||
|
||
if (BUILD_SHARED_LIBS) | ||
- message(STATUS "Building autoschedulers enabled") | ||
- add_subdirectory(autoschedulers) | ||
+ #message(STATUS "Building autoschedulers enabled") | ||
+ #add_subdirectory(autoschedulers) | ||
else () | ||
message(STATUS "Building autoschedulers disabled (static Halide)") | ||
endif () | ||
-- | ||
2.25.1 | ||
|
25 changes: 25 additions & 0 deletions
25
patches/halide-16-disable-clang-verbose-build-warnings.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From b44261e5846f054b16901e6fe0d31d23cee8e74b Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= <[email protected]> | ||
Date: Tue, 7 Nov 2023 11:07:53 -0500 | ||
Subject: [PATCH] [PATCH] disable clang verbose build warnings | ||
|
||
--- | ||
src/CMakeLists.txt | 2 ++ | ||
1 file changed, 2 insertions(+) | ||
|
||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index 84f98033a..8fda27e5b 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -521,6 +521,8 @@ target_compile_options( | ||
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-undefined-func-template> | ||
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-unused-member-function> | ||
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-unused-template> | ||
+ $<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-unknown-warning-option> | ||
+ $<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-unsafe-buffer-usage> | ||
|
||
# This warning was removed in Clang 13 | ||
$<$<AND:$<CXX_COMPILER_ID:Clang,AppleClang>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,13.0>>:-Wno-return-std-move-in-c++11> | ||
-- | ||
2.25.1 | ||
|
34 changes: 34 additions & 0 deletions
34
patches/halide-16-disable-imported-clang-llvm-executables.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
From dfcb3a317b420e1e5b4f98506f0e9d12a4adb406 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= <[email protected]> | ||
Date: Sun, 22 Jan 2023 14:40:59 -0500 | ||
Subject: [PATCH] disable imported clang+llvm executable promotion | ||
|
||
--- | ||
dependencies/llvm/CMakeLists.txt | 4 ++++ | ||
1 file changed, 4 insertions(+) | ||
|
||
diff --git a/dependencies/llvm/CMakeLists.txt b/dependencies/llvm/CMakeLists.txt | ||
index 248aaf9ea..a8e613a37 100644 | ||
--- a/dependencies/llvm/CMakeLists.txt | ||
+++ b/dependencies/llvm/CMakeLists.txt | ||
@@ -42,6 +42,8 @@ cmake_dependent_option(Halide_BUNDLE_LLVM "When built as a static library, inclu | ||
# Promote LLVM/Clang executable targets | ||
## | ||
|
||
+if(PROMOTE_IMPORTED_CLANG_LLVM) | ||
+ | ||
set_target_properties(llvm-as clang PROPERTIES IMPORTED_GLOBAL TRUE) | ||
|
||
# clang-tools-extra is optional, but provides the clang-format target | ||
@@ -49,6 +51,8 @@ if (TARGET clang-format) | ||
set_target_properties(clang-format PROPERTIES IMPORTED_GLOBAL TRUE) | ||
endif () | ||
|
||
+endif() | ||
+ | ||
## | ||
# Create options for including or excluding LLVM backends. | ||
## | ||
-- | ||
2.25.1 | ||
|