[arch-commits] Commit in root/trunk (PKGBUILD fix_cuda_cxx17.patch)

Konstantin Gizdov kgizdov at archlinux.org
Mon Jul 27 12:22:53 UTC 2020


    Date: Monday, July 27, 2020 @ 12:22:53
  Author: kgizdov
Revision: 665441

upgpkg: root 6.22.00-4: use better cxx17 patch

Modified:
  root/trunk/PKGBUILD
  root/trunk/fix_cuda_cxx17.patch

----------------------+
 PKGBUILD             |    4 
 fix_cuda_cxx17.patch |  294 ++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 294 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-07-27 12:08:54 UTC (rev 665440)
+++ PKGBUILD	2020-07-27 12:22:53 UTC (rev 665441)
@@ -7,7 +7,7 @@
 pkgbase=root
 pkgname=('root' 'root-cuda')
 pkgver=6.22.00
-pkgrel=3
+pkgrel=4
 pkgdesc='C++ data analysis framework and interpreter from CERN'
 arch=('x86_64')
 url='https://root.cern'
@@ -105,7 +105,7 @@
             '12814f50b7016bd86d3f91e0e31c052783a0c0fa72b7d6a072d3ae6f86c2437323d585e531235377ebbfdd9cb76abd7da84d9631de821151547f1d4b13417e69'
             'ff555ac4db568affe139701907f86d919a2206f3e304f69dd317b756ea0904b5934d9364a524060778aa507809ce78448621619bb34039ba34c5a71af71a4a8c'
             '2ae126795df4127c27a6287a1499bdb8b2bacb74cfbec17dabe378a5fb9fc7c755644e4090a4da1d0045bf5d4f542f06da827a0f48a5927ee8509874045f18b6'
