Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,236
    • Issues 3,236
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #19996

Closed
Open
Opened Nov 19, 2019 by Keith Ballard@keith.m.ballardContributor

FindMPI not finding C if LANGUAGES CXX is specified

For context, I am compiling a plugin for ParaView. I have a project that is in C++, and I use the find_package(ParaView) to link the plugin against the ParaView project. During the configuration, I get an error about FindMPI not being able to find MPI_C.

After investigation, I found that for any CMake project that specifies "LANGUAGES CXX" a subsequent find MPI call with "COMPONENTS C" specified results in an error. such as the cmake below:

cmake_minimum_required(VERSION 3.8)
project(test LANGUAGES CXX)

find_package(MPI REQUIRED
        COMPONENTS C CXX
        OPTIONAL_COMPONENTS)

I am unsure if this is how CMake was intended to work. The interaction between LANGUAGES and a find_package call seems ambiguous to me, but I am no CMake expert personally.

In the context of the ParaView problem I had talked about. This does create an issue. I intended to specify the languages of my project, not the dependent packages. However, somehow my specification of the language impacted CMake code within the ParaView package itself. For now, I will omit the LANGUAGES specification from my CMake.

It seems that this is a bug, but clarification on whether this is a bug or not is appreciated as this is a complicated case IMHO.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: cmake/cmake#19996