From a3f15d049daa2659bb4d14e2153c839132b1f3b8 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sun, 6 May 2018 23:42:26 +0200 Subject: [PATCH 1/1] Add debian/patches etc. --- .gitignore | 1 + debian/patches/configuration.patch | 49 +++++++++++++++++++ debian/patches/install-passes.patch | 54 +++++++++++++++++++++ debian/patches/libpremnotify-makefile.patch | 15 ++++++ debian/patches/series | 3 ++ debian/source/format | 1 + 6 files changed, 123 insertions(+) create mode 100644 .gitignore create mode 100644 debian/patches/configuration.patch create mode 100644 debian/patches/install-passes.patch create mode 100644 debian/patches/libpremnotify-makefile.patch create mode 100644 debian/patches/series create mode 100644 debian/source/format diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26a7c92 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.pc/ diff --git a/debian/patches/configuration.patch b/debian/patches/configuration.patch new file mode 100644 index 0000000..83fe207 --- /dev/null +++ b/debian/patches/configuration.patch @@ -0,0 +1,49 @@ +Description: Configuration for TX2 according to M24CompilerRuntime.docx + +--- hercules-compiler-2017.11.orig/HerculesCompiler/llvm-passes/include/Config/Options.h ++++ hercules-compiler-2017.11/HerculesCompiler/llvm-passes/include/Config/Options.h +@@ -39,11 +39,11 @@ + //#define AGGRESSIVELY_INLINE_CALL_TREE + + // Use hardware cache prefetches in Specialized function, in place of SPM-based. +-//#define USE_HW_CACHES ++#define USE_HW_CACHES + + // If we use hardware caches, we can either use load or prefetch instructions + // to bring the data local. +-//#define USE_HW_CACHES_PREFETCH ++#define USE_HW_CACHES_PREFETCH + //#define USE_HW_CACHES_VOLALOAD + + +--- hercules-compiler-2017.11.orig/clang/lib/Driver/ToolChains.cpp ++++ hercules-compiler-2017.11/clang/lib/Driver/ToolChains.cpp +@@ -4967,7 +4967,7 @@ Tool *DragonFly::buildLinker() const { + // macro for it. Also, select the default PTX version to be used. We use 4.2 for + // compute capabilities older than 6.0 and 5.0 otherwise. + #ifndef OPENMP_NVPTX_COMPUTE_CAPABILITY +-#define OPENMP_NVPTX_COMPUTE_CAPABILITY 53 ++#define OPENMP_NVPTX_COMPUTE_CAPABILITY 62 + #endif + + #if OPENMP_NVPTX_COMPUTE_CAPABILITY < 60 +--- hercules-compiler-2017.11.orig/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt ++++ hercules-compiler-2017.11/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt +@@ -66,7 +66,7 @@ if(LIBOMPTARGET_DEP_CUDA_FOUND) + set(CUDA_ARCH ${CUDA_ARCH} -gencode arch=compute_${sm},code=sm_${sm}) + endforeach() + else() +- set(CUDA_ARCH -arch sm_35) ++ set(CUDA_ARCH -arch sm_62) + endif() + + # Activate RTL message dumps if requested by the user. +@@ -176,7 +176,7 @@ if(LIBOMPTARGET_DEP_CUDA_FOUND) + set(CUDA_ARCH ${CUDA_ARCH} --cuda-gpu-arch=sm_${sm}) + endforeach() + else() +- set(CUDA_ARCH --cuda-gpu-arch=sm_35) ++ set(CUDA_ARCH --cuda-gpu-arch=sm_62) + endif() + + # Compile cuda files to bitcode. diff --git a/debian/patches/install-passes.patch b/debian/patches/install-passes.patch new file mode 100644 index 0000000..4d97635 --- /dev/null +++ b/debian/patches/install-passes.patch @@ -0,0 +1,54 @@ +Description: Allow installing the Hercules passes + +--- hercules-compiler-2017.11.orig/HerculesCompiler/llvm-passes/src/Passes/AnnotatePTXGlobals/CMakeLists.txt ++++ hercules-compiler-2017.11/HerculesCompiler/llvm-passes/src/Passes/AnnotatePTXGlobals/CMakeLists.txt +@@ -7,3 +7,4 @@ add_library(AnnotatePTXGlobals + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/Macros.h + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/PassOptions.h ) + ++install(TARGETS AnnotatePTXGlobals LIBRARY DESTINATION lib/hercules/AnnotatePTXGlobals) +--- hercules-compiler-2017.11.orig/HerculesCompiler/llvm-passes/src/Passes/ChannelArgInsertion/CMakeLists.txt ++++ hercules-compiler-2017.11/HerculesCompiler/llvm-passes/src/Passes/ChannelArgInsertion/CMakeLists.txt +@@ -7,3 +7,5 @@ add_library(ChannelArgInsertion + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/Constants.h + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/PassOptions.h + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/Macros.h ) ++ ++install(TARGETS ChannelArgInsertion LIBRARY DESTINATION lib/hercules/ChannelArgInsertion) +--- hercules-compiler-2017.11.orig/HerculesCompiler/llvm-passes/src/Passes/LoopChunk/CMakeLists.txt ++++ hercules-compiler-2017.11/HerculesCompiler/llvm-passes/src/Passes/LoopChunk/CMakeLists.txt +@@ -6,4 +6,4 @@ add_library(LoopChunk SHARED LoopChunk.c + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/PassOptions.h + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/Macros.h + ) +- ++install(TARGETS LoopChunk LIBRARY DESTINATION lib/hercules/LoopChunk) +--- hercules-compiler-2017.11.orig/HerculesCompiler/llvm-passes/src/Passes/LoopExtract/CMakeLists.txt ++++ hercules-compiler-2017.11/HerculesCompiler/llvm-passes/src/Passes/LoopExtract/CMakeLists.txt +@@ -8,3 +8,5 @@ add_library(LoopExtract MODULE LoopExtra + + get_property(MODULE_FILE TARGET LoopExtract PROPERTY LOCATION) + #configure_file(run.sh.in run.sh @ONLY) ++ ++install(TARGETS LoopExtract LIBRARY DESTINATION lib/hercules/LoopExtract) +--- hercules-compiler-2017.11.orig/HerculesCompiler/llvm-passes/src/Passes/MarkLoopsToTransform/CMakeLists.txt ++++ hercules-compiler-2017.11/HerculesCompiler/llvm-passes/src/Passes/MarkLoopsToTransform/CMakeLists.txt +@@ -9,3 +9,4 @@ add_library(MarkLoopsToTransform + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/PassOptions.h + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/Macros.h ) + ++install(TARGETS MarkLoopsToTransform LIBRARY DESTINATION lib/hercules/MarkLoopsToTransform) +--- hercules-compiler-2017.11.orig/HerculesCompiler/llvm-passes/src/Passes/WarpSeparate/CMakeLists.txt ++++ hercules-compiler-2017.11/HerculesCompiler/llvm-passes/src/Passes/WarpSeparate/CMakeLists.txt +@@ -9,3 +9,4 @@ add_library(WarpSeparate + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/PassOptions.h + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/Macros.h ) + ++install(TARGETS WarpSeparate LIBRARY DESTINATION lib/hercules/WarpSeparate) +--- hercules-compiler-2017.11.orig/HerculesCompiler/llvm-passes/src/Passes/WarpSpecialize/CMakeLists.txt ++++ hercules-compiler-2017.11/HerculesCompiler/llvm-passes/src/Passes/WarpSpecialize/CMakeLists.txt +@@ -9,3 +9,4 @@ add_library(WarpSpecialize + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/PassOptions.h + ${PROJECTS_MAIN_INCLUDE_DIR}/Config/Macros.h ) + ++install(TARGETS WarpSpecialize LIBRARY DESTINATION lib/hercules/WarpSpecialize) diff --git a/debian/patches/libpremnotify-makefile.patch b/debian/patches/libpremnotify-makefile.patch new file mode 100644 index 0000000..45cbcd9 --- /dev/null +++ b/debian/patches/libpremnotify-makefile.patch @@ -0,0 +1,15 @@ +Description: Add Makefile for libpremnotify + This allows easy cross-compilation of the libpremnotify. + +--- /dev/null ++++ hercules-compiler-2017.11/HerculesCompiler/libpremnotify/Makefile +@@ -0,0 +1,9 @@ ++PREFIX=/usr/local ++ ++all: libpremnotify-cpu.a ++ ++libpremnotify-cpu.a: libpremnotify-cpu.o ++ $(AR) rcs $@ $^ ++ ++install: all ++ install -m 644 libpremnotify-cpu.a $(DESTDIR)$(PREFIX)/lib/hercules diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..76164b1 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,3 @@ +install-passes.patch +libpremnotify-makefile.patch +configuration.patch diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) -- 2.39.2