From 394145b189130faeb889f3f2becb37b6affefcbd Mon Sep 17 00:00:00 2001 From: Saad Rahim Date: Tue, 28 May 2019 14:16:06 -0700 Subject: [PATCH] Adding packaging to install script and obsoletes/replaces to cpack --- CMakeLists.txt | 3 +++ install | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c353187c..907c6e46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,9 @@ endif() if(HIP_PLATFORM STREQUAL "hcc") set(CPACK_DEBIAN_PACKAGE_DEPENDS "hip_hcc (>= 1.5), rocprim (>= 2.5)") set(CPACK_RPM_PACKAGE_REQUIRES "hip_hcc >= 1.5, rocprim >= 2.5") + set(CPACK_DEBIAN_PACKAGE_REPLACES "cub-hip") + set(CPACK_RPM_PACKAGE_OBSOLETES "cub-hip") + else() set(CPACK_DEBIAN_PACKAGE_DEPENDS "hip_nvcc (>= 1.5)") set(CPACK_RPM_PACKAGE_REQUIRES "hip_nvcc >= 1.5") diff --git a/install b/install index 8dcbb0d8..70a2c1c9 100755 --- a/install +++ b/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