Skip to content
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

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

Closed
Abhishekghosh1998 opened this issue Sep 10, 2023 · 2 comments

Comments

@Abhishekghosh1998
Copy link

Abhishekghosh1998 commented Sep 10, 2023

What version of gRPC and what language are you using?

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

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()

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.

@Abhishekghosh1998
Copy link
Author

Abhishekghosh1998 commented Sep 10, 2023

@drfloob @carlocab, Please can you help me with this issue? I don't know whether it is a bug or a problem from my end in the setup or some missing configuration (like some missing statements) in the code base I am looking into.

I am not that experienced enough to figure out the issue myself. Like where things are going wrong.

@Abhishekghosh1998 Abhishekghosh1998 changed the title The following imported targets are referenced, but are missing: absl::any_invocable while trying to use gRPC for a project The following imported targets are referenced, but are missing: absl::any_invocable while trying to use gRPC for a project Sep 10, 2023
@drfloob
Copy link
Member

drfloob commented Sep 11, 2023

A good place to start would be the helloworld CMake example. If you want to build and install a self-contained gRPC library to a system folder, https://github.com/grpc/grpc/blob/ed310023cd128ec0cbd4f02e639fc909edaaadd0/examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants