Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4,105
    • Issues 4,105
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #22168
Closed
Open
Issue created May 07, 2021 by Olli Lupton@olupton

NVHPC compiler + Ninja misses header dependencies

With CMake 3.20.1 and nvc++ 21.2 (NVHPC 21.2) then include dependencies are silently not added with the Ninja generator.

This appears to be because the CMake configuration for the NVHPC compiler does not have anything like this to add the -MD option. This has been supported in NVHPC since at least version 20.9.

A quick and dirty test adding

set(CMAKE_DEPFILE_FLAGS_CXX "-MD<DEP_FILE>")

seems to improve the situation in a small test project.

Adding -MT <DEP TARGET>, which is documented in nvc++ -help, seems to modify the name of the target printed to the dependency file (as expected), but causes errors because it apparently stops the compiled object file being written. I am not sure what the downside, if any, of omitting the -MT option is.

If the Makefile generator is used then dependencies seem to be handled correctly.

I pushed a small demonstrator to https://gitlab.kitware.com/olupton/nvhpc-build-dependencies

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking