File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 80
80
elif [[ -v ANACONDA_PYTHON_VERSION ]]; then
81
81
export CMAKE_PREFIX_PATH=" /opt/conda/envs/py_${ANACONDA_PYTHON_VERSION} "
82
82
else
83
- # already checked by `! which conda`
84
- CMAKE_PREFIX_PATH=" $( conda info --base) "
85
- export CMAKE_PREFIX_PATH
83
+ export CMAKE_PREFIX_PATH=" $( conda info --base) "
86
84
fi
87
85
88
86
# Workaround required for MKL library linkage
Original file line number Diff line number Diff line change @@ -1025,6 +1025,31 @@ endif()
1025
1025
1026
1026
# ---[ HIP
1027
1027
if (USE_ROCM )
1028
+ # This prevents linking in the libtinfo from /opt/conda/lib which conflicts with ROCm libtinfo.
1029
+ # Currently only active for Ubuntu 20.04 and greater versions.
1030
+ if (UNIX AND EXISTS "/etc/os-release" )
1031
+ file (STRINGS /etc/os-release OS_RELEASE )
1032
+ set (DISTRO_NAME "" )
1033
+ set (DISTRO_VERSION "" )
1034
+ foreach (line ${OS_RELEASE} )
1035
+ string (REGEX MATCH "^NAME=" DISTRO_NAME_MATCH ${line} )
1036
+ if (NOT DISTRO_NAME_MATCH STREQUAL "" )
1037
+ string (REGEX REPLACE "^NAME=\" (.*)\" " "\\ 1" DISTRO_NAME ${line} )
1038
+ endif ()
1039
+ string (REGEX MATCH "^VERSION_ID=" DISTRO_VERSION_MATCH ${line} )
1040
+ if (NOT DISTRO_VERSION_MATCH STREQUAL "" )
1041
+ string (REGEX REPLACE "^VERSION_ID=\" (.*)\" " "\\ 1" DISTRO_VERSION ${line} )
1042
+ endif ()
1043
+ endforeach ()
1044
+ if (DISTRO_NAME STREQUAL "Ubuntu" AND DISTRO_VERSION VERSION_GREATER_EQUAL "20.04" )
1045
+ find_library (LIBTINFO_LOC tinfo NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH )
1046
+ if (LIBTINFO_LOC )
1047
+ get_filename_component (LIBTINFO_LOC_PARENT ${LIBTINFO_LOC} DIRECTORY )
1048
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath-link,${LIBTINFO_LOC_PARENT} " )
1049
+ endif ()
1050
+ endif ()
1051
+ endif ()
1052
+
1028
1053
include (${CMAKE_CURRENT_LIST_DIR} /public/LoadHIP.cmake )
1029
1054
if (PYTORCH_FOUND_HIP )
1030
1055
message (INFO "Compiling with HIP for AMD." )
You can’t perform that action at this time.
0 commit comments