Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ cmake_minimum_required(VERSION 3.4...3.22)
project(llama_cpp)

option(FORCE_CMAKE "Force CMake build of Python bindings" OFF)
option(DRY_RUN "Don't build any library" OFF)

set(FORCE_CMAKE $ENV{FORCE_CMAKE})

if (UNIX AND NOT FORCE_CMAKE)
if(DRY_RUN)
message("Remember ln -s /usr/lib/libllama.so
/usr/lib/python3.11/site-packages/llama_cpp/libllama.so")
elseif(UNIX AND NOT FORCE_CMAKE)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/vendor/llama.cpp/libllama.so
COMMAND make libllama.so
Expand All @@ -24,7 +28,7 @@ else()
set(BUILD_SHARED_LIBS "On")
add_subdirectory(vendor/llama.cpp)
install(
TARGETS llama
TARGETS llama
LIBRARY DESTINATION llama_cpp
RUNTIME DESTINATION llama_cpp
ARCHIVE DESTINATION llama_cpp
Expand Down
19 changes: 19 additions & 0 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env -S sh -c 'nvchecker -cnvchecker.toml --logger=json | jq -r '\''.version | sub("^v"; "") | split("-") | .[-1]'\'' | xargs -i{} sed -i "s/^\\(pkgver=\\).*/\\1{}/" $0'
# shellcheck shell=bash disable=SC2034,SC2154
# ex: nowrap
# Maintainer: Wu Zhenyu <wuzhenyu@ustc.edu>
pkgname=llama-cpp-python
pkgver=0.0.1
pkgrel=1
pkgdesc=""
arch=(x86 x86_64 arm aarch64)
url=https://github.com/Freed-Wu/$pkgname
license=(GPL3)
source=("$url/archive/$pkgver.tar.gz")
sha256sums=(SKIP)

package() {
cd "$pkgname-$pkgver" || return 1

make DESTDIR="$pkgdir" install
}