|
6 | 6 | # Notes for llama.cpp:
|
7 | 7 | # 1. Tags are currently based on hash - which will not sort asciibetically.
|
8 | 8 | # We need to declare standard versioning if people want to sort latest releases.
|
| 9 | +# In the meantime, YYYYMMDD format will be used. |
9 | 10 | # 2. Builds for CUDA/OpenCL support are separate, with different depenedencies.
|
10 | 11 | # 3. NVidia's developer repo must be enabled with nvcc, cublas, clblas, etc installed.
|
11 | 12 | # Example: https://developer.download.nvidia.com/compute/cuda/repos/fedora37/x86_64/cuda-fedora37.repo
|
12 | 13 | # 4. OpenCL/CLBLAST support simply requires the ICD loader and basic opencl libraries.
|
13 | 14 | # It is up to the user to install the correct vendor-specific support.
|
14 | 15 |
|
15 | 16 | Name: llama.cpp
|
16 |
| -Version: master |
| 17 | +Version: %( date "+%%Y%%m%%d" ) |
17 | 18 | Release: 1%{?dist}
|
18 | 19 | Summary: CPU Inference of LLaMA model in pure C/C++ (no CUDA/OpenCL)
|
19 | 20 | License: MIT
|
20 | 21 | Source0: https://github.com/ggerganov/llama.cpp/archive/refs/heads/master.tar.gz
|
21 |
| -BuildRequires: coreutils make gcc-c++ git |
| 22 | +BuildRequires: coreutils make gcc-c++ git libstdc++-devel |
| 23 | +Requires: libstdc++ |
22 | 24 | URL: https://github.com/ggerganov/llama.cpp
|
23 | 25 |
|
24 | 26 | %define debug_package %{nil}
|
25 | 27 | %define source_date_epoch_from_changelog 0
|
26 | 28 |
|
27 | 29 | %description
|
28 | 30 | CPU inference for Meta's Lllama2 models using default options.
|
| 31 | +Models are not included in this package and must be downloaded separately. |
29 | 32 |
|
30 | 33 | %prep
|
31 |
| -%autosetup |
| 34 | +%setup -n llama.cpp-master |
32 | 35 |
|
33 | 36 | %build
|
34 | 37 | make -j
|
35 | 38 |
|
36 | 39 | %install
|
37 | 40 | mkdir -p %{buildroot}%{_bindir}/
|
38 |
| -cp -p main %{buildroot}%{_bindir}/llamacpp |
39 |
| -cp -p server %{buildroot}%{_bindir}/llamacppserver |
40 |
| -cp -p simple %{buildroot}%{_bindir}/llamacppsimple |
| 41 | +cp -p main %{buildroot}%{_bindir}/llama |
| 42 | +cp -p server %{buildroot}%{_bindir}/llamaserver |
| 43 | +cp -p simple %{buildroot}%{_bindir}/llamasimple |
| 44 | + |
| 45 | +mkdir -p %{buildroot}/usr/lib/systemd/system |
| 46 | +%{__cat} <<EOF > %{buildroot}/usr/lib/systemd/system/llama.service |
| 47 | +[Unit] |
| 48 | +Description=Llama.cpp server, CPU only (no GPU support in this build). |
| 49 | +After=syslog.target network.target local-fs.target remote-fs.target nss-lookup.target |
| 50 | + |
| 51 | +[Service] |
| 52 | +Type=simple |
| 53 | +EnvironmentFile=/etc/sysconfig/llama |
| 54 | +ExecStart=/usr/bin/llamaserver $LLAMA_ARGS |
| 55 | +ExecReload=/bin/kill -s HUP $MAINPID |
| 56 | +Restart=never |
| 57 | + |
| 58 | +[Install] |
| 59 | +WantedBy=default.target |
| 60 | +EOF |
| 61 | + |
| 62 | +mkdir -p %{buildroot}/etc/sysconfig |
| 63 | +%{__cat} <<EOF > %{buildroot}/etc/sysconfig/llama |
| 64 | +LLAMA_ARGS="-m /opt/llama2/ggml-model-f32.bin" |
| 65 | +EOF |
41 | 66 |
|
42 | 67 | %clean
|
43 | 68 | rm -rf %{buildroot}
|
44 | 69 | rm -rf %{_builddir}/*
|
45 | 70 |
|
46 | 71 | %files
|
47 |
| -%{_bindir}/llamacpp |
48 |
| -%{_bindir}/llamacppserver |
49 |
| -%{_bindir}/llamacppsimple |
| 72 | +%{_bindir}/llama |
| 73 | +%{_bindir}/llamaserver |
| 74 | +%{_bindir}/llamasimple |
| 75 | +/usr/lib/systemd/system/llama.service |
| 76 | +%config /etc/sysconfig/llama |
50 | 77 |
|
51 | 78 | %pre
|
52 | 79 |
|
|
0 commit comments