-
Notifications
You must be signed in to change notification settings - Fork 159
/
toolchain-linux.cmake
38 lines (27 loc) · 856 Bytes
/
toolchain-linux.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
if (NOT python)
set(python "python3") # default for linux
endif()
if (DEFINED ENV{ROCM_PATH})
set(rocm_bin "$ENV{ROCM_PATH}/bin")
else()
set(rocm_bin "/opt/rocm/bin")
endif()
# relying on env and path for backward compatibility with external recipes
if (NOT DEFINED ENV{CXX} AND NOT CMAKE_CXX_COMPILER)
set(CMAKE_CXX_COMPILER "${rocm_bin}/amdclang++")
endif()
if (NOT DEFINED ENV{CC} AND NOT CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER "${rocm_bin}/amdclang")
endif()
if (NOT DEFINED ENV{FC} AND NOT CMAKE_Fortran_COMPILER)
set(CMAKE_Fortran_COMPILER "gfortran")
endif()
if (NOT ROCBLAS_TOOLCHAIN_VARS_APPENDED)
set(ROCBLAS_TOOLCHAIN_VARS_APPENDED True)
# flags for clang direct use
endif()
if (CONFIG_NO_COMPILER_CHECKS)
set(CMAKE_CXX_COMPILER_WORKS 1)
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_Fortran_COMPILER_WORKS 1)
endif()