-            'f7dbbd4ba08dd6e7d631b1cd9414ea51bfe64d8074835c9ccd95bcbdba1e72107b928df97738dde04c8e2e5399432cc748fd6b6188c372eb085b188962255640')
+            'b437f3b2a50efe5b482727bd8c1d606d8b572fbca1f2fab6255e521a084810c0cf1c5b09a561e2efca76934182fe5ec4a284286556860ffa31f7113be8a95c12')
 
 get_pyver () {
     python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'

Modified: fix_cuda_cxx17.patch
===================================================================
--- fix_cuda_cxx17.patch	2020-07-27 12:08:54 UTC (rev 665440)
+++ fix_cuda_cxx17.patch	2020-07-27 12:22:53 UTC (rev 665441)
@@ -1,7 +1,7 @@
 From 62fff7d03d8785a69f56115b27081fe1081edc9b Mon Sep 17 00:00:00 2001
 From: Konstantin Gizdov <kgizdov at gmail.com>
 Date: Fri, 24 Jul 2020 18:23:49 +0300
-Subject: [PATCH 1/2] fix regression in f8edeb9 not using correct string_view
+Subject: [PATCH 1/6] fix regression in f8edeb9 not using correct string_view
  when CUDA C++ standard allows it
 
 ---
@@ -106,7 +106,7 @@
 From d30bf0190f668434f23875e201a80450b6d2dddb Mon Sep 17 00:00:00 2001
 From: Konstantin Gizdov <kgizdov at gmail.com>
 Date: Fri, 24 Jul 2020 18:53:53 +0300
-Subject: [PATCH 2/2] set R__CUDA_HAS_STD_STRING_VIEW to undef in all other
+Subject: [PATCH 2/6] set R__CUDA_HAS_STD_STRING_VIEW to undef in all other
  cases
 
 ---
@@ -125,3 +125,293 @@
  if(found_stdstringview)
    CHECK_CXX_SOURCE_COMPILES("#include <string_view>
       int main() { size_t pos; std::string_view str; std::stod(str,&pos); return 0;}" found_stod_stringview)
+
+From 5e473046f480af31e038b04a0a8101f3c86ab590 Mon Sep 17 00:00:00 2001
+From: Konstantin Gizdov <kgizdov at gmail.com>
+Date: Sat, 25 Jul 2020 01:48:18 +0300
+Subject: [PATCH 3/6] re-locate to correct place in configuration and check by
+ compilation
+
+---
+ cmake/modules/RootConfiguration.cmake | 43 ++++++++++++++++++++++++---
+ 1 file changed, 39 insertions(+), 4 deletions(-)
+
+diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake
+index c9f7206d12c..d306245199c 100644
+--- a/cmake/modules/RootConfiguration.cmake
++++ b/cmake/modules/RootConfiguration.cmake
+@@ -512,10 +512,49 @@ unset(found_stdexpstringview CACHE)
+ unset(found_stod_stringview CACHE)
+ 
+ set(hasstdexpstringview undef)
++set(cudahasstdstringview undef)
+ CHECK_CXX_SOURCE_COMPILES("#include <string_view>
+   int main() { char arr[3] = {'B', 'a', 'r'}; std::string_view strv(arr, sizeof(arr)); return 0;}" found_stdstringview)
+ if(found_stdstringview)
+   set(hasstdstringview define)
++  if(cuda)
++    if(CMAKE_CUDA_STANDARD GREATER_EQUAL CMAKE_CXX_STANDARD)
++      # CUDA_NVCC_EXECUTABLE
++      if(DEFINED ENV{CUDA_NVCC_EXECUTABLE})
++        set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler")
++      else()
++        find_program(CUDA_NVCC_EXECUTABLE
++          NAMES nvcc nvcc.exe
++          PATHS "${CUDA_TOOLKIT_ROOT_DIR}"
++            ENV CUDA_TOOKIT_ROOT
++            ENV CUDA_PATH
++            ENV CUDA_BIN_PATH
++          PATH_SUFFIXES bin bin64
++          DOC "The CUDA compiler"
++          NO_DEFAULT_PATH
++        )
++        find_program(CUDA_NVCC_EXECUTABLE
++          NAMES nvcc nvcc.exe
++          PATHS /opt/cuda/bin
++          PATH_SUFFIXES cuda/bin
++          DOC "The CUDA compiler"
++        )
++        # Search default search paths, after we search our own set of paths.
++        find_program(CUDA_NVCC_EXECUTABLE nvcc)
++      endif()
++      mark_as_advanced(CUDA_NVCC_EXECUTABLE)
++      if(CUDA_NVCC_EXECUTABLE)
++        execute_process(COMMAND "echo"
++          "-e" "#include <string_view>\nint main() { char arr[3] = {'B', 'a', 'r'}; std::string_view strv(arr, sizeof(arr)); return 0;}"
++          "|"
++          "${CUDA_NVCC_EXECUTABLE}" "-std=c++${CMAKE_CUDA_STANDARD}" "-o" "/dev/null" "-x" "c++" "-"
++          RESULT_VARIABLE nvcc_compiled_string_view)
++        if (nvcc_compiled_string_view EQUAL "0")
++          set(cudahasstdstringview define)
++        endif()
++      endif()
++    endif()
++  endif()
+ else()
+   set(hasstdstringview undef)
+ 
+@@ -528,13 +567,9 @@ else()
+   endif()
+ endif()
+ 
+-set(cudahasstdstringview undef)
+ if(found_stdstringview)
+   CHECK_CXX_SOURCE_COMPILES("#include <string_view>
+      int main() { size_t pos; std::string_view str; std::stod(str,&pos); return 0;}" found_stod_stringview)
+-  if(CMAKE_CUDA_STANDARD GREATER_EQUAL CMAKE_CXX_STANDARD)
+-    set(cudahasstdstringview define)
+-  endif()
+ elseif(found_stdexpstringview)
+   CHECK_CXX_SOURCE_COMPILES("#include <experimental/string_view>
+      int main() { size_t pos; std::experimental::string_view str; std::stod(str,&pos); return 0;}" found_stod_stringview)
+
+From 32e1f3c0cec557c4fa82a07992ae9c1cd4075fcf Mon Sep 17 00:00:00 2001
+From: Konstantin Gizdov <kgizdov at gmail.com>
+Date: Sat, 25 Jul 2020 01:50:20 +0300
+Subject: [PATCH 4/6] no need to compare C++ standard between CUDA and host
+ anymore
+
+---
+ cmake/modules/RootConfiguration.cmake | 66 +++++++++++++--------------
+ 1 file changed, 32 insertions(+), 34 deletions(-)
+
+diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake
+index d306245199c..2eff954ef94 100644
+--- a/cmake/modules/RootConfiguration.cmake
++++ b/cmake/modules/RootConfiguration.cmake
+@@ -518,40 +518,38 @@ CHECK_CXX_SOURCE_COMPILES("#include <string_view>
+ if(found_stdstringview)
+   set(hasstdstringview define)
+   if(cuda)
+-    if(CMAKE_CUDA_STANDARD GREATER_EQUAL CMAKE_CXX_STANDARD)
+-      # CUDA_NVCC_EXECUTABLE
+-      if(DEFINED ENV{CUDA_NVCC_EXECUTABLE})
+-        set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler")
+-      else()
+-        find_program(CUDA_NVCC_EXECUTABLE
+-          NAMES nvcc nvcc.exe
+-          PATHS "${CUDA_TOOLKIT_ROOT_DIR}"
+-            ENV CUDA_TOOKIT_ROOT
+-            ENV CUDA_PATH
+-            ENV CUDA_BIN_PATH
+-          PATH_SUFFIXES bin bin64
+-          DOC "The CUDA compiler"
+-          NO_DEFAULT_PATH
+-        )
+-        find_program(CUDA_NVCC_EXECUTABLE
+-          NAMES nvcc nvcc.exe
+-          PATHS /opt/cuda/bin
+-          PATH_SUFFIXES cuda/bin
+-          DOC "The CUDA compiler"
+-        )
+-        # Search default search paths, after we search our own set of paths.
+-        find_program(CUDA_NVCC_EXECUTABLE nvcc)
+-      endif()
+-      mark_as_advanced(CUDA_NVCC_EXECUTABLE)
+-      if(CUDA_NVCC_EXECUTABLE)
+-        execute_process(COMMAND "echo"
+-          "-e" "#include <string_view>\nint main() { char arr[3] = {'B', 'a', 'r'}; std::string_view strv(arr, sizeof(arr)); return 0;}"
+-          "|"
+-          "${CUDA_NVCC_EXECUTABLE}" "-std=c++${CMAKE_CUDA_STANDARD}" "-o" "/dev/null" "-x" "c++" "-"
+-          RESULT_VARIABLE nvcc_compiled_string_view)
+-        if (nvcc_compiled_string_view EQUAL "0")
+-          set(cudahasstdstringview define)
+-        endif()
++    # CUDA_NVCC_EXECUTABLE
++    if(DEFINED ENV{CUDA_NVCC_EXECUTABLE})
++      set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler")
++    else()
++      find_program(CUDA_NVCC_EXECUTABLE
++        NAMES nvcc nvcc.exe
++        PATHS "${CUDA_TOOLKIT_ROOT_DIR}"
++          ENV CUDA_TOOKIT_ROOT
++          ENV CUDA_PATH
++          ENV CUDA_BIN_PATH
++        PATH_SUFFIXES bin bin64
++        DOC "The CUDA compiler"
++        NO_DEFAULT_PATH
++      )
++      find_program(CUDA_NVCC_EXECUTABLE
++        NAMES nvcc nvcc.exe
++        PATHS /opt/cuda/bin
++        PATH_SUFFIXES cuda/bin
++        DOC "The CUDA compiler"
++      )
++      # Search default search paths, after we search our own set of paths.
++      find_program(CUDA_NVCC_EXECUTABLE nvcc)
++    endif()
++    mark_as_advanced(CUDA_NVCC_EXECUTABLE)
++    if(CUDA_NVCC_EXECUTABLE)
++      execute_process(COMMAND "echo"
++        "-e" "#include <string_view>\nint main() { char arr[3] = {'B', 'a', 'r'}; std::string_view strv(arr, sizeof(arr)); return 0;}"
++        "|"
++        "${CUDA_NVCC_EXECUTABLE}" "-std=c++${CMAKE_CUDA_STANDARD}" "-o" "/dev/null" "-x" "c++" "-"
++        RESULT_VARIABLE nvcc_compiled_string_view)
++      if (nvcc_compiled_string_view EQUAL "0")
++        set(cudahasstdstringview define)
+       endif()
+     endif()
+   endif()
+
+From fccf1ba488fb7da334ef89e9df098bbdeee83ca5 Mon Sep 17 00:00:00 2001
+From: Konstantin Gizdov <kgizdov at gmail.com>
+Date: Sat, 25 Jul 2020 02:39:22 +0300
+Subject: [PATCH 5/6] find NVCC early; fix CMake execute process
+
+---
+ cmake/modules/RootConfiguration.cmake       | 32 +++------------------
+ cmake/modules/SearchInstalledSoftware.cmake | 24 ++++++++++++++++
+ 2 files changed, 28 insertions(+), 28 deletions(-)
+
+diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake
+index 2eff954ef94..11d1e6b76c0 100644
+--- a/cmake/modules/RootConfiguration.cmake
++++ b/cmake/modules/RootConfiguration.cmake
+@@ -518,35 +518,11 @@ CHECK_CXX_SOURCE_COMPILES("#include <string_view>
+ if(found_stdstringview)
+   set(hasstdstringview define)
+   if(cuda)
+-    # CUDA_NVCC_EXECUTABLE
+-    if(DEFINED ENV{CUDA_NVCC_EXECUTABLE})
+-      set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler")
+-    else()
+-      find_program(CUDA_NVCC_EXECUTABLE
+-        NAMES nvcc nvcc.exe
+-        PATHS "${CUDA_TOOLKIT_ROOT_DIR}"
+-          ENV CUDA_TOOKIT_ROOT
+-          ENV CUDA_PATH
+-          ENV CUDA_BIN_PATH
+-        PATH_SUFFIXES bin bin64
+-        DOC "The CUDA compiler"
+-        NO_DEFAULT_PATH
+-      )
+-      find_program(CUDA_NVCC_EXECUTABLE
+-        NAMES nvcc nvcc.exe
+-        PATHS /opt/cuda/bin
+-        PATH_SUFFIXES cuda/bin
+-        DOC "The CUDA compiler"
+-      )
+-      # Search default search paths, after we search our own set of paths.
+-      find_program(CUDA_NVCC_EXECUTABLE nvcc)
+-    endif()
+-    mark_as_advanced(CUDA_NVCC_EXECUTABLE)
+     if(CUDA_NVCC_EXECUTABLE)
+-      execute_process(COMMAND "echo"
+-        "-e" "#include <string_view>\nint main() { char arr[3] = {'B', 'a', 'r'}; std::string_view strv(arr, sizeof(arr)); return 0;}"
+-        "|"
+-        "${CUDA_NVCC_EXECUTABLE}" "-std=c++${CMAKE_CUDA_STANDARD}" "-o" "/dev/null" "-x" "c++" "-"
++      execute_process(
++        COMMAND "echo"
++          "-e" "#include <string_view>\nint main() { char arr[3] = {'B', 'a', 'r'}; std::string_view strv(arr, sizeof(arr)); return 0;}"
++        COMMAND "${CUDA_NVCC_EXECUTABLE}" "-std=c++${CMAKE_CUDA_STANDARD}" "-o" "/dev/null" "-x" "c++" "-"
+         RESULT_VARIABLE nvcc_compiled_string_view)
+       if (nvcc_compiled_string_view EQUAL "0")
+         set(cudahasstdstringview define)
+diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake
+index 12f9d65371b..297578d3437 100644
+--- a/cmake/modules/SearchInstalledSoftware.cmake
++++ b/cmake/modules/SearchInstalledSoftware.cmake
+@@ -1462,6 +1462,30 @@ if(cuda OR tmva-gpu)
+     endif()
+     enable_language(CUDA)
+     set(cuda ON CACHE BOOL "Found Cuda for TMVA GPU" FORCE)
++    # CUDA_NVCC_EXECUTABLE
++    if(DEFINED ENV{CUDA_NVCC_EXECUTABLE})
++      set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler")
++    else()
++      find_program(CUDA_NVCC_EXECUTABLE
++        NAMES nvcc nvcc.exe
++        PATHS "${CUDA_TOOLKIT_ROOT_DIR}"
++          ENV CUDA_TOOKIT_ROOT
++          ENV CUDA_PATH
++          ENV CUDA_BIN_PATH
++        PATH_SUFFIXES bin bin64
++        DOC "The CUDA compiler"
++        NO_DEFAULT_PATH
++      )
++      find_program(CUDA_NVCC_EXECUTABLE
++        NAMES nvcc nvcc.exe
++        PATHS /opt/cuda/bin
++        PATH_SUFFIXES cuda/bin
++        DOC "The CUDA compiler"
++      )
++      # Search default search paths, after we search our own set of paths.
++      find_program(CUDA_NVCC_EXECUTABLE nvcc)
++    endif()
++    mark_as_advanced(CUDA_NVCC_EXECUTABLE)
+     ###
+     ### look for package CuDNN
+     if (cudnn)
+
+From bd7728fe40fa98640354baeab6504b4b499327c0 Mon Sep 17 00:00:00 2001
+From: Konstantin Gizdov <kgizdov at gmail.com>
+Date: Sat, 25 Jul 2020 02:44:25 +0300
+Subject: [PATCH 6/6] null sinks differ on different platforms
+
+---
+ cmake/modules/RootConfiguration.cmake | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake
+index 11d1e6b76c0..5a3ff396780 100644
+--- a/cmake/modules/RootConfiguration.cmake
++++ b/cmake/modules/RootConfiguration.cmake
+@@ -519,11 +519,17 @@ if(found_stdstringview)
+   set(hasstdstringview define)
+   if(cuda)
+     if(CUDA_NVCC_EXECUTABLE)
++      if (WIN32)
++        set(PLATFORM_NULL_FILE "nul")
++      else()
++        set(PLATFORM_NULL_FILE "/dev/null")
++      endif()
+       execute_process(
+         COMMAND "echo"
+           "-e" "#include <string_view>\nint main() { char arr[3] = {'B', 'a', 'r'}; std::string_view strv(arr, sizeof(arr)); return 0;}"
+-        COMMAND "${CUDA_NVCC_EXECUTABLE}" "-std=c++${CMAKE_CUDA_STANDARD}" "-o" "/dev/null" "-x" "c++" "-"
++        COMMAND "${CUDA_NVCC_EXECUTABLE}" "-std=c++${CMAKE_CUDA_STANDARD}" "-o" "${PLATFORM_NULL_FILE}" "-x" "c++" "-"
+         RESULT_VARIABLE nvcc_compiled_string_view)
++      unset(PLATFORM_NULL_FILE CACHE)
+       if (nvcc_compiled_string_view EQUAL "0")
+         set(cudahasstdstringview define)
+       endif()



More information about the arch-commits mailing list