From e8631cdbc0b46dd299180a7201e4318346515a85 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 24 Nov 2017 18:27:29 +0000 Subject: [PATCH 1/2] * Use ?= for some variables declarations * Remove the hardcoded declarations of llvm version in debian/rules --- debian/changelog | 2 ++ debian/rules | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8ddcf25b..1a5d6655 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ llvm-toolchain-4.0 (1:4.0.1-9) unstable; urgency=medium * Remove some old breaks/replaces/conflicts (<3.8) * Fix some wrong-section-according-to-package-name and priority-extra-is-replaced-by-priority-optional issues + * Use ?= for some variables declarations + * Remove the hardcoded declarations of llvm version in debian/rules -- Sylvestre Ledru Mon, 30 Oct 2017 19:41:20 +0100 diff --git a/debian/rules b/debian/rules index c666ccfe..3b290406 100755 --- a/debian/rules +++ b/debian/rules @@ -8,8 +8,9 @@ GXX_VERSIONED_PACKAGE := $(shell dpkg-query -W -f '$${Depends}' g++ | grep -o GXX_VERSIONED_EXECUTABLE := $(shell dpkg -L $(GXX_VERSIONED_PACKAGE) | grep '/usr/bin/g++-[0-9][0-9.]*' | xargs ls -d | tail -n1 ) GCC_VERSION := $(subst /usr/bin/g++-,,$(GXX_VERSIONED_EXECUTABLE)) -LLVM_VERSION := 4.0 -LLVM_VERSION_FULL := $(LLVM_VERSION).1 +LLVM_VERSION := $(shell dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9]+).([0-9]+).*,\1.\2,p" +) +LLVM_VERSION_FULL := $(shell dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9.]+)(~|-)(.*),\1,p") SONAME_EXT := 1 # Manage the case when the version is 1:3.5~svn213052-1~exp1 or 1:3.4.2-1 @@ -20,11 +21,11 @@ endif VENDOR=$(shell lsb_release -is) -DEB_HOST_MULTIARCH = $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) -DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_HOST_ARCH_BITS = $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS) -DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH) -DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS) +DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) LDFLAGS_EXTRA = CXXFLAGS_EXTRA = -std=c++0x From bf526e14acd306ff20c17b33586a4b425b7cb0e3 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 25 Nov 2017 09:16:48 +0000 Subject: [PATCH 2/2] add /usr/lib/cuda to the CUDA toolkit search paths Thanks to Andreas Beckmann for the patch (Closes: #882505) --- debian/changelog | 2 ++ debian/patches/series | 1 + debian/patches/update-cuda-search-path.patch | 22 ++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 debian/patches/update-cuda-search-path.patch diff --git a/debian/changelog b/debian/changelog index 1a5d6655..9c55bba2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ llvm-toolchain-4.0 (1:4.0.1-9) unstable; urgency=medium priority-extra-is-replaced-by-priority-optional issues * Use ?= for some variables declarations * Remove the hardcoded declarations of llvm version in debian/rules + * add /usr/lib/cuda to the CUDA toolkit search paths + Thanks to Andreas Beckmann for the patch (Closes: #882505) -- Sylvestre Ledru Mon, 30 Oct 2017 19:41:20 +0100 diff --git a/debian/patches/series b/debian/patches/series index a7fbcd5f..27600578 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -59,3 +59,4 @@ rL306353.diff rL306358.diff rL306379.diff sparc64-fix-stack-alignment.diff +update-cuda-search-path.patch diff --git a/debian/patches/update-cuda-search-path.patch b/debian/patches/update-cuda-search-path.patch new file mode 100644 index 00000000..f094bb9e --- /dev/null +++ b/debian/patches/update-cuda-search-path.patch @@ -0,0 +1,22 @@ +Author: Andreas Beckmann +Description: add /usr/lib/cuda to CUDA search paths + nvidia-cuda-toolkit/non-free now provides a shim monolitic cuda install + tree in /usr/lib/cuda (LP: #1706326) that could be used for + clang++ --cuda-path=/usr/lib/cuda + + let clang try that path by default, too, s.t. an explicit --cuda-path is + not needed for the nvidia-cuda-toolkit/non-free packages + + try the new path *after* the default paths /usr/local/cuda{,-X.Y} + to not interfere with cuda installations from nvidia's installer + +--- a/clang/lib/Driver/ToolChains.cpp ++++ b/clang/lib/Driver/ToolChains.cpp +@@ -1825,6 +1825,7 @@ CudaInstallationDetector::CudaInstallati + CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda"); + for (const char *Ver : Versions) + CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda-" + Ver); ++ CudaPathCandidates.push_back(D.SysRoot + "/usr/lib/cuda"); + } + + for (const auto &CudaPath : CudaPathCandidates) {