Created attachment 1376623 [details] Recommended Patch Description of problem: Cuda 9.0 removed a macro (__CUDACC_VER__) without first deprecating it in the newly released Cuda 9.0. This macro is used by boost, and causes compilations to fail. This bug has been noted by boost, caffe, tensorflow, and other cuda libraries. See: <https://svn.boost.org/trac10/ticket/13152#no2>, <https://github.com/BVLC/caffe/issues/5994>, <https://github.com/tensorflow/tensorflow/issues/12489> A quick patch could fix the issue until boost hotfixes the release themselves (if they do). An example patch is attached. Version-Release number of selected component (if applicable): Boost 1.64 How reproducible: always Steps to Reproduce: 1. Install NVidia Cuda 9.0 2. Create main.cu: --- #include <boost/shared_ptr.hpp> int main(){ return 0; } --- 3. Try to compile: /usr/local/cuda/bin/nvcc main.cu Actual results: Compilation fails. [happest1@happest1-ll1 System]$ /usr/local/cuda/bin/nvcc -ccbin /usr/local/cuda-gcc-6/bin/compat-gcc65a-g++ main.cu In file included from /usr/local/cuda/bin/..//include/common_functions.h:50:0, from /usr/local/cuda/bin/..//include/cuda_runtime.h:115, from <command-line>:0: /usr/local/cuda/bin/..//include/crt/common_functions.h:64:24: error: token ""__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."" is not valid in preprocessor expressions #define __CUDACC_VER__ "__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead." ^ /usr/local/cuda/bin/..//include/crt/common_functions.h:64:24: error: token ""__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."" is not valid in preprocessor expressions #define __CUDACC_VER__ "__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead." Expected results: No warnings [happest1@happest1-ll1 System]$ sudo patch /usr/include/boost/config/compiler/nvcc.hpp -i boost.patch [sudo] password for happest1: patching file /usr/include/boost/config/compiler/nvcc.hpp [happest1@happest1-ll1 System]$ /usr/local/cuda/bin/nvcc -ccbin /usr/local/cuda-gcc-6/bin/compat-gcc65a-g++ main.cu [happest1@happest1-ll1 System]$ Additional info:
Created attachment 1376625 [details] Example test code (fails to compile without patch)
I can't use Cuda 9.0 on F27 anyway, as it doesn't work with GCC 7. Where does the /usr/local/cuda-gcc-6/bin/compat-gcc65a-g++ compiler come from?
There are various places you can download or compile GCC 6 to get it working with Cuda 9.0. Below are the instructions I used to build it. # Installing GCC 6.x Gcc 6.4 has a bug that prevents it from compiling with glibc-2.26. A patch has been applied to the upstream gcc-6 branch, but has not made its way into an official release yet (next release will be 6.5). So for now, we need to download the "trunk" for gcc 6, and compile that. * sudo dnf install flex texinfo gmp-devel mpfr-devel libmpc-devel #Needed to compile GCC. Flex is only needed when downloading from svn/git instead of an official source * git clone https://github.com/gcc-mirror/gcc.git * cd gcc * git checkout gcc-6-branch * ./configure --prefix=/usr/local/cuda-gcc-6 --program-prefix=compat-gcc65a- --disable-multilib * make -j 8 * sudo make install * sudo dnf remove flex texinfo gmp-devel mpfr-devel libmpc-devel #Remove compile-time dependencies * cd .. * rm -r gcc #Cleanup our build! Note that the new GCC version (including libraries, includes, etc) will be installed in /usr/local/cuda-gcc, where it shouldn't interfere with any other toolchains you might have, and will be easy to cleanup once NVidia releases a compatible version of CUDA.
Oh I see, so I can just point it at my existing gcc-6 builds, I assumed it was part of your Cuda installation. Let me try to reproduce this again then ...
boost-1.64.0-6.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-97c275d576
boost-1.63.0-12.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-b73bfea3af
boost-1.63.0-12.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-b73bfea3af
boost-1.64.0-6.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-97c275d576
boost-1.64.0-6.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.
boost-1.63.0-12.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.