diff --git a/boost-1.64.0-config-cuda-version.patch b/boost-1.64.0-config-cuda-version.patch new file mode 100644 index 0000000..bf91c4b --- /dev/null +++ b/boost-1.64.0-config-cuda-version.patch @@ -0,0 +1,86 @@ +From 17a4997aaa05ce92237c73c82e6d8fb475a0abaf Mon Sep 17 00:00:00 2001 +From: jzmaddock +Date: Fri, 11 Aug 2017 19:38:00 +0100 +Subject: [PATCH 1/2] Update for CUDA version macro changes. + +--- + include/boost/config/compiler/nvcc.hpp | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/include/boost/config/compiler/nvcc.hpp b/include/boost/config/compiler/nvcc.hpp +index 43039b5c2..907eade96 100644 +--- a/include/boost/config/compiler/nvcc.hpp ++++ b/include/boost/config/compiler/nvcc.hpp +@@ -11,6 +11,15 @@ + # define BOOST_COMPILER "NVIDIA CUDA C++ Compiler" + #endif + ++#if defined(__CUDACC_VER_MAJOR__) && defined(__CUDACC_VER_MINOR__) && defined(__CUDACC_VER_BUILD__) ++# define BOOST_CUDA_VERSION __CUDACC_VER_MAJOR__ * 10000 + __CUDACC_VER_MINOR__ * 100 + __CUDACC_VER_BUILD__ ++#elif defined(__CUDACC_VER__) ++ define BOOST_CUDA_VERSION __CUDACC_VER__ ++#else ++// We don't really know what the CUDA version is, but it's definitely before 7.5: ++# define BOOST_CUDA_VERSION 70000 ++#endif ++ + // NVIDIA Specific support + // BOOST_GPU_ENABLED : Flag a function or a method as being enabled on the host and device + #define BOOST_GPU_ENABLED __host__ __device__ +@@ -19,11 +28,11 @@ + // https://svn.boost.org/trac/boost/ticket/11897 + // This is fixed in 7.5. As the following version macro was introduced in 7.5 an existance + // check is enough to detect versions < 7.5 +-#if !defined(__CUDACC_VER__) || (__CUDACC_VER__ < 70500) ++#if BOOST_CUDA_VERSION < 70500 + # define BOOST_NO_CXX11_VARIADIC_TEMPLATES + #endif + // The same bug is back again in 8.0: +-#if (__CUDACC_VER__ > 80000) && (__CUDACC_VER__ < 80100) ++#if (BOOST_CUDA_VERSION > 80000) && (BOOST_CUDA_VERSION < 80100) + # define BOOST_NO_CXX11_VARIADIC_TEMPLATES + #endif + // Most recent CUDA (8.0) has no constexpr support in msvc mode: + +From 593389dc4b4dae14e6d38bb1c81b7bf70ec21f26 Mon Sep 17 00:00:00 2001 +From: jzmaddock +Date: Fri, 18 Aug 2017 18:13:38 +0100 +Subject: [PATCH 2/2] Update nvcc.hpp + +--- + include/boost/config/compiler/nvcc.hpp | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/include/boost/config/compiler/nvcc.hpp b/include/boost/config/compiler/nvcc.hpp +index 907eade96..f21b9b54f 100644 +--- a/include/boost/config/compiler/nvcc.hpp ++++ b/include/boost/config/compiler/nvcc.hpp +@@ -12,12 +12,10 @@ + #endif + + #if defined(__CUDACC_VER_MAJOR__) && defined(__CUDACC_VER_MINOR__) && defined(__CUDACC_VER_BUILD__) +-# define BOOST_CUDA_VERSION __CUDACC_VER_MAJOR__ * 10000 + __CUDACC_VER_MINOR__ * 100 + __CUDACC_VER_BUILD__ +-#elif defined(__CUDACC_VER__) +- define BOOST_CUDA_VERSION __CUDACC_VER__ ++# define BOOST_CUDA_VERSION __CUDACC_VER_MAJOR__ * 1000000 + __CUDACC_VER_MINOR__ * 10000 + __CUDACC_VER_BUILD__ + #else + // We don't really know what the CUDA version is, but it's definitely before 7.5: +-# define BOOST_CUDA_VERSION 70000 ++# define BOOST_CUDA_VERSION 7000000 + #endif + + // NVIDIA Specific support +@@ -28,11 +26,11 @@ + // https://svn.boost.org/trac/boost/ticket/11897 + // This is fixed in 7.5. As the following version macro was introduced in 7.5 an existance + // check is enough to detect versions < 7.5 +-#if BOOST_CUDA_VERSION < 70500 ++#if BOOST_CUDA_VERSION < 7050000 + # define BOOST_NO_CXX11_VARIADIC_TEMPLATES + #endif + // The same bug is back again in 8.0: +-#if (BOOST_CUDA_VERSION > 80000) && (BOOST_CUDA_VERSION < 80100) ++#if (BOOST_CUDA_VERSION > 8000000) && (BOOST_CUDA_VERSION < 8010000) + # define BOOST_NO_CXX11_VARIADIC_TEMPLATES + #endif + // Most recent CUDA (8.0) has no constexpr support in msvc mode: diff --git a/boost.spec b/boost.spec index caaff92..85bb4fc 100644 --- a/boost.spec +++ b/boost.spec @@ -155,6 +155,10 @@ Patch87: boost-1.64.0-icl-undefined-shift.patch # https://svn.boost.org/trac10/ticket/13036 Patch90: boost-1.64.0-regex-overflow.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1530828 +# https://github.com/boostorg/config/pull/175 +Patch91: boost-1.64.0-config-cuda-version.patch + %bcond_with tests %bcond_with docs_generated @@ -773,6 +777,7 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x %patch86 -p2 %patch87 -p2 %patch90 -p2 +%patch91 -p2 # At least python2_version needs to be a macro so that it's visible in # %%install as well. @@ -1564,6 +1569,7 @@ fi %changelog * Wed Apr 18 2018 Jonathan Wakely - 1.64.0-6 - Add patch for Boost.Regex integer overflow (#1564252) +- Add patch for CUDA version macro changes (#1530828) * Wed Feb 28 2018 Jonathan Wakely - 1.64.0-5 - Move Requires: boost-container out of conditional block.