Skip to content
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

feat: use cmake instead of node-gyp #37

Merged
merged 4 commits into from
Sep 9, 2023
Merged

feat: use cmake instead of node-gyp #37

merged 4 commits into from
Sep 9, 2023

Conversation

giladgd
Copy link
Contributor

@giladgd giladgd commented Sep 9, 2023

Description of change

Use cmake via cmake-js to build llama.cpp from source instead of node-gyp.

cmake-js has multiple advantages over node-gyp for node-llama-cpp:

  • llama.cpp itself uses cmake, so using cmake here will be better align with llama.cpp and will be able to support all of its features
  • cmake doesn't use python, so there won't be any need to mess with python installations anymore just to compile llama.cpp from source
  • cmake has less dependencies, thus making it more practical to use
  • If cmake is not installed on the local machine, the cmake binary will be downloaded to an internal directory so node-llama-cpp can use it without even having it installed.

Since the dependencies of node-gyp cover the dependencies of cmake, and this PR fallbacks to downloading cmake in case it's not installed on the user's machine, this is not a breaking change, the version of node-llama-cpp can be bumped by only a minor version.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run format to apply prettier formatting
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits and pull request title follow conventions explained in CONTRIBUTING.md (PRs that do not follow this convention will not be merged)

@giladgd giladgd self-assigned this Sep 9, 2023
Copy link
Contributor

@ido-pluto ido-pluto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giladgd giladgd merged commit 01b89ce into master Sep 9, 2023
8 checks passed
@giladgd giladgd deleted the gilad/moveToCmakeJs branch September 9, 2023 21:30
@github-actions
Copy link

github-actions bot commented Sep 9, 2023

🎉 This PR is included in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants