Skip to content

Commit 769266a

Browse files
authored
cmake : compile ggml-rocm with -fpic when building shared library (#3158)
1 parent cf8238e commit 769266a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,9 @@ if (LLAMA_HIPBLAS)
386386
message(STATUS "HIP and hipBLAS found")
387387
add_compile_definitions(GGML_USE_HIPBLAS GGML_USE_CUBLAS)
388388
add_library(ggml-rocm OBJECT ggml-cuda.cu ggml-cuda.h)
389+
if (BUILD_SHARED_LIBS)
390+
set_target_properties(ggml-rocm PROPERTIES POSITION_INDEPENDENT_CODE ON)
391+
endif()
389392
if (LLAMA_CUDA_FORCE_DMMV)
390393
target_compile_definitions(ggml-rocm PRIVATE GGML_CUDA_FORCE_DMMV)
391394
endif()

0 commit comments

Comments
 (0)