mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-10-01 01:06:10 -04:00
I don't understand why this is needed, but it works. Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
d2a99d9bc6
commit
a92d266cea
@ -793,16 +793,18 @@ function(include_ggml SUFFIX)
|
|||||||
list(APPEND XC_FLAGS -std=${LLAMA_METAL_STD})
|
list(APPEND XC_FLAGS -std=${LLAMA_METAL_STD})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(GGML_METALLIB ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/default.metallib)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/default.metallib
|
OUTPUT ${GGML_METALLIB}
|
||||||
COMMAND xcrun -sdk macosx metal ${XC_FLAGS} -c ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.metal -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.air
|
COMMAND xcrun -sdk macosx metal ${XC_FLAGS} -c ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.metal -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.air
|
||||||
COMMAND xcrun -sdk macosx metallib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.air -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/default.metallib
|
COMMAND xcrun -sdk macosx metallib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.air -o ${GGML_METALLIB}
|
||||||
COMMAND rm -f ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.air
|
COMMAND rm -f ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.air
|
||||||
COMMAND rm -f ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-common.h
|
COMMAND rm -f ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-common.h
|
||||||
COMMAND rm -f ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.metal
|
COMMAND rm -f ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ggml-metal.metal
|
||||||
DEPENDS ${DIRECTORY}/ggml-metal.metal ${DIRECTORY}/ggml-common.h
|
DEPENDS ${DIRECTORY}/ggml-metal.metal ${DIRECTORY}/ggml-common.h
|
||||||
COMMENT "Compiling Metal kernels"
|
COMMENT "Compiling Metal kernels"
|
||||||
)
|
)
|
||||||
|
set_source_files_properties(${GGML_METALLIB} DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTIES GENERATED ON)
|
||||||
|
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
ggml-metal ALL
|
ggml-metal ALL
|
||||||
|
@ -185,6 +185,7 @@ if(METAL_SHADER_FILE)
|
|||||||
set_target_properties(chat PROPERTIES
|
set_target_properties(chat PROPERTIES
|
||||||
RESOURCE ${METAL_SHADER_FILE}
|
RESOURCE ${METAL_SHADER_FILE}
|
||||||
)
|
)
|
||||||
|
add_dependencies(chat ggml-metal)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_definitions(chat
|
target_compile_definitions(chat
|
||||||
|
Loading…
Reference in New Issue
Block a user