Unfortunately, the llama.cpp webui now requires node to build (or to
download already-built files from huggingface. I implemented effectively
the same strategy already used in CMake. This complicates the Makefile
considerably, but it's the best way to make it work.
If node is installed, then it will build the llama.cpp webui. If it is
not, it will download the required files from huggingface using wget.
Fixes#387
Ever since w64devkit began forcing bigobj by default, it has been
incompatible with cgo. I patched go to support bigobj, but unfortunately
upstream the patch ran in to bureaucracy/difficulties and I ran out of
patience to get it through. So that means it's not really an option to
use upstream go binaries, it must build from source. Bootstrapping go is
not difficult, but it has grown more tedious as more required stages
have been added to the bootstrap chain.
So, to spare myself some tedium, I have created
bootstrap-go-toolchain.sh. It builds the latest version of go, from
source, using only w64devkit's gcc compiler. It also adds my bigobj
patches to the toolchain, so cgo works properly.
Now the clean target deletes this entire directory, so we can't miss
cleaning up vulkan related build artifacts. Previously, make -f
llama.mak clean would not remove
ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp.gen.o
Upstream commit 6990e2f1 changed common/build-info.cpp.in from just defining globals:
int LLAMA_BUILD_NUMBER = ...;
char const *LLAMA_COMMIT = ...;
to also defining functions:
int llama_build_number(void)
const char * llama_commit(void)
const char * llama_build_info(void)
To fix this, now we generate w64dk-build-info.cpp from the provided
common/build-info.cpp.in template.
The convention is ALL_CAPS is intended for user override and all_lower
is for internal variables. Introduce CC and CXX to enable finer control
over the compiler (ccache, etc.).
Now that GGML's version has been bumped from 0.9.4 to 0.9.5, the
hardcoded version in llama.mak is no longer correct. Instead, parse the
version number out of the CMakeLists.txt and retrieve the commit hash
using git if available.
This should cut back on most, though not all, build script updates. The
mtmd subdirectory still requires a manual listing because it only uses a
few files. The generated build info source was moved out of the way so
that it doesn't match globs. It also now builds the llama.dll.a import
library.
See #309. Closes#316.
An increasing set of llama.cpp build configurations, particularly at
lower optimization levels, go just beyond COFF limitations and require
the "newer" bigobj COFF format in order to build.
It didn't quite work out-of-the-box because it needed server assets and
build-info.cpp. On my system, the generated files were left behind from
an old build, so I didn't notice.
The official llama.cpp CMake build has a bug where build-info.cpp is
generated in the original source tree, not the build directory, and so
concurrent out-of-tree builds race to produce incorrect binaries. This
makefile avoids a conflict by using a unique name.
This library can be installed to a path with spaces, so all instances of
the prefix must be quoted. Though Autoconf does not support paths with
spaces and will not be able to use such installations.
I was initially impressed with its output, but over time I've found it
less and less useful. I hardly use it anymore, and it would at best be
neglected if left in the distribution. The build script is retained in
the contrib/ directory, and it's easy to build natively from source.