summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei <abetlen@gmail.com>2023-09-14 13:38:16 -0400
committerGitHub <noreply@github.com>2023-09-14 20:38:16 +0300
commit769266a543f68377a1d904ec2a8c27b38a4025ab (patch)
tree7d3520256bf82b9307cc3d0cf89f257c04450126
parentcf8238e7f43cb82a36426af392037e85cd2a3df6 (diff)
cmake : compile ggml-rocm with -fpic when building shared library (#3158)
-rw-r--r--CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db0a273f..eac5799a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -386,6 +386,9 @@ if (LLAMA_HIPBLAS)
message(STATUS "HIP and hipBLAS found")
add_compile_definitions(GGML_USE_HIPBLAS GGML_USE_CUBLAS)
add_library(ggml-rocm OBJECT ggml-cuda.cu ggml-cuda.h)
+ if (BUILD_SHARED_LIBS)
+ set_target_properties(ggml-rocm PROPERTIES POSITION_INDEPENDENT_CODE ON)
+ endif()
if (LLAMA_CUDA_FORCE_DMMV)
target_compile_definitions(ggml-rocm PRIVATE GGML_CUDA_FORCE_DMMV)
endif()