Stuart Henderson <s...@spacehopper.org> writes:

> On 2025/01/29 21:12, Chris Cappuccio wrote:
>> This is a simple port that works well out-of-the-box. It's kind of an 
>> emulator,
>> I think.
>>
>> It has some optional python scripts that will need numpy and torch.
>>
>> I'm not sure the right way to handle the version since it's "b4589" and not 
>> 1.0.
>> The ports tree thinks that's too incomplete, root/stem differentiation.
>
> Here are diffs to go on top. This sets the package version to 0.0.4589
> which is closely enough related I think. What you had will break things
> because it puts something other than a subpackage name in the place
> where a subpackage name should go. Also: use shlib versioning, enable
> tests, disable ccache autodetect (ports handles ccache on it's own and
> internal support usually messes this up), stop using -march=native (no
> good for bulk builds).
>
> I don't understand why it's in emulators. Perhaps misc would make sense?
>
>
> diff -uNp -r llama.cpp/Makefile /usr/ports/emulators/llama.cpp/Makefile
> --- llama.cpp/Makefile        Wed Jan 29 23:36:30 2025
> +++ /usr/ports/emulators/llama.cpp/Makefile   Thu Jan 30 09:03:29 2025
> @@ -1,5 +1,16 @@
>  COMMENT =            LLM inference system
>
> +GH_ACCOUNT =         ggerganov
> +GH_PROJECT =         llama.cpp
> +GH_TAGNAME =         b4589
> +PKGNAME =            llama-cpp-0.0.${GH_TAGNAME:S/b//}
> +
> +SHARED_LIBS +=               ggml-base 0.0
> +SHARED_LIBS +=               ggml-cpu 0.0
> +SHARED_LIBS +=               ggml 0.0
> +SHARED_LIBS +=               llama 0.0
> +SHARED_LIBS +=               llava_shared 0.0
> +
>  CATEGORIES =         emulators
>
>  HOMEPAGE =           https://github.com/ggerganov/llama.cpp
> @@ -9,15 +20,8 @@ PERMIT_PACKAGE =    Yes
>
>  WANTLIB += m pthread ${COMPILER_LIBCXX}
>
> -GH_ACCOUNT =         ggerganov
> -GH_PROJECT =         llama.cpp
> -GH_TAGNAME =         b4589
> -
> -V = 0.0
> -FULLPKGNAME =                llama-cpp-${GH_TAGNAME}-${V}
> -
>  MODULES =            devel/cmake
> -
> -NO_TEST =            Yes
> +CONFIGURE_ARGS =     -DGGML_CCACHE=Off \
> +                     -DGGML_NATIVE=Off

FWIW we should be able to include Vulkan support as its in ports. I've
played with llama.cpp locally with it, but I don't have a GPU that's
worth a damn top see if it's an improvement over pure CPU-based
inferencing.

Also should this be arm64 and amd64 specific? I'm not a ports person so
not sure :)

>
>  .include <bsd.port.mk>
> diff -uNp -r llama.cpp/pkg/PLIST /usr/ports/emulators/llama.cpp/pkg/PLIST
> --- llama.cpp/pkg/PLIST       Wed Jan 29 23:19:25 2025
> +++ /usr/ports/emulators/llama.cpp/pkg/PLIST  Thu Jan 30 08:47:24 2025
> @@ -81,9 +81,9 @@ lib/cmake/ggml/ggml-version.cmake
>  lib/cmake/llama/
>  lib/cmake/llama/llama-config.cmake
>  lib/cmake/llama/llama-version.cmake
> -@so lib/libggml-base.so
> -@so lib/libggml-cpu.so
> -@so lib/libggml.so
> -@so lib/libllama.so
> -@so lib/libllava_shared.so
> +@lib lib/libggml-base.so.${LIBggml-base_VERSION}
> +@lib lib/libggml-cpu.so.${LIBggml-cpu_VERSION}
> +@lib lib/libggml.so.${LIBggml_VERSION}
> +@lib lib/libllama.so.${LIBllama_VERSION}
> +@lib lib/libllava_shared.so.${LIBllava_shared_VERSION}
>  lib/pkgconfig/llama.pc

Reply via email to