From 3d20dc47c257c205bb482c0cf9bc91725c02fb1a Mon Sep 17 00:00:00 2001 From: Flavio Kreiliger Date: Thu, 6 Sep 2018 14:08:44 +0200 Subject: [PATCH] Fixed problems with compilation * Added trailing / to HERCULES_PASS_ROOT in Makefile to fix path problem during usage of the hercules compiler * Changed llvm-passes/include/Config/Options.h to solve errors during hercules configuration - enabled USE_HW_CACHES_INDWRITEBACK_LIBCALL, DONT_SPECIALIZE_EXECUTE and PREFETCH_REPS 1 --- Makefile | 4 +-- debian/patches/configuration.patch | 39 +++++++++++++++--------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 035f964..e2f656f 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ build_native/build.ninja: | build_native cd $(@D) && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(PREFIX)" \ -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_BACKTRACES=ON -DLLVM_ENABLE_WERROR=OFF \ -DBUILD_SHARED_LIBS=OFF -DLLVM_ENABLE_RTTI=ON \ - -DCMAKE_CXX_FLAGS='-DHERCULES_PASS_ROOT=\"$(PREFIX)/lib/hercules\"' \ + -DCMAKE_CXX_FLAGS='-DHERCULES_PASS_ROOT=\"$(PREFIX)/lib/hercules/\"' \ -G "Ninja" $(CURDIR)/llvm libpremnotify-cpu: export CC=$(DEB_HOST_GNU_TYPE)-gcc @@ -58,7 +58,7 @@ build/build.ninja: | build llvm/tools/clang llvm/projects/openmp cd $(@D) && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(PREFIX)" \ -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_BACKTRACES=ON -DLLVM_ENABLE_WERROR=OFF \ -DBUILD_SHARED_LIBS=OFF -DLLVM_ENABLE_RTTI=ON $(LLVM_CROSS_FLAGS) \ - -DCMAKE_CXX_FLAGS='-DHERCULES_PASS_ROOT=\"$(PREFIX)/lib/hercules\"' \ + -DCMAKE_CXX_FLAGS='-DHERCULES_PASS_ROOT=\"$(PREFIX)/lib/hercules/\"' \ -G "Ninja" $(CURDIR)/llvm $(TMP_DESTDIR)/$(PREFIX)/lib/cmake/llvm: | llvm-clang diff --git a/debian/patches/configuration.patch b/debian/patches/configuration.patch index cbf9f16..89054c0 100644 --- a/debian/patches/configuration.patch +++ b/debian/patches/configuration.patch @@ -1,10 +1,8 @@ Description: Configuration for TX2 according to M24CompilerRuntime.docx -Index: hercules-compiler/HerculesCompiler/llvm-passes/include/Config/Options.h -=================================================================== ---- hercules-compiler.orig/HerculesCompiler/llvm-passes/include/Config/Options.h -+++ hercules-compiler/HerculesCompiler/llvm-passes/include/Config/Options.h -@@ -41,17 +41,17 @@ +--- a/HerculesCompiler/llvm-passes/include/Config/Options.h ++++ b/HerculesCompiler/llvm-passes/include/Config/Options.h +@@ -41,22 +41,22 @@ //#define NEVER_INLINE_SYNC // Use hardware cache prefetches in Specialized function, in place of SPM-based. @@ -20,16 +18,21 @@ Index: hercules-compiler/HerculesCompiler/llvm-passes/include/Config/Options.h //#define USE_HW_CACHES_VOLALOAD // Use a single writeback function when using caches --//#define USE_HW_CACHES_SINGLEWRITEBACK -+#define USE_HW_CACHES_SINGLEWRITEBACK - //#define USE_HW_CACHES_INDWRITEBACK_LIBCALL + //#define USE_HW_CACHES_SINGLEWRITEBACK +-//#define USE_HW_CACHES_INDWRITEBACK_LIBCALL ++#define USE_HW_CACHES_INDWRITEBACK_LIBCALL //#define USE_HW_CACHES_INDWRITEBACK_INLINE -Index: hercules-compiler/clang/lib/Driver/ToolChains.cpp -=================================================================== ---- hercules-compiler.orig/clang/lib/Driver/ToolChains.cpp -+++ hercules-compiler/clang/lib/Driver/ToolChains.cpp -@@ -4967,7 +4967,7 @@ Tool *DragonFly::buildLinker() const { +-//#define DONT_SPECIALIZE_EXECUTE +-//#define PREFETCH_REPS 1 ++#define DONT_SPECIALIZE_EXECUTE ++#define PREFETCH_REPS 1 + + // Allow exporting of PREMized functions through external linkage (useful for + // compiling PREMized library functions). +--- a/clang/lib/Driver/ToolChains.cpp ++++ b/clang/lib/Driver/ToolChains.cpp +@@ -4967,7 +4967,7 @@ // 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 @@ -38,11 +41,9 @@ Index: hercules-compiler/clang/lib/Driver/ToolChains.cpp #endif #if OPENMP_NVPTX_COMPUTE_CAPABILITY < 60 -Index: hercules-compiler/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt -=================================================================== ---- hercules-compiler.orig/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt -+++ hercules-compiler/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt -@@ -66,7 +66,7 @@ if(LIBOMPTARGET_DEP_CUDA_FOUND) +--- a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt ++++ b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt +@@ -66,7 +66,7 @@ set(CUDA_ARCH ${CUDA_ARCH} -gencode arch=compute_${sm},code=sm_${sm}) endforeach() else() @@ -51,7 +52,7 @@ Index: hercules-compiler/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt endif() # Activate RTL message dumps if requested by the user. -@@ -176,7 +176,7 @@ if(LIBOMPTARGET_DEP_CUDA_FOUND) +@@ -176,7 +176,7 @@ set(CUDA_ARCH ${CUDA_ARCH} --cuda-gpu-arch=sm_${sm}) endforeach() else() -- 2.39.2