Adding packaging support to install script and adding conflicts with older versions for packaging
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -82,6 +82,8 @@ endif()
# Package
set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "hip_hcc (>= 1.5.18263), rocprim (>= 1.0)") # 1.5.18263 is HIP version in ROCm 1.8.2
+set(CPACK_DEBIAN_PACKAGE_CONFLICTS "hip-thrust, thrust")
+set(CPACK_RPM_PACKAGE_CONFLICTS "hip-thrust, thrust")
set(CPACK_RPM_PACKAGE_REQUIRES "hip_hcc >= 1.5.18263, rocprim >= 1.0")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
if(NOT CPACK_PACKAGING_INSTALL_PREFIX)

MODIFY
install
install
@@ -10,6 +10,7 @@ function display_help()
echo "./install [-h|--help] "
echo " [-h|--help] prints this help message"
echo " [-i|--install] install after build"
+ echo " [-p|--package] build package"
#Not implemented yet
# echo " [-d|--dependencies] install build dependencies"
echo " [-c|--clients] build library clients too (combines with -i & -d)"
@@ -21,6 +22,7 @@ function display_help()
# global variables
# #################################################
install_package=false
+build_package=false
build_clients=false
build_release=true
run_tests=false
@@ -32,7 +34,7 @@ rocm_path=/opt/rocm/bin
# check if we have a modern version of getopt that can handle whitespace and long parameters
getopt -T
if [[ $? -eq 4 ]]; then
- GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,clients,debug,test --options hicdt -- "$@")
+ GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,clients,debug,test,package --options hicdtp -- "$@")
else
echo "Need a new version of getopt"
exit 1
@@ -55,6 +57,9 @@ while true; do
-i|--install)
install_package=true
shift ;;
+ -p|--package)
+ build_package=true
+ shift ;;
-c|--clients)
build_clients=true
shift ;;
@@ -99,7 +104,7 @@ fi
CXX=$rocm_path/hcc cmake -DBUILD_BENCHMARK=ON ../../. # or cmake-gui ../.
# Build
-make -j32
+make -j$(nproc)
if ($run_tests); then
# Optionally, run tests if they're enabled.
@@ -110,3 +115,8 @@ if ($install_package); then
# Install
make install
fi
+
+if ($build_package); then
+# Install
+make package -j$(nproc)
+fi

Adding packaging support to install script and adding conflicts with older versions for packaging