## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 2; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Licensecheck reports # # *No copyright* The Unlicense # ---------------------------- # common/base64.hpp # common/stb_image.h # These are public domain # # MIT License # ----------- # LICENSE # ... # This is the main license %global summary LLM inference in C/C++ %global _description %{expand: The main goal of llama.cpp is to enable LLM inference with minimal setup and state-of-the-art performance on a wide variety of hardware - locally and in the cloud. * Plain C/C++ implementation without any dependencies * Apple silicon is a first-class citizen - optimized via ARM NEON, Accelerate and Metal frameworks * AVX, AVX2, AVX512 and AMX support for x86 architectures * 1.5-bit, 2-bit, 3-bit, 4-bit, 5-bit, 6-bit, and 8-bit integer quantization for faster inference and reduced memory use * Custom CUDA kernels for running LLMs on NVIDIA GPUs (support for AMD GPUs via HIP and Moore Threads MTT GPUs via MUSA) * Vulkan and SYCL backend support * CPU+GPU hybrid inference to partially accelerate models larger than the total VRAM capacity} # enableing doc %define with_doc %{?_without_doc: 0} %{?!_without_doc: 1} # use OpenMP parallelization backaend %define with_omp %{?_without_omp: 0} %{?!_without_omp: 1} %define with_blis %{?_without_blis: 0} %{?!_without_blis: 1} %define with_rocm %{?_without_rocm: 0} %{?!_without_rocm: 1} %if 0%{?__isa_bits} == 64 %define with_x64 1 %endif %ifarch x86_64 %bcond_without rocm %else %bcond_with rocm %endif %ifarch %{ix86} %define with_x32 1 %endif Summary: LLM inference in C/C++ - OpenMP parallelization Name: llama-cpp License: MIT AND Apache-2.0 AND LicenseRef-Fedora-Public-Domain Epoch: 1 Version: b4290 ExclusiveArch: x86_64 aarch64 Release: %autorelease URL: https://github.com/ggerganov/llama.cpp Source0: %{url}/archive/%{version}.tar.gz#/llama.cpp-%{version}.tar.gz # https://github.com/ggerganov/llama.cpp/pull/10706 # ctest will fail test-eval-callback: curl # found in `examples/eval-callback/CMakeLists.txt` Patch0: 0001-fix-for-building-with-no-internet-connection.patch Requires: ggml # Build Required packages BuildRequires: git-core BuildRequires: xxd BuildRequires: cmake BuildRequires: wget BuildRequires: langpacks-en # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # glibc packages added just in case # glibc-all-langpacks and glibc-langpack-is are needed for GETTEXT_LOCALE and # GETTEXT_ISO_LOCALE test prereq's, glibc-langpack-en ensures en_US.UTF-8. BuildRequires: glibc-all-langpacks BuildRequires: glibc-langpack-en BuildRequires: glibc-langpack-is BuildRequires: glibc-all-langpacks # packages found in .github/workflows/server.yml BuildRequires: curl BuildRequires: pkgconfig(libcurl) BuildRequires: libcurl-devel # packages that either are or possibly needed BuildRequires: valgrind BuildRequires: valgrind-devel BuildRequires: valgrind-tools-devel BuildRequires: csmock-plugin-valgrind BuildRequires: gcc-c++ BuildRequires: libstdc++ BuildRequires: libstdc++-devel BuildRequires: libstdc++-static BuildRequires: g++ BuildRequires: make BuildRequires: automake BuildRequires: autoconf BuildRequires: clang BuildRequires: cpp BuildRequires: gdb BuildRequires: gcc-gdb-plugin BuildRequires: gcc-plugin-devel BuildRequires: gplugin-devel BuildRequires: gcc BuildRequires: glib BuildRequires: glib-devel BuildRequires: glibc BuildRequires: glibc-devel BuildRequires: multilib-rpm-config # https://docs.fedoraproject.org/en-US/packaging-guidelines/Fortran/ # https://gcc.gnu.org/wiki/GFortran BuildRequires: gcc-gfortran BuildRequires: libgfortran BuildRequires: libgfortran-static # https://docs.fedoraproject.org/en-US/packaging-guidelines/Web_Assets/ # GCC __float128 shared support library BuildRequires: libquadmath BuildRequires: libquadmath-devel BuildRequires: libquadmath-static # GNU Atomic library BuildRequires: libatomic BuildRequires: libatomic-static BuildRequires: libatomic_ops BuildRequires: libatomic_ops-devel BuildRequires: libatomic_ops-static # Address, Thread, Undefined, Leak Sanitizer BuildRequires: libasan BuildRequires: libasan-static BuildRequires: libhwasan BuildRequires: libhwasan-static BuildRequires: libtsan BuildRequires: libtsan-static BuildRequires: libubsan BuildRequires: libubsan-static BuildRequires: liblsan BuildRequires: liblsan-static # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # user required package # to use --numa numactl # options: `common/arg.cpp` Requires: curl Recommends: numactl BuildRequires: numactl # python # For the extra python package gguf that comes with llama-cpp %global pypi_name gguf %global pypi_version 0.1.0 # ./requirements/requirements-* Recommends: python3 BuildRequires: python3-devel BuildRequires: python3-huggingface-hub BuildRequires: python3dist(pip) BuildRequires: python3dist(poetry) BuildRequires: python3dist(pillow) BuildRequires: python3dist(torch) BuildRequires: python3dist(torchvision) BuildRequires: python3dist(torchvision) BuildRequires: python3dist(matplotlib) BuildRequires: python3dist(requests) BuildRequires: python3dist(aiohttp) BuildRequires: python3dist(pytest) BuildRequires: python3dist(numpy) BuildRequires: python3dist(prometheus-client) BuildRequires: python3dist(sentencepiece) BuildRequires: python3dist(cffi) # https://pypi.org/project/openai/ # https://pypi.org/project/transformers/ # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # hardware accelerate framework: # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # parallelization # multiprocessing paradigms (OpenMP/pthread): %if %{with_omp} ## OpenMP (Open Multi-Processing) # option: GGML_OPENMP=ON BuildRequires: libgomp %ifarch x86_64 # https://gcc.gnu.org/wiki/OpenACC # Nvidia PTX and AMD Radeon devices. BuildRequires: libgomp-offload-nvptx %endif %else ## pthread Requires: pthreadpool BuildRequires: pthreadpool BuildRequires: pthreadpool-devel BuildRequires: pkgconfig(pthread-stubs) %endif # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## High Bandwidth Memory (HBM): # option: GGML_CPU_HBM=ON Requires: memkind BuildRequires: memkind BuildRequires: memkind-devel # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Blas (Basic Linear Algebra System) # GGML_BLAS_VENDOR= # OpenBLAS, FLAME, ATLAS, FlexiBLAS, Intel, NVHPC # OpenBLAS BuildRequires: openblas BuildRequires: openblas-devel %if %{with_omp} ### Blas + openmp #BuildRequires: openblas-openmp %if %{with_x64} BuildRequires: openblas-openmp64 BuildRequires: openblas-openmp64_ %endif %else ### Blas + pthreads #BuildRequires: openblas-threads %if %{with_x64} BuildRequires: openblas-threads64 BuildRequires: openblas-threads64_ %endif %endif # these OpenBLAS packages may not be needed: BuildRequires: openblas-static #BuildRequires: openblas-serial BuildRequires: openblas-serial64 BuildRequires: openblas-serial64_ BuildRequires: openblas-srpm-macros BuildRequires: pkgconfig(liblas) #BuildRequires: pkgconfig(cblas) %if %{with_x64} BuildRequires: pkgconfig(cblas64) BuildRequires: pkgconfig(cblas64_) %endif ## lapack BuildRequires: lapack BuildRequires: lapack-devel BuildRequires: lapack-static BuildRequires: lapack64 BuildRequires: lapack64_ # FlexiBLAS # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Blis Requires: blis BuildRequires: blis BuildRequires: blis-devel BuildRequires: blis-srpm-macros %if %{with_omp} ### Blis + openmp Requires: blis-openmp BuildRequires: blis-openmp BuildRequires: blis-openmp64 %else ### Blis + pthreads Requires: blis-threads BuildRequires: blis-threads BuildRequires: blis-threads64 %endif # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Vulkan # set(GGML_VULKAN_CHECK_RESULTS OFF) # set(GGML_VULKAN_DEBUG OFF) # set(GGML_VULKAN_MEMORY_DEBUG OFF) # set(GGML_VULKAN_SHADER_DEBUG_INFO OFF) # set(GGML_VULKAN_PERF OFF) # set(GGML_VULKAN_VALIDATE OFF) # set(GGML_VULKAN_RUN_TESTS OFF) # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Rocm # GGML_HIP_UMA %ifarch x86_64 # BuildRequires: rocsolver # BuildRequires: libgomp-offload-amdgcn %endif %description %_description # ----------------------------------------------------------------------------- # sub packages # ----------------------------------------------------------------------------- %package ggml Summary: %{summary} - ggml %description ggml %{_description} %package devel Summary: %{summary} - devel %description devel %{_description} %package test Summary: %{summary} - test %description test %{_description} # TODO # ----------------------------------------------------------------------------- # prep # ----------------------------------------------------------------------------- %prep %autosetup -p1 -n llama.cpp-%{version} # pyhton fix find . -name \*.py -exec sed -i 's|/usr/bin/env python3|/usr/bin/python3|' {} \; # verson the *.so find . -iname "CMakeLists.*" -exec sed -i 's|POSITION_INDEPENDENT_CODE ON|POSITION_INDEPENDENT_CODE ON SOVERSION %{version}|' '{}' \; # shared libs need to be Off to enable hardware accelerate framework: # sed -i -e 's/@BUILD_SHARED_LIBS@/OFF/' cmake/llama-config.cmake.in # add environment variables manually to avoid cmake issue with `FindGit` # export LLAMA_VERSION=0.0.4284 # export LLAMA_BUILD_COMMIT=d9c3ba2b # export LLAMA_BUILD_NUMBER=4284 # export BRANCH_NAME=${{ github.head_ref || github.ref_name }} export GGML_NLOOP=3 export GGML_N_THREADS=1 export LLAMA_LOG_COLORS=1 export LLAMA_LOG_PREFIX=1 export LLAMA_LOG_TIMESTAMPS=1 # remove phone packages rm -rf exmples/llma.android rm -rf examples/llama.swiftui # remove documentation # find . -name '*.md' -exec rm -rf {} \; # git cruft find . -name '.gitignore' -exec rm -rf {} \; # ----------------------------------------------------------------------------- # build # ----------------------------------------------------------------------------- %build # https://github.com/ggerganov/llama.cpp/pull/10627 # -DOAI_FULL_COMPAT # build options: # ggml/CMakeLists.txt # .devops/full.Dockerfile # -DBUILD_SHARED_LIBS:BOOL=OFF \ # -DCMAKE_SKIP_RPATH:BOOL=ON \ %cmake \ -DCMAKE_BUILD_TYPE:STRING="-DNDEBUG" \ -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \ -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \ -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \ -DLLAMA_CURL:BOOL=ON \ -DGGML_CPU_ALL_VARIANTS:BOOL=ON \ -DGGML_NATIVE:BOOL=OFF \ -DGGML_BACKEND_DL:BOOL=ON \ -DSHARE_INSTALL_PREFIX:PATH=%{_prefix} \ -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \ -DLIB_INSTALL_DIR:PATH=%{_libdir} \ -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \ -DCMAKE_INSTALL_DO_STRIP:BOOL=ON \ %if 0%{?__isa_bits} == 64 -DLIB_SUFFIX=64 %else -DLIB_SUFFIX="" %endif %cmake_build --config Release # ----------------------------------------------------------------------------- # Install # ----------------------------------------------------------------------------- %install %cmake_install --prefix %{_prefix} # ----------------------------------------------------------------------------- # Verify # ----------------------------------------------------------------------------- # other tests in: `scripts/` %check %ctest # ----------------------------------------------------------------------------- # Files # ----------------------------------------------------------------------------- %files %license LICENSE %{_bindir}/llama-* %{_bindir}/convert_hf_to_gguf.py %{_libdir}/libggml-base.so.%{version} %{_libdir}/libggml.so.%{version} %{_libdir}/libllama.so.%{version} %files devel %{_libdir}/libllama.so %{_includedir}/llama.h %{_includedir}/llama-cpp.h %{_libdir}/cmake/llama/llama-config.cmake %{_libdir}/cmake/llama/llama-version.cmake %{_prefix}/lib/pkgconfig/llama.pc %files ggml %{_includedir}/ggml.h %{_includedir}/ggml-*.h %{_libdir}/libggml-base.so %{_libdir}/libggml.so %files test %{_bindir}/test-* %changelog ## START: Generated by rpmautospec * Sun Dec 08 2024 Mohammadreza Hendiani - 1:b4290-2 - Update to b4290 * Sun Dec 08 2024 Mohammadreza Hendiani - 1:b4290-1 - Update to b4290 * Sun Dec 08 2024 Mohammadreza Hendiani - 1:b4288-2 - Update to b4288 * Sun Dec 08 2024 Mohammadreza Hendiani - 1:b4288-1 - fixes * Sun Dec 08 2024 Mohammadreza Hendiani - 1:b4283-3 - remove mpi * Sat Dec 07 2024 Mohammadreza Hendiani - 1:b4283-2 - fixups * Sat Dec 07 2024 Mohammadreza Hendiani - 1:b4283-1 - Update to b4283 * Sat Dec 07 2024 Mohammadreza Hendiani - 1:b4267-4 - fix * Fri Dec 06 2024 Mohammadreza Hendiani - added llama.cpp to .gitignore * Fri Dec 06 2024 Mohammadreza Hendiani - added blis * Thu Dec 05 2024 Mohammadreza Hendiani - 1:b4267-1 - fix * Thu Dec 05 2024 Mohammadreza Hendiani - 1:b4265-5 - replaced absolute package path with regex * Thu Dec 05 2024 Mohammadreza Hendiani - 1:b4265-4 - remved check due to curl not having access to internet build fails * Thu Dec 05 2024 Mohammadreza Hendiani - 1:b4265-3 - fix * Wed Dec 04 2024 Mohammadreza Hendiani - 1:b4265-2 - bump to b4265 * Wed Dec 04 2024 Mohammadreza Hendiani - 1:b4265-1 - bump to b4248 * Wed Dec 04 2024 Mohammadreza Hendiani - 1:b4248-1 - DCMAKE_SKIP_RPATH=ON and -DBUILD_SHARED_LIBS=OFF * Tue Dec 03 2024 Mohammadreza Hendiani - 1:b4206-1 - adde verion version of so to files:w * Tue Dec 03 2024 Mohammadreza Hendiani - b4206-6 - removed bundled * Tue Dec 03 2024 Mohammadreza Hendiani - b4206-5 - testing bundled * Tue Dec 03 2024 Mohammadreza Hendiani - b4206-4 - added /usr/lib/pkgconfig/llama.pc to package * Tue Dec 03 2024 Mohammadreza Hendiani - b4206-3 - reomved debug files from pacake * Tue Dec 03 2024 Mohammadreza Hendiani - b4206-2 - added files for pacakging * Tue Dec 03 2024 Mohammadreza Hendiani - b4206-1 - added source repo name to .gitignore * Fri Nov 29 2024 Mohammadreza Hendiani - 1:b4206-8 - emoved every thing related to segmenting packages other than core packge bundled * Thu Nov 28 2024 Mohammadreza Hendiani - bundel packages * Thu Nov 28 2024 Mohammadreza Hendiani - added discription as global variable * Sun Oct 27 2024 Mohammadreza Hendiani - b3837-5 - fix rawhide build for `fedora-39-aarch64` by removeing `pthreadpool- devel` & `rocm*` packages * Fri Oct 18 2024 Mohammadreza Hendiani - b3837-4 - updated dependencies and fixed rocm Issues in rawhide, and, f40, (f39 doesn't have relevant dependencies) * Fri Oct 11 2024 Tom Rix - b3837-3 - Add ROCm backend * Thu Oct 10 2024 Tom Rix - b3837-2 - ccache is not available on RHEL. * Sat Sep 28 2024 Tom Rix - b3837-1 - Update to b3837 * Wed Sep 04 2024 Tom Rix - b3667-1 - Update to b3667 * Thu Jul 18 2024 Fedora Release Engineering - b3184-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Sat Jun 22 2024 Mohammadreza Hendiani - b3184-3 - added changelog * Sat Jun 22 2024 Mohammadreza Hendiani - b3184-2 - added .pc file * Sat Jun 22 2024 Mohammadreza Hendiani - b3184-1 - upgraded to b3184 which is used by llama-cpp-python v0.2.79 * Tue May 21 2024 Mohammadreza Hendiani - b2879-7 - removed old file names .gitignore * Sun May 19 2024 Tom Rix - b2879-6 - Remove old sources * Sun May 19 2024 Tom Rix - b2879-5 - Include missing sources * Sat May 18 2024 Mohammadreza Hendiani - b2879-4 - added build dependencies and added changelog * Sat May 18 2024 Mohammadreza Hendiani - b2879-3 - added aditional source * Fri May 17 2024 Mohammadreza Hendiani - b2879-2 - updated * Fri May 17 2024 Mohammadreza Hendiani - b2879-1 - updated and fix build bugs * Mon May 13 2024 Mohammadreza Hendiani - b2861-7 - removed source 1 * Mon May 13 2024 Mohammadreza Hendiani - b2861-6 - added llama.cpp-b2861.tar.gz to .gitignore * Mon May 13 2024 Mohammadreza Hendiani - b2861-5 - fixed source 1 url * Mon May 13 2024 Mohammadreza Hendiani - b2861-4 - added tag release as source 1 * Mon May 13 2024 Mohammadreza Hendiani - b2861-3 - fix source hash * Sun May 12 2024 Mohammadreza Hendiani - b2861-2 - fix mistake mistake in version * Sun May 12 2024 Mohammadreza Hendiani - b2861-1 - update b2861 * Sun May 12 2024 Mohammadreza Hendiani - b2860-2 - added changelog * Sun May 12 2024 Mohammadreza Hendiani - b2860-1 - bump version to b2860 * Sun May 12 2024 Mohammadreza Hendiani - b2619-5 - upgrade to b2860 tag * Sun May 12 2024 Mohammadreza Hendiani - b2619-4 - added ccache build dependency because LLAMA_CCACHE=ON on by default * Sun May 12 2024 Mohammadreza Hendiani - b2619-3 - added numactl as Weak dependency * Thu Apr 11 2024 Tom Rix - b2619-2 - New sources * Thu Apr 11 2024 Tomas Tomecek - b2619-1 - Update to b2619 (required by llama-cpp-python-0.2.60) * Sat Mar 23 2024 Tom Rix - b2417-2 - Fix test subpackage * Sat Mar 23 2024 Tom Rix - b2417-1 - Initial package ## END: Generated by rpmautospec