Skip to content

[Build System] add quiet to supress warning #1779

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erick-xanadu
Copy link
Contributor

Context: Likely, due to difference between find_dependency and FetchContent_{Declare,MakeAvailable} there is a warning when building Catalyst.

CMake Warning at /Users/mehrdad.malek/catalyst/venv/lib/python3.12/site-packages/cmake/data/share/cmake-3.30/Modules/CMakeFindDependencyMacro.cmake:76 (find_package):
  By not providing "Findnlohmann_json.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "nlohmann_json", but CMake did not find one.

  Could not find a package configuration file provided by "nlohmann_json"
  with any of the following names:

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

  Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
  "nlohmann_json_DIR" to a directory containing one of the above files.  If
  "nlohmann_json" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  cmake/modules/CMakeLists.txt:39 (find_dependency)

Description of the Change: Add QUIET to suppress warning.

Benefits: Less noisy builds.

Possible Drawbacks: It would be good to resolve this issue instead of making the warning go away.

Related GitHub Issues:

@dime10
Copy link
Contributor

dime10 commented Jun 2, 2025

It would be good to resolve this issue instead of making the warning go away.

Agreed 😅

@paul0403
Copy link
Member

paul0403 commented Jun 2, 2025

Hmm, I wonder why the ion dialect lit tests/openapl pytests were still passing, since these definitely use the pass that needs this cpp json package 🤔

@erick-xanadu
Copy link
Contributor Author

Hmm, I wonder why the ion dialect lit tests/openapl pytests were still passing, since these definitely use the pass that needs this cpp json package

I think it has to do with a difference between find_dependency and FetchContent_MakeAvailable. My understanding is that find_dependency happens at configure time. I.e., it will emit a warning if the dependency is not installed at configure time. However, FetchContent_MakeAvailable and FetchContent_Declare will download and build the dependency during build time.

I don't really think there's an issue with adding QUIET here. We could also do something like:

find_dependency(json, QUIET)

if not_found
  FetchContent...

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

Successfully merging this pull request may close these issues.

3 participants