@@ -140,7 +140,7 @@ cc_library(
140140 name = "rocm_rpath",
141141 linkopts = select({
142142 " :build_hermetic" : [
143- " -Wl,-rpath,%{rocm_toolkit_path }/lib" ,
143+ " -Wl,-rpath,external/local_config_rocm/rocm/%{rocm_root }/lib" ,
144144 ],
145145 " :multiple_rocm_paths" : [
146146 " -Wl,-rpath=%{rocm_lib_paths}" ,
@@ -163,7 +163,7 @@ cc_library(
163163
164164cc_library(
165165 name = "rocm_hip",
166- srcs = glob(["%{ rocm_root} /lib/libamdhip*.so"]),
166+ srcs = glob(["%{ rocm_root} /lib/libamdhip*.so* "]),
167167 hdrs = glob(["%{ rocm_root} /include/hip/**"]),
168168 include_prefix = "rocm",
169169 includes = [
@@ -181,7 +181,10 @@ cc_library(
181181# Used by jax_rocm_plugin to minimally link to hip runtime.
182182cc_library(
183183 name = "hip_runtime",
184- srcs = glob(["%{ rocm_root} /lib/libamdhip*.so"]),
184+ srcs = glob([
185+ "%{ rocm_root} /lib/libamdhip*.so*",
186+ "%{ rocm_root} /lib/libamd_comgr.so*",
187+ ]),
185188 hdrs = glob(["%{ rocm_root} /include/hip/**"]),
186189 include_prefix = "rocm",
187190 includes = [
@@ -215,15 +218,16 @@ cc_library(
215218 ],
216219 # workaround to bring tensile files to the same fs layout as expected in the lib
217220 # rocblas assumes that tensile files are located in ../roblas/libraries directory
218- linkopts = ["-Wl,-rpath,local_config_rocm/rocm/rocm_dis /lib"],
221+ linkopts = ["-Wl,-rpath,external/ local_config_rocm/rocm/% { rocm_root } /lib"],
219222 strip_include_prefix = "%{ rocm_root} ",
220223 visibility = ["//visibility:public"],
221224 deps = [":rocm_config"],
222225)
223226
224227cc_library(
225228 name = "rocfft",
226- srcs = glob(["%{ rocm_root} /lib/librocfft*.so*"]),
229+ data = glob(["%{ rocm_root} /lib/librocfft*.so*"]),
230+ linkopts = ["-Wl,-rpath,external/local_config_rocm/rocm/%{ rocm_root} /lib"],
227231 include_prefix = "rocm",
228232 includes = [
229233 "%{ rocm_root} /include",
@@ -235,7 +239,8 @@ cc_library(
235239
236240cc_library(
237241 name = "hipfft",
238- srcs = glob(["%{ rocm_root} /lib/libhipfft*.so*"]),
242+ data = glob(["%{ rocm_root} /lib/libhipfft*.so*"]),
243+ linkopts = ["-Wl,-rpath,external/local_config_rocm/rocm/%{ rocm_root} /lib"],
239244 include_prefix = "rocm",
240245 includes = [
241246 "%{ rocm_root} /include",
@@ -266,7 +271,6 @@ miopen_libs = glob([
266271
267272cc_library(
268273 name = "miopen",
269- srcs = glob(["%{ rocm_root} /lib/libMIOpen*.so*"]),
270274 hdrs = glob(["%{ rocm_root} /include/miopen/**"]),
271275 data = select({
272276 " :build_hermetic" : miopen_libs,
@@ -279,7 +283,7 @@ cc_library(
279283 ],
280284 # workaround to bring miopen db files to the same fs layout as expected in the lib
281285 # rocblas assumes that miopen db files are located in ../share/miopen/db directory
282- linkopts = ["-Wl,-rpath,local_config_rocm/rocm/rocm_dis /lib"],
286+ linkopts = ["-Wl,-rpath,external/ local_config_rocm/rocm/% { rocm_root } /lib"],
283287 strip_include_prefix = "%{ rocm_root} ",
284288 visibility = ["//visibility:public"],
285289 deps = [":rocm_config"],
@@ -429,13 +433,13 @@ hipblas_libs = glob(["%{rocm_root}/lib/libhipblas.so*"])
429433
430434cc_library(
431435 name = "hipblas",
432- srcs = glob(["%{ rocm_root} /lib/libhipblas.so*"]),
433436 hdrs = glob(["%{ rocm_root} /include/hipblas/**"]),
434437 data = select({
435438 " :build_hermetic" : hipblas_libs,
436439 " :multiple_rocm_paths" : hipblas_libs,
437440 " //conditions:default" : [],
438441 } ),
442+ linkopts = ["-Wl,-rpath,external/local_config_rocm/rocm/%{ rocm_root} /lib"],
439443 include_prefix = "rocm",
440444 includes = [
441445 "%{ rocm_root} /include/",
@@ -479,7 +483,7 @@ cc_library(
479483 ],
480484 # workaround to bring tensile files to the same fs layout as expected in the lib
481485 # hibplatslt assumes that tensile files are located in ../hipblaslt/libraries directory
482- linkopts = ["-Wl,-rpath,local_config_rocm/rocm/rocm_dis /lib"],
486+ linkopts = ["-Wl,-rpath,external/ local_config_rocm/rocm/% { rocm_root } /lib"],
483487 strip_include_prefix = "%{ rocm_root} ",
484488 visibility = ["//visibility:public"],
485489 deps = [":rocm_config"],
0 commit comments