Skip to content

Commit

Permalink
Adding packaging to install script and obsoletes/replaces to cpack
Browse files Browse the repository at this point in the history
  • Loading branch information
saadrahim committed May 28, 2019
1 parent c1ab2ec commit 394145b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
14 changes: 12 additions & 2 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -21,6 +22,7 @@ function display_help()
# global variables
# #################################################
install_package=false
build_package=false
build_clients=false
build_release=true
run_tests=false
Expand All @@ -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
Expand All @@ -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 ;;
Expand Down Expand Up @@ -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.
Expand All @@ -110,3 +115,8 @@ if ($install_package); then
# Install
make install
fi

if ($build_package); then
# Install
make package -j$(nproc)
fi

0 comments on commit 394145b

Please sign in to comment.