From 3a9dc0fae1a18aa66a3097ec1e3e2a11fed9f180 Mon Sep 17 00:00:00 2001 From: Michael Wootton Date: Wed, 1 Aug 2018 15:31:47 -0500 Subject: [PATCH] ROCM: Escape RPATH when linking with hipcc --- tools/build_pytorch_libs.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/build_pytorch_libs.sh b/tools/build_pytorch_libs.sh index 4a0dbd04c905f1..8f79c2830e96c0 100755 --- a/tools/build_pytorch_libs.sh +++ b/tools/build_pytorch_libs.sh @@ -97,7 +97,11 @@ if [[ $(uname) == 'Darwin' ]]; then LDFLAGS="$LDFLAGS -Wl,-rpath,@loader_path" LD_POSTFIX=".dylib" else - LDFLAGS="$LDFLAGS -Wl,-rpath,\$ORIGIN" + if [[ $USE_ROCM -eq 1 ]]; then + LDFLAGS="$LDFLAGS -Wl,-rpath,\\\\\\\$ORIGIN" + else + LDFLAGS="$LDFLAGS -Wl,-rpath,\$ORIGIN" + fi fi CPP_FLAGS=" -std=c++11 " GLOO_FLAGS=""