The following imported targets are referenced, but are missing: absl::any_invocable while trying to use gRPC for a project

40 views
Skip to first unread message

Abhishek Ghosh

unread,
Sep 11, 2023, 5:23:30 AMSep 11
to grpc.io

I am using the latest version as of the 10th of September, 2023. I am using gRPC for C++ on linux.

PACKAGE VERSION 1.59.0-dev CORE VERSION 35.0.0

I am trying to set up the code base of a project from Github. The code base uses gRPC and cmake to establish the dependencies.

From the CMakeLists.txt:

find_package(gRPC CONFIG REQUIRED) message(STATUS "Using gRPC ${gRPC_VERSION}")

I think that I have successfully installed gRPC and its required dependencies. At least, while building gRPC from its source and then trying to install it (used cmake to make and install the packages) did not find any issues or errors.

$ git clone https://github.com/grpc/grpc/ $ cd grpc $ git submodule update --init --recursive $ cd cmake $ mkdir build $ cd build $ cmake ../.. $ make -j`nproc` $ sudo make install

But while trying to build the project which I am trying to setup (the corresponding CMakeLists.txt file), I get the following error:

Call Stack (most recent call first): /usr/share/cmake-3.25/Modules/ExternalProject.cmake:4185 (_ep_add_download_command) worker/CMakeLists.txt:17 (ExternalProject_Add) This warning is for project developers. Use -Wno-dev to suppress it. Using protobuf 24.2.0 CMake Error at worker/serverless_gpu/CMakeLists.txt:16 (find_package): Found package configuration file: /usr/local/lib/cmake/grpc/gRPCConfig.cmake but it set gRPC_FOUND to FALSE so package "gRPC" is considered to be NOT FOUND. Reason given by package: The following imported targets are referenced, but are missing: absl::any_invocable

I am new to building systems that too using cmake. I am not very experienced. Can anyone please guide me to fix this issue?

I am using Ubuntu 18.04 with 5.4.0-150-generic kernel.

Abhishek Ghosh

unread,
Sep 11, 2023, 5:29:30 AMSep 11
to grpc.io

The contents of the file /usr/local/lib/cmake/grpc/gRPCConfig.cmake

# Module path list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) # Depend packages if(NOT TARGET absl::strings) find_package(absl CONFIG) endif() # Targets include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) if(NOT CMAKE_CROSSCOMPILING) include(${CMAKE_CURRENT_LIST_DIR}/gRPCPluginTargets.cmake) endif()

AJ Heller

unread,
Sep 13, 2023, 1:53:34 PMSep 13
to grpc.io
I believe this was answered in https://github.com/grpc/grpc/issues/34299

Abhishek Ghosh

unread,
Sep 13, 2023, 3:30:20 PMSep 13
to grpc.io
Yes, it was answered.
Reply all
Reply to author
Forward
0 new messages