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

[Bug] CMakeLists.txt is missing FetchContent_Declare for googletest #329

Open
fabio-s-franco opened this issue Jan 31, 2025 · 0 comments
Open

Comments

@fabio-s-franco
Copy link

fabio-s-franco commented Jan 31, 2025

Thanks for participating in the TVM community! We use https://discuss.tvm.ai for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first 😸

Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.

Expected behavior

I have an orange pi 5 (aarch64), so I am building from source to leverage opencl on rk3588 chip.
Follow the instructions here and come out the other side with some binaries.

Actual behavior

Building does not work simply by following the documentation due to this error:

CMake Error at CMakeLists.txt:523 (message):
  Neither GTest::GTest nor GTest::gtest targets defined IMPORTED_LOCATION

I know nothing about cmake, so it took a bit of digging, but I found that CMakeLists.txt is missing this:

include(FetchContent)
FetchContent_Declare(
  googletest
  GIT_REPOSITORY https://github.com/google/googletest.git
  GIT_TAG        e235eb34c6c4fed790ccdad4b16394301360dcd4
)
FetchContent_MakeAvailable(googletest)

This references the latest commit as of today (if someone else sees this, go to the googletest repo to get the must up to date commit as per repo recommendation).

After including this in CMakeLists.txt I was I able to build.

I may not be doing this completely the right way due to my lack of experience with cmake, so take it with a grain of salt, but I think this dependency should be included in CMakeLists or have GTEST variable defaulting to false, which would also avoid this problem (I think).

Environment

I don't know what else would be relevant beyond this:

Driver

ICD loader Version                              2.3.1
ICD loader Profile                              OpenCL 3.0

Compiler tools

cmake version 3.25.1
gcc (Debian 12.2.0-14) 12.2.0
ccache version 4.7.5

Runtime

Python 3.11.2 (venv)

OS

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian

Hardware

OrangePi 5 aarch64 (rk3588) 8 GB RAM

Steps to reproduce

I am not sure, but I suspect you don't need an orange pi 5 to reproduce it. just a machine without gtest installed and follow the build instructions from the website, except this single modification to enable opencl:

echo "set(USE_OPENCL ON)" >> config.cmake  # originally off

Triage

Please refer to the list of label tags here to find the relevant tags and add them below in a bullet format (example below).

  • needs-triage
  • backend: opencl
@fabio-s-franco fabio-s-franco changed the title [Bug] CMakeLists.txt is missing FetchContent_Declare fpr googletest [Bug] CMakeLists.txt is missing FetchContent_Declare for googletest Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant