-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
llama-cpp: Add new b4570 version #26477
base: master
Are you sure you want to change the base?
Conversation
recipes/llama-cpp/all/conanfile.py
Outdated
if is_apple_os(self): | ||
self.cpp_info.components["common"].frameworks.extend(["Foundation", "Accelerate", "Metal"]) | ||
elif self.settings.os in ("Linux", "FreeBSD"): | ||
self.cpp_info.components["common"].system_libs.extend(["dl", "m", "pthread", "gomp"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this code is common for all versions?
recipes/llama-cpp/all/conanfile.py
Outdated
self.cpp_info.components["common"].requires = ["llama"] | ||
if self.options.with_curl: | ||
self.cpp_info.components["common"].requires.append("libcurl::libcurl") | ||
self.cpp_info.components["common"].defines.append("LLAMA_USE_CURL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to define this in the package_info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upstream's CMakeLists contains target_compile_definitions(${TARGET} PUBLIC LLAMA_USE_CURL)
with TARGET
being common
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And is this new from this version or should we add it to the old versions too?
recipes/llama-cpp/all/conanfile.py
Outdated
if self.options.with_curl: | ||
self.cpp_info.components["common"].requires.append("libcurl::libcurl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be defined for both versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because if no requires is explicitly defined, all components get all the library requirements. I can be more explicity to avoid overlinking in old versions
recipes/llama-cpp/all/conanfile.py
Outdated
if Version(self.version) >= "b4570": | ||
self.cpp_info.components["common"].includedirs = [os.path.join("include", "common")] | ||
self.cpp_info.components["common"].libs = ["common"] | ||
self.cpp_info.components["common"].requires = ["llama"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true? I'm not sure that llama requires common, this requires was not defined for previous versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target_link_libraries (${TARGET} PRIVATE ${LLAMA_COMMON_EXTRA_LIBS} PUBLIC llama Threads::Threads)
with TARGET
being common
here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it was missing for the old versions too, as this same line is present in the previous version too
recipes/llama-cpp/all/conanfile.py
Outdated
self.cpp_info.components["common"].includedirs = [os.path.join("include", "common")] | ||
self.cpp_info.components["common"].libs = ["common"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move this out from the if Version and use for all versions
recipes/llama-cpp/all/conanfile.py
Outdated
if self.options.with_cuda and not self.options.shared: | ||
self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) | ||
module_path = os.path.join("lib", "cmake", "llama-cpp-cuda-static.cmake") | ||
self.cpp_info.set_property("cmake_build_modules", [module_path]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can also be shared between both versions
"b4079": | ||
- patch_file: "patches/b4079-001-curl-patch-targets.patch" | ||
"b3542": | ||
- patch_file: "patches/b3542-001-curl-patch-targets.patch" | ||
"b3040": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version had a slightly different logic, because did not have the ggml component so it the recipe was a bit cleaner removing this, and it's also quiet outdated
Summary
Changes to recipe: llama-cpp/b4570
Motivation
We wanted to use it in a future blogpost
Details
Lots of changes for this new version, so the package_info is split in two: the old one, and the new one. Maybe it would be better to remove the old versions from the conandata and just keep this new version, but thought that the current approach is a bit better until we can decide