File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ option(LLAMA_CUDA_ENABLE_UNIFIED_MEMORY "llama: enable to avoid OOM in Full
7373option (GGML_IQK_MUL_MAT "ggml: use optimized iqk matrix multiplications" OFF )
7474option (GGML_USE_LLAMA_CPP_MAINLINE "ggml: use Llama CPP mainline MatMul " OFF )
7575
76+ option (GGML_CCACHE "ggml: use ccache if available" ON )
77+
7678#
7779# Compile flags
7880#
@@ -104,6 +106,27 @@ set(GGML_V2_CUDA_SOURCES otherarch/ggml_v2-cuda.cu otherarch/ggml_v2-cuda.h)
104106set (GGML_V2_LEGACY_CUDA_SOURCES otherarch/ggml_v2-cuda-legacy.cu otherarch/ggml_v2-cuda-legacy.h)
105107
106108
109+ # Ccache
110+
111+ if (GGML_CCACHE)
112+ find_program (GGML_CCACHE_FOUND ccache)
113+ find_program (GGML_SCCACHE_FOUND sccache)
114+
115+ if (GGML_CCACHE_FOUND OR GGML_SCCACHE_FOUND)
116+ if (GGML_CCACHE_FOUND)
117+ set (GGML_CCACHE_VARIANT ccache)
118+ else ()
119+ set (GGML_CCACHE_VARIANT sccache)
120+ endif ()
121+ # TODO: should not be set globally
122+ set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${GGML_CCACHE_VARIANT} " )
123+ set (ENV{CCACHE_SLOPPINESS} time_macros)
124+ message (STATUS "${GGML_CCACHE_VARIANT} found, compilation results will be cached. Disable with GGML_CCACHE=OFF." )
125+ else ()
126+ message (STATUS "Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF" )
127+ endif ()
128+ endif ()
129+
107130# Croco.Cpp with IK MM
108131if (GGML_IQK_MUL_MAT)
109132 message (STATUS "Using optimized iqk matrix multiplications" )
You can’t perform that action at this time.
0 commit comments