Skip to content

Enable BUILD_SHARED_LIBS=ON on all Windows builds #3215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

IsaacDynamo
Copy link
Contributor

Enabled BUILD_SHARED_LIBS=ON on all Windows builds. With this change the release .zip files also contain llama.dll.

The release .dll allows you to use llama-cpp-python without compiling everything yourself. This is convenient for the more involved build targets such as cuBLAS.

llama-cpp-python will use the release .dll when the LLAMA_CPP_LIB env variable is set to the path of llama.dll

Tested the AVX2, OpenBLAS and cuBLAS .dll's with the following commands, and they work:

set LLAMA_CPP_LIB=C:\llama-release-dll-b1248-11eb9fb-bin-win-cublas-cu12.2.0-x64\llama.dll
set PATH=C:\llama-release-dll-b1248-11eb9fb-bin-win-cublas-cu12.2.0-x64;%PATH%
python.exe -m llama_cpp.server --model llama-2-7b-chat.Q5_K_M.gguf

@slaren
Copy link
Member

slaren commented Sep 16, 2023

Looks like this also reduces the size of the releases by a factor of 10, which is great.

@Green-Sky Green-Sky linked an issue Sep 16, 2023 that may be closed by this pull request
@Green-Sky
Copy link
Collaborator

@IsaacDynamo did you check the cublas builds still work? they got suspiciously small :)

... also totally forgot i wanted to do this 😄

@slaren
Copy link
Member

slaren commented Sep 16, 2023

I tested the avx2 and cu12 executables and they work for me.

@Green-Sky Green-Sky merged commit b541b4f into ggml-org:master Sep 16, 2023
pkrmf pushed a commit to morlockstudios-com/llama.cpp that referenced this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HOWTO] Easily compile llama.dll without hassle.
3 participants