]> rtime.felk.cvut.cz Git - hercules2020/hercules-compiler.git/commitdiff
Compile libpremnotify-gpu only when nvcc is detected
authorMichal Sojka <michal.sojka@cvut.cz>
Tue, 20 Nov 2018 07:56:16 +0000 (08:56 +0100)
committerMichal Sojka <michal.sojka@cvut.cz>
Tue, 20 Nov 2018 07:56:16 +0000 (08:56 +0100)
And use gcc-5 when building debian package.

Makefile
debian/patches/libpremnotify-makefile.patch

index 3b3e29b3b97dabba570d741ea9c5b53c8049e611..3991a2d85e7f1b77984a56197039b7cb496e3379 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -54,7 +54,7 @@ build_native/build.ninja: | build_native
                -DCMAKE_CXX_FLAGS='-DHERCULES_PASS_ROOT=\"$(PREFIX)/lib/hercules/\"' \
                -G "Ninja" $(CURDIR)/llvm
 
-libpremnotify: export CC=$(DEB_HOST_GNU_TYPE)-gcc
+libpremnotify: export CC=$(DEB_HOST_GNU_TYPE)-gcc-5
 endif
 
 
index d0de472435dda3e1dd3c8c0a2e1be728f07f4ba5..4afbee289f3fdea0067fe036c95ccfbbbae87075 100644 (file)
@@ -1,12 +1,19 @@
+Index: hercules-compiler/HerculesCompiler/libpremnotify/Makefile
+===================================================================
 --- hercules-compiler.orig/HerculesCompiler/libpremnotify/Makefile
 +++ hercules-compiler/HerculesCompiler/libpremnotify/Makefile
-@@ -1,12 +1,22 @@
+@@ -1,12 +1,28 @@
  PREFIX=/usr/local
-+NVCC=$(or $(shell which nvcc),$(wildcard /usr/local/cuda/bin/nvcc),nvcc)
++NVCC=$(or $(shell which nvcc),$(wildcard /usr/local/cuda/bin/nvcc))
  
--all: libpremnotify-cpu.a
-+all: libpremnotify-cpu.a libpremnotify-gpu.a
+ all: libpremnotify-cpu.a
  
++ifneq ($(NVCC),)
++all: libpremnotify-gpu.a
++else
++$(info nvcc not detected. Not compiling libpremnotify-gpu)
++endif
++
  libpremnotify-cpu.a: libpremnotify-cpu.o
        $(AR) rcs $@ $^