Skip to content

Conversation

@ngxson
Copy link
Collaborator

@ngxson ngxson commented Nov 10, 2025

Split httplib.h into cpp and header files, allowing it to be compiled as separated unit

master:
cmake --build build -j --target llama-server  24.28s user 1.53s system 99% cpu 25.958 total

PR:
cmake --build build -j --target llama-server  16.38s user 0.62s system 100% cpu 16.963 total

Ref script: https://github.com/yhirose/cpp-httplib/blob/master/httplib.h

@ngxson ngxson requested a review from ggerganov as a code owner November 10, 2025 18:00
set(CMAKE_REQUIRED_INCLUDES ${SAVED_CMAKE_REQUIRED_INCLUDES})
if (OPENSSL_VERSION_SUPPORTED)
message(STATUS "OpenSSL found: ${OPENSSL_VERSION}")
set(LLAMA_COMMON_EXTRA_LIBS ${LLAMA_COMMON_EXTRA_LIBS} cpp-httplib) # requires httplib for SSL support
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why this is needed - seems incorrect.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The line next to this suggests that it's used by httplib, CPPHTTPLIB_OPENSSL_SUPPORT

So I assume that it need to be present here. Seems to be used by the download functionality (alternative to curl), right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Otherwise, I think it should be in the if NOT LLAMA_CURL condition, meaning if we don't use curl, then we will use httplib. Though I'm not sure if this is correct. CC @angt

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah nevermind, it's correct that libcommon needs cpp-httplib if CURL is not used. Last commit should fix the CI error: https://github.com/ggml-org/llama.cpp/actions/runs/19241641967/job/55005558638?pr=17150

@github-actions github-actions bot added build Compilation issues script Script related examples python python script changes server labels Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Compilation issues examples python python script changes script Script related server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants