Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 4b693f5

Browse files
committed
add dylib for linux
1 parent 25fc6fd commit 4b693f5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

engine/services/engine_service.cc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,23 @@ cpp::result<void, std::string> EngineService::LoadEngine(
794794
#endif
795795
engines_[ne].dl =
796796
std::make_unique<cortex_cpp::dylib>(engine_dir_path.string(), "engine");
797+
#if defined(__linux__)
798+
const char* name = "LD_LIBRARY_PATH";
799+
auto data = getenv(name);
800+
std::string v;
801+
if (auto g = getenv(name); g) {
802+
v += g;
803+
}
804+
CTL_INF("LD_LIBRARY_PATH: " << v);
805+
auto llamacpp_path = file_manager_utils::GetCudaToolkitPath(kLlamaRepo);
806+
CTL_INF("llamacpp_path: " << llamacpp_path);
807+
// tensorrt is not supported for now
808+
// auto trt_path = file_manager_utils::GetCudaToolkitPath(kTrtLlmRepo);
809+
810+
auto new_v = llamacpp_path.string() + ":" + v;
811+
setenv(name, new_v.c_str(), true);
812+
CTL_INF("LD_LIBRARY_PATH: " << getenv(name));
813+
#endif
797814

798815
} catch (const cortex_cpp::dylib::load_error& e) {
799816
CTL_ERR("Could not load engine: " << e.what());

0 commit comments

Comments
 (0)