| outline | deep |
|---|---|
| description | 'source build' command reference |
::: info
If the build fails on macOS with the error "/usr/bin/cc" is not able to compile a simple test program, try running xcode-select --install to install the Xcode command line tools.
:::
::: details Programmatically calling the source build command in your code
To programmatically call this command in your code, call the BuildLlamaCppCommand function:
import {BuildLlamaCppCommand} from "node-llama-cpp/commands";
await BuildLlamaCppCommand({});Note: The
node-llama-cpp/commandsimport is subject to change and is unsupported inside Electron
:::
To set custom cmake options that are supported by
llama.cpp's cmake build, set an environment variable of the option prefixed withNODE_LLAMA_CPP_CMAKE_OPTION_.