]> rtime.felk.cvut.cz Git - hercules2020/hercules-compiler.git/commitdiff
Use gcc-5 to avoid various compile errors
authorMichal Sojka <michal.sojka@cvut.cz>
Thu, 6 Sep 2018 14:37:13 +0000 (16:37 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Thu, 6 Sep 2018 20:54:39 +0000 (22:54 +0200)
nvcc fails in strange ways with gcc-6. Even if we build with CUDA 9,
where gcc-6 is officially supported.

Makefile
README.md
debian/control

index e2f656f0c8b49310d02bf3a3061964a514fe4115..d89a1e24f7b80ccbf08c57c0b3315456b5c85623 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,10 @@
 PREFIX ?= $(HOME)/opt/hercules-compiler
 TMP_DESTDIR = $(CURDIR)/install
 
+# With gcc > 5, we get strange CUDA-related errors in clang.
+export CC = gcc-5
+export CXX = g++-5
+
 all: libpremnotify-cpu
 all: passes
 
@@ -23,8 +27,8 @@ ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
 LLVM_TBLGEN=$(CURDIR)/build_native/bin/llvm-tblgen
 CLANG_TBLGEN=$(CURDIR)/build_native/bin/clang-tblgen
 
-LLVM_CROSS_FLAGS += -DCMAKE_C_COMPILER=$(DEB_HOST_GNU_TYPE)-gcc
-LLVM_CROSS_FLAGS += -DCMAKE_CXX_COMPILER=$(DEB_HOST_GNU_TYPE)-g++
+LLVM_CROSS_FLAGS += -DCMAKE_C_COMPILER=$(DEB_HOST_GNU_TYPE)-gcc-5
+LLVM_CROSS_FLAGS += -DCMAKE_CXX_COMPILER=$(DEB_HOST_GNU_TYPE)-g++-5
 LLVM_CROSS_FLAGS += -DCMAKE_SYSTEM_PROCESSOR=$(DEB_HOST_GNU_CPU)
 
 LLVM_CROSS_FLAGS += -DCMAKE_CROSSCOMPILING=True
index 9465815ed663f0e3bc3405ccd3a3a510d6b8fd4c..efaed21cccefcb483c90264476ae93b8d286727f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -26,10 +26,17 @@ Simple method
 
 A simple method to create a native Debian package is the following:
 
-    apt install build-essential cmake ninja-build python3
+    apt install build-essential cmake ninja-build python3 gcc-5 g++-5
     make create-orig-tgz
     dpkg-buildpackage -uc -us
 
+Note that gcc-5 may not be available in newer distributions such as
+Debian Stretch. It is possible to compile it from source. For example
+download its
+[Debian source package](http://ftp.debian.org/debian/pool/main/g/gcc-5/)
+and build it with `DEB_BUILD_OPTIONS="nolang=ada,fortran,java,objc"
+dpkg-buildpackage -b -uc -us`.
+
 Sbuild method - native
 ----------------------
 
index 4877e976b3cc0d6798ea3373571483883d59fe30..35d6cb63f252f6e8a68f9c6678d5cf6b453d8364 100644 (file)
@@ -2,7 +2,7 @@ Source: hercules-compiler
 Section: devel
 Priority: optional
 Maintainer: Michal Sojka <michal.sojka@cvut.cz>
-Build-Depends: debhelper (>= 9), cmake (>= 3.7.2), ninja-build, python3:any, libffi-dev, libelf-dev
+Build-Depends: debhelper (>= 9), cmake (>= 3.7.2), ninja-build, python3:any, libffi-dev, libelf-dev, gcc-5:native, g++-5:native
 Standards-Version: 3.9.8
 Homepage: https://iis-git.ee.ethz.ch/H2020-Compiler/HerculesCompiler
 #Vcs-Git: https://anonscm.debian.org/collab-maint/hercules-compiler.git