diff --git a/deps/external-gtest.cmake b/deps/external-gtest.cmake index b41c4945..525fc5e5 100644 --- a/deps/external-gtest.cmake +++ b/deps/external-gtest.cmake @@ -35,7 +35,7 @@ set( gtest_git_tag "release-1.11.0" CACHE STRING "URL to download gtest from" ) if( MSVC ) list( APPEND gtest_cmake_args -Dgtest_force_shared_crt=ON -DCMAKE_DEBUG_POSTFIX=d ) # else( ) - # GTEST_USE_OWN_TR1_TUPLE necessary to compile with hipcc + # GTEST_USE_OWN_TR1_TUPLE necessary to compile with hip-clang # list( APPEND gtest_cmake_args -DGTEST_USE_OWN_TR1_TUPLE=1 ) endif( ) diff --git a/install.sh b/install.sh index 42aefadb..0072cb65 100755 --- a/install.sh +++ b/install.sh @@ -22,7 +22,7 @@ function display_help() echo " [--compiler] specify host compiler" echo " [--cuda] build library for cuda backend" echo " [--static] build static library" - echo " [--address-sanitizer] build with address sanitizer enabled. Uses hipcc to compile" + echo " [--address-sanitizer] build with address sanitizer enabled. Uses hip-clang to compile" echo " [--matrices-dir] existing client matrices directory" echo " [--matrices-dir-install] install client matrices directory" echo " [--rm-legacy-include-dir] Remove legacy include dir Packaging added for file/folder reorg backward compatibility." @@ -330,7 +330,7 @@ while true; do shift ;; --address-sanitizer) build_address_sanitizer=true - compiler=hipcc + compiler=amdclang++ shift ;; --rm-legacy-include-dir) build_freorg_bkwdcomp=false @@ -381,7 +381,7 @@ fi # If matrices_dir_install has been set up then install matrices dir and exit. # if ! [[ "${matrices_dir_install}" == "" ]];then - cmake -DCMAKE_CXX_COMPILER="${rocm_path}/bin/hipcc" -DCMAKE_C_COMPILER="${rocm_path}/bin/hipcc" -DPROJECT_BINARY_DIR=${matrices_dir_install} -DCMAKE_MATRICES_DIR=${matrices_dir_install} -P ./cmake/ClientMatrices.cmake + cmake -DCMAKE_CXX_COMPILER="${rocm_path}/bin/amdclang++" -DCMAKE_C_COMPILER="${rocm_path}/bin/amdclang" -DPROJECT_BINARY_DIR=${matrices_dir_install} -DCMAKE_MATRICES_DIR=${matrices_dir_install} -P ./cmake/ClientMatrices.cmake exit 0 fi @@ -398,7 +398,7 @@ if ! [[ "${matrices_dir}" == "" ]];then # Let's 'reinstall' to the specified location to check if all good # Will be fast if everything already exists as expected. # This is to prevent any empty directory. - cmake -DCMAKE_CXX_COMPILER="${rocm_path}/bin/hipcc" -DCMAKE_C_COMPILER="${rocm_path}/bin/hipcc" -DPROJECT_BINARY_DIR=${matrices_dir} -DCMAKE_MATRICES_DIR=${matrices_dir} -P ./cmake/ClientMatrices.cmake + cmake -DCMAKE_CXX_COMPILER="${rocm_path}/bin/amdclang++" -DCMAKE_C_COMPILER="${rocm_path}/bin/amdclang" -DPROJECT_BINARY_DIR=${matrices_dir} -DCMAKE_MATRICES_DIR=${matrices_dir} -P ./cmake/ClientMatrices.cmake fi diff --git a/toolchain-linux.cmake b/toolchain-linux.cmake index bae5fff4..19748792 100644 --- a/toolchain-linux.cmake +++ b/toolchain-linux.cmake @@ -2,13 +2,18 @@ if (DEFINED ENV{ROCM_PATH}) set(rocm_bin "$ENV{ROCM_PATH}/bin") else() + set(ROCM_PATH "/opt/rocm" CACHE PATH "Path to the ROCm installation.") set(rocm_bin "/opt/rocm/bin") endif() -set(CMAKE_CXX_COMPILER "${rocm_bin}/hipcc") -set(CMAKE_C_COMPILER "${rocm_bin}/hipcc") -set(python "python3") +if (NOT DEFINED ENV{CXX}) + set(CMAKE_CXX_COMPILER "${rocm_bin}/amdclang++") +else() + set(CMAKE_CXX_COMPILER "$ENV{CXX}") +endif() -# TODO remove, just to speed up slow cmake -# set(CMAKE_C_COMPILER_WORKS 1) -# set(CMAKE_CXX_COMPILER_WORKS 1) +if (NOT DEFINED ENV{CC}) + set(CMAKE_C_COMPILER "${rocm_bin}/amdclang") +else() + set(CMAKE_C_COMPILER "$ENV{CC}") +endif()