Add a workaround for DEB generation on CMake < 3.7
Old versions of CMake do not support set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar")
The default archive type is "paxr" which generates corrupted DEB packages
if there are long file names:
* thrust/system/cuda/detail/cub is excluded
* intermediate_type_from_function_and_iterators.h is renamed
to intermediate_type.h
MODIFY
.gitlab-ci.yml
.gitlab-ci.yml
@@ -83,35 +83,35 @@ build:rocm:
include: '.gitlab-ci-gputest.yml'
-# test:rocm_package:
-# stage: test
-# tags:
-# - rocm
-# variables:
-# SUDO_CMD: "sudo -E"
-# dependencies:
-# - build:rocm
-# script:
-# # Install rocPRIM package
-# - echo ${ROCPRIM_GIT_URL}
-# - echo $ROCPRIM_GIT_URL
-# - git clone -b develop_stream https://gitlab-ci-token:${CI_JOB_TOKEN}@${ROCPRIM_GIT_URL}
-# - cd rocPRIM
-# - mkdir build
-# - cd build
-# - CXX=hcc cmake -DBUILD_TEST=OFF ../.
-# - make package
-# - $SUDO_CMD dpkg -i rocprim-*.deb
-# - cd ../..
-# # rocThrust
-# - cd build
-# - $SUDO_CMD dpkg -i rocthrust-*.deb
-# - mkdir ../package_test && cd ../package_test
-# - CXX=hcc cmake ../extra/. -Drocprim_DIR="/opt/rocm/rocprim"
-# - make VERBOSE=1
-# - $SUDO_CMD ctest --output-on-failure --repeat-until-fail 2
-# - $SUDO_CMD dpkg -r rocthrust
-# - $SUDO_CMD dpkg -r rocprim
+test:rocm_package:
+ stage: test
+ tags:
+ - rocm
+ variables:
+ SUDO_CMD: "sudo -E"
+ dependencies:
+ - build:rocm
+ script:
+ # Install rocPRIM package
+ - echo ${ROCPRIM_GIT_URL}
+ - echo $ROCPRIM_GIT_URL
+ - git clone -b develop_stream https://gitlab-ci-token:${CI_JOB_TOKEN}@${ROCPRIM_GIT_URL}
+ - cd rocPRIM
+ - mkdir build
+ - cd build
+ - CXX=hcc cmake -DBUILD_TEST=OFF ../.
+ - make package
+ - $SUDO_CMD dpkg -i rocprim-*.deb
+ - cd ../..
+ # rocThrust
+ - cd build
+ - $SUDO_CMD dpkg -i rocthrust-*.deb
+ - mkdir ../package_test && cd ../package_test
+ - CXX=hcc cmake ../extra/. -Drocprim_DIR="/opt/rocm/rocprim"
+ - make VERBOSE=1
+ - $SUDO_CMD ctest --output-on-failure --repeat-until-fail 2
+ - $SUDO_CMD dpkg -r rocthrust
+ - $SUDO_CMD dpkg -r rocprim
test:rocm_install:
stage: test

MODIFY
thrust/CMakeLists.txt
thrust/CMakeLists.txt
@@ -59,17 +59,24 @@ rocm_install_targets(
# ${CMAKE_BINARY_DIR}/thrust
PREFIX rocthrust
)
+if(CMAKE_VERSION VERSION_LESS 3.7)
+ # Workaround: old versions of CMake do not support set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar")
+ # The default archive type is "paxr" which generates corrupted DEB packages
+ # if there are long file names.
+ set(EXCLUDE_PATTERNS PATTERN "./system/cuda/detail/cub/*" EXCLUDE)
+endif()
install(
DIRECTORY
"./"
"${PROJECT_BINARY_DIR}/thrust/include/"
- DESTINATION rocthrust/include/thrust/
+ DESTINATION rocthrust/include/thrust
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.cuh"
PATTERN "*.hpp"
PATTERN "*.in"
PATTERN "*.inl"
+ ${EXCLUDE_PATTERNS}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
)

RENAME
thrust/detail/type_traits/algorithm/intermediate_type_from_function_and_iterators.h
thrust/detail/type_traits/algorithm/intermediate_type.h
MODIFY
thrust/system/detail/sequential/reduce_by_key.h
thrust/system/detail/sequential/reduce_by_key.h
#include <thrust/detail/config.h>
#include <thrust/pair.h>
#include <thrust/iterator/iterator_traits.h>
-#include <thrust/detail/type_traits/algorithm/intermediate_type_from_function_and_iterators.h>
+#include <thrust/detail/type_traits/algorithm/intermediate_type.h>
#include <thrust/system/detail/sequential/execution_policy.h>
namespace thrust

Add a workaround for DEB generation on CMake < 3.7

Old versions of CMake do not support set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar")
The default archive type is "paxr" which generates corrupted DEB packages
if there are long file names:
* thrust/system/cuda/detail/cub is excluded
* intermediate_type_from_function_and_iterators.h is renamed
  to intermediate_type.h