From 004e3e308ee115a2f8be8dcca5adb14bd2ef2397 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 26 Dec 2023 14:18:39 +0000 Subject: [PATCH] ci(linux): install grpc from package manager --- .github/workflows/release.yaml | 6 +----- backend/cpp/llama/CMakeLists.txt | 15 +++++++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c6d2ff2b..3184cb5b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -30,11 +30,7 @@ jobs: sudo apt-get update sudo apt-get install build-essential ffmpeg - git clone --recurse-submodules -b v1.58.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc && \ - cd grpc && mkdir -p cmake/build && cd cmake/build && cmake -DgRPC_INSTALL=ON \ - -DgRPC_BUILD_TESTS=OFF \ - ../.. && sudo make -j12 install - + sudo apt-get install -y protobuf-compiler-grpc grpc-proto libgrpc++-dev libgrpc++1 libgrpc-dev libabsl-dev libprotobuf-dev - name: Build id: build env: diff --git a/backend/cpp/llama/CMakeLists.txt b/backend/cpp/llama/CMakeLists.txt index 7bf17871..56c46585 100644 --- a/backend/cpp/llama/CMakeLists.txt +++ b/backend/cpp/llama/CMakeLists.txt @@ -22,10 +22,17 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") include_directories("/opt/homebrew/include") endif() -find_package(absl CONFIG REQUIRED) -find_package(Protobuf CONFIG REQUIRED) -find_package(gRPC CONFIG REQUIRED) +include_directories(include) +find_package(gRPC CONFIG REQUIRED) +find_package(PkgConfig REQUIRED) + +include(FindProtobuf) +find_package(Protobuf REQUIRED) +include_directories(${PROTOBUF_INCLUDE_DIR}) + + +find_package(absl CONFIG REQUIRED) find_program(_PROTOBUF_PROTOC protoc) set(_GRPC_GRPCPP grpc++) find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin) @@ -71,4 +78,4 @@ target_link_libraries(${TARGET} PRIVATE common llama myclip ${CMAKE_THREAD_LIBS_ target_compile_features(${TARGET} PRIVATE cxx_std_11) if(TARGET BUILD_INFO) add_dependencies(${TARGET} BUILD_INFO) -endif() \ No newline at end of file +endif()