-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make hip-lang-config.cmake.in more robust. #2776
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,16 +70,6 @@ include( "${CMAKE_CURRENT_LIST_DIR}/hip-lang-targets.cmake" ) | |
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}" REALPATH) | ||
get_filename_component(_IMPORT_PREFIX "${_DIR}/../../../" REALPATH) | ||
|
||
|
||
#need _IMPORT_PREFIX to be set #FILE_REORG_BACKWARD_COMPATIBILITY | ||
file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "${_IMPORT_PREFIX}/../llvm/lib/clang/*/include") | ||
file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG "${_IMPORT_PREFIX}/llvm/lib/clang/*/include") | ||
find_path(HIP_CLANG_INCLUDE_PATH __clang_cuda_math.h | ||
HINTS ${HIP_CLANG_INCLUDE_SEARCH_PATHS} | ||
${HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG} | ||
NO_DEFAULT_PATH) | ||
get_filename_component(HIP_CLANG_INCLUDE_PATH "${HIP_CLANG_INCLUDE_PATH}" DIRECTORY) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line break case 1 CLANGRT_BUILTINS-NOTFOUND. |
||
|
||
#If HIP isnot installed under ROCm, need this to find HSA assuming HSA is under ROCm | ||
if( DEFINED ENV{ROCM_PATH} ) | ||
set(ROCM_PATH "$ENV{ROCM_PATH}") | ||
|
@@ -99,6 +89,21 @@ if (NOT HSA_HEADER) | |
endif() | ||
|
||
get_filename_component(HIP_COMPILER_INSTALL_PATH ${CMAKE_HIP_COMPILER} DIRECTORY) | ||
# locate device compilation include path HIP_CLANG_INCLUDE_PATH | ||
# generic case | ||
file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "${HIP_COMPILER_INSTALL_PATH}/../lib/clang/*/include") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line should take care
|
||
# <ROCM_PATH>/bin/amdclang++ | ||
file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG "${HIP_COMPILER_INSTALL_PATH}/../llvm/lib/clang/*/include") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only this one is unique for the soft link being used. |
||
find_path(HIP_CLANG_INCLUDE_PATH __clang_cuda_math.h | ||
HINTS ${HIP_CLANG_INCLUDE_SEARCH_PATHS} | ||
${HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG} | ||
NO_DEFAULT_PATH) | ||
|
||
if (NOT HIP_CLANG_INCLUDE_PATH) | ||
message (FATAL_ERROR "Incorrect HIP_CLANG_INCLUDE_PATH. __clang_cuda_math.h not found!") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Early trap needed. |
||
endif() | ||
|
||
# locate device library CLANGRT_BUILTINS | ||
file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "${HIP_COMPILER_INSTALL_PATH}/../lib/clang/*/lib/*") | ||
find_library(CLANGRT_BUILTINS | ||
NAMES | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
__clang_cuda_math.h
is used for device compilation.isn't it better to have it following the compiler installation?