Initial release

This commit is contained in:
civ
2026-08-16 18:27:57 +07:00
commit 8ff9ca0fc0
3800 changed files with 848933 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
ggml-build-install
ggml-build-install-dl
install
install-dl
build
build-dl
+10
View File
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.14)
project(ggml-simple)
set(CMAKE_CXX_STANDARD 17)
find_package(ggml 0.19.0 REQUIRED)
set(TEST_TARGET test-cmake)
add_executable(test-cmake test-cmake.cpp)
target_link_libraries(test-cmake PRIVATE ggml::ggml)
+21
View File
@@ -0,0 +1,21 @@
## cmake-test
This directory can be built as a separate project to test/verify a ggml
installation.
### Usage
The following will configure, build, and install ggml using two different
configurations. One will use dynamically linked backends (GGML_BACKEND_DL=ON)
and one without.
Configuring, build, and install ggml:
```console
./build-install.sh
```
Build this project twice using the installations created above:
```console
./build.sh
```
_wip_
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
set -e
# Remove installation target directory
rm -rf install-dl install ggml-build-install-dl ggml-build-install
### Build standard installation
build_dir=ggml-build-install
install_dir=install
cmake --fresh -S ../../. -B $build_dir -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX="${PWD}/${install_dir}"
cmake --build $build_dir --parallel 12
cmake --install $build_dir
### Build dynamic backend
build_dir=ggml-build-install-dl
install_dir=install-dl
# Build dynamic backend modules and install them in libexec, mirroring a package
# manager's private plugin directory. GGML_BACKEND_DIR is compiled into ggml as
# its plugin search path, and cmake --install copies the backend modules there.
cmake --fresh -S ../../. -B $build_dir -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DGGML_BACKEND_DL=ON \
-DGGML_CPU_ALL_VARIANTS=ON \
-DCMAKE_INSTALL_PREFIX="${PWD}/${install_dir}" \
-DGGML_BACKEND_DIR="${PWD}/${install_dir}/libexec"
cmake --build $build_dir --parallel 12
cmake --install $build_dir
+11
View File
@@ -0,0 +1,11 @@
#include "ggml-backend.h"
#include "ggml.h"
#include <cstdio>
int main(void) {
printf("[test-cmake] Using ggml version %s\n", ggml_version());
printf("[test-cmake] Loading all backends...\n");
ggml_backend_load_all();
printf("[test-cmake] Succesfully loaded all backend.\n");
return 0;
}