Control: tags -1 +patch

This patch simply discussed about the way getting NVCC
working with the compiler in README.Debian.

Please review.
From a9c1cc803ddc531c06e0f51c50c8b2f2eba22510 Mon Sep 17 00:00:00 2001
From: Zhou Mo <cdlumin...@gmail.com>
Date: Mon, 22 May 2017 07:53:07 +0000
Subject: [PATCH] README.Debian: discuss about getting NVCC working with
 compiler

This is what we can do from the CUDA packaging side in order to
Close #861878.
---
 nvidia-cuda-toolkit.README.Debian | 54 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/nvidia-cuda-toolkit.README.Debian b/nvidia-cuda-toolkit.README.Debian
index d6e7a3a..b702963 100644
--- a/nvidia-cuda-toolkit.README.Debian
+++ b/nvidia-cuda-toolkit.README.Debian
@@ -1,5 +1,59 @@
 nvidia-cuda-toolkit for Debian
 ------------------------------
+Contents:
+  1. Getting NVCC Working with the Compiler
+  2. Installing the CUDA Code Samples
+
+Getting NVCC Working with the Compiler
+======================================
+
+It is worth noting that not all compilers can be used together with NVCC.
+Here is a list of possible combinations:
+
+    ```
+    CXX compiler |  CUDA 7.5  |  CUDA 8.0  |  CUDA 9.0  |
+    -------------+------------+------------+------------+
+    GCC-8        |     ?      |     ?      |     ?      |
+    GCC-7        |     ?      |     ?      |     ?      |
+    GCC-6        |     X      |     X      |     OK     |
+    GCC-5        |     OK[1]  |     OK     |     OK     |
+    -------------+------------+------------+------------+
+    CLANG-4.0    |     ?      |     ?      |     ?      |
+    CLANG-3.9    |     X      |     X      |     OK     |
+    CLANG-3.8    |     ?      |     OK     |     OK     |
+    ```
+
+In the above table, '?' means 'not tested', 'X' means 'never work',
+'OK' means 'should work'.
+
+CUDA 8.0 Specific
+-----------------
+
+The recommended way, as declared in NEWS, to compile your CUDA application
+with CUDA 8.0 is to globally use clang-3.8/clang++-3.8 as the C/CXX compiler
+for your project. Example:
+
+  CC=clang-3.8 make
+
+However, when you have to mix the use of GCC and CLANG, things differ.
+Due to the difference on the default options of the two compilers, you
+may have to add flags such as -fPIC/-fPIE or alike to CLANG's argument
+list, to avoid the linkage failure as reported in BUG #861878 [2].
+See [3] for detail about these compiler options. Example:
+
+  nvcc -ccbin clang-3.8 --compiler-options -fPIC ...
+
+Sidenotes
+---------
+
+Debian Stretch ships CUDA 8.0, and the same time its default GCC is
+GCC-6. So we changed the default compiler to clang-3.8 for the CUDA 8.0
+package because Stretch ships no GCC-5.
+
+[1] CUDA 7.5 works with GCC-5 after begin patched.
+[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861878
+[3] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
+
 
 Installing the CUDA Code Samples
 =================================
-- 
2.11.0

Reply via email to