Skip to content

Commit

Permalink
cmake : minor [no ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Jun 24, 2024
1 parent 7ef5da1 commit 1f859b8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ GGML_METAL := 1
DEPRECATE_WARNING := 1
endif

ifdef LLAMA_METAL_EMBED_LIBRARY
GGML_METAL_EMBED_LIBRARY := 1
DEPRECATE_WARNING := 1
endif

ifdef LLAMA_OPENMP
GGML_OPENMP := 1
DEPRECATE_WARNING := 1
Expand Down Expand Up @@ -183,6 +178,10 @@ ifeq ($(UNAME_S),Darwin)
endif
endif

ifdef GGML_METAL
GGML_METAL_EMBED_LIBRARY := 1
endif

ifdef GGML_RPC
BUILD_TARGETS += rpc-server
endif
Expand Down
2 changes: 1 addition & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SRC=`pwd`
CMAKE_EXTRA="-DLLAMA_FATAL_WARNINGS=ON"

if [ ! -z ${GG_BUILD_METAL} ]; then
CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_METAL=ON -DGGML_METAL_EMBED_LIBRARY=ON"
CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_METAL=ON"
fi

if [ ! -z ${GG_BUILD_CUDA} ]; then
Expand Down
3 changes: 2 additions & 1 deletion ggml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ option(GGML_KOMPUTE "ggml: use Kompute"
option(GGML_METAL "ggml: use Metal" ${GGML_METAL_DEFAULT})
option(GGML_METAL_NDEBUG "ggml: disable Metal debugging" OFF)
option(GGML_METAL_SHADER_DEBUG "ggml: compile Metal with -fno-fast-math" OFF)
option(GGML_METAL_EMBED_LIBRARY "ggml: embed Metal library" OFF)
option(GGML_METAL_EMBED_LIBRARY "ggml: embed Metal library" ${GGML_METAL})
set (GGML_METAL_MACOSX_VERSION_MIN "" CACHE STRING
"ggml: metal minimum macOS version")
set (GGML_METAL_STD "" CACHE STRING "ggml: metal standard version (-std flag)")
Expand Down Expand Up @@ -219,6 +219,7 @@ if (GGML_METAL)
GROUP_READ
WORLD_READ
DESTINATION ${CMAKE_INSTALL_BINDIR})

if (NOT GGML_METAL_EMBED_LIBRARY)
install(
FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/default.metallib
Expand Down
4 changes: 4 additions & 0 deletions ggml/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,10 @@ add_library(ggml OBJECT
${GGML_SOURCES_LLAMAFILE} ${GGML_HEADERS_LLAMAFILE}
)

if (EMSCRIPTEN)
set_target_properties(ggml PROPERTIES COMPILE_FLAGS "-msimd128")
endif()

target_compile_definitions(ggml PUBLIC ${GGML_CDEF_PUBLIC})
target_compile_definitions(ggml PRIVATE ${GGML_CDEF_PRIVATE})

Expand Down

0 comments on commit 1f859b8

Please sign in to comment.