Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1e3abfc

Browse filesBrowse files
howard0suggerganov
andauthored
cmake : fix build shared ggml when CUDA is enabled (ggml-org#1929)
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
1 parent 16b9cd1 commit 1e3abfc
Copy full SHA for 1e3abfc

File tree

Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed

‎CMakeLists.txt

Copy file name to clipboardExpand all lines: CMakeLists.txt
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ add_library(ggml_static STATIC $<TARGET_OBJECTS:ggml>)
469469
if (BUILD_SHARED_LIBS)
470470
set_target_properties(ggml PROPERTIES POSITION_INDEPENDENT_CODE ON)
471471
add_library(ggml_shared SHARED $<TARGET_OBJECTS:ggml>)
472+
target_link_libraries(ggml_shared PUBLIC Threads::Threads ${LLAMA_EXTRA_LIBS})
472473
endif()
473474

474475
add_library(llama
@@ -500,6 +501,11 @@ if (GGML_SOURCES_CUDA)
500501
set_property(TARGET ggml_static PROPERTY CUDA_ARCHITECTURES "native")
501502
set_property(TARGET ggml_static PROPERTY CUDA_SELECT_NVCC_ARCH_FLAGS "Auto")
502503

504+
if (BUILD_SHARED_LIBS)
505+
set_property(TARGET ggml_shared PROPERTY CUDA_ARCHITECTURES "native")
506+
set_property(TARGET ggml_shared PROPERTY CUDA_SELECT_NVCC_ARCH_FLAGS "Auto")
507+
endif()
508+
503509
set_property(TARGET llama PROPERTY CUDA_ARCHITECTURES "native")
504510
endif()
505511

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.