Skip to content

Commit e4ddd15

Browse files
authored
Merge pull request #75 from aaronenyeshi/add-hip-clang-install
Add hip-clang install to install script
2 parents c844b05 + 34dc767 commit e4ddd15

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

install

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function display_help()
1515
# echo " [-d|--dependencies] install build dependencies"
1616
echo " [-c|--clients] build library clients too (combines with -i & -d)"
1717
echo " [-g|--debug] -DCMAKE_BUILD_TYPE=Debug (default is =Release)"
18+
echo " [--hip-clang] build library for amdgpu backend using hip-clang"
1819
}
1920

2021

@@ -25,6 +26,7 @@ install_package=false
2526
build_package=false
2627
build_clients=false
2728
build_release=true
29+
build_hip_clang=false
2830
run_tests=false
2931
rocm_path=/opt/rocm/bin
3032
# #################################################
@@ -34,7 +36,7 @@ rocm_path=/opt/rocm/bin
3436
# check if we have a modern version of getopt that can handle whitespace and long parameters
3537
getopt -T
3638
if [[ $? -eq 4 ]]; then
37-
GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,clients,debug,test,package --options hicdtp -- "$@")
39+
GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,clients,debug,hip-clang,test,package --options hicdtp -- "$@")
3840
else
3941
echo "Need a new version of getopt"
4042
exit 1
@@ -69,6 +71,9 @@ while true; do
6971
-t|--test)
7072
run_tests=true
7173
shift ;;
74+
--hip-clang)
75+
build_hip_clang=true
76+
shift ;;
7277
--) shift ; break ;;
7378
*) echo "Unexpected command line parameter received; aborting";
7479
exit 1
@@ -100,8 +105,12 @@ fi
100105
# before 'cmake' or setting cmake option 'CMAKE_CXX_COMPILER' to path to the HCC compiler.
101106
#
102107

108+
compiler="hcc"
109+
if [[ "${build_hip_clang}" == true ]]; then
110+
compiler="hipcc"
111+
fi
103112

104-
CXX=$rocm_path/hcc cmake -DBUILD_BENCHMARK=ON ../../. # or cmake-gui ../.
113+
CXX=$rocm_path/${compiler} cmake -DBUILD_BENCHMARK=ON ../../. # or cmake-gui ../.
105114

106115
# Build
107116
make -j$(nproc)

0 commit comments

Comments
 (0)