From: Andrei Date: Thu, 14 Sep 2023 17:38:16 +0000 (-0400) Subject: cmake : compile ggml-rocm with -fpic when building shared library (#3158) X-Git-Tag: gguf-v0.4.0~75 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=769266a543f68377a1d904ec2a8c27b38a4025ab;p=pkg%2Fggml%2Fsources%2Fllama.cpp cmake : compile ggml-rocm with -fpic when building shared library (#3158) --- 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()