Skip to content
GitLab
  • Menu
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 3,926
    • Issues 3,926
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & 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
  • CMake
  • CMakeCMake
  • Issues
  • #21741
Closed
Open
Created Jan 25, 2021 by Olli Lupton@olupton

FindMPI mis-parses mpicc -compile-info output

FindMPI parses the output of mpicc -compile-info to find arguments roughly like -fXXX. This seems to be targeted at switches like -fstrict-aliasing.

With MPICH 3.4 (released 5 Jan 2021, installed via MacPorts) on MacOS 10.15 Catalina the command returns

mpicc -compile-info
/usr/bin/clang -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -framework OpenCL -Wl,-flat_namespace -Wl,-commons,use_dylibs -I/opt/local/include/mpich-mp -L/opt/local/lib/mpich-mp -lmpi -lpmpi

and the parsing extracts -framework without the corresponding OpenCL. This leads to bad compiler invocations, such as:

The MPI test test_mpi for C in mode normal failed to compile with the following output:
Change Dir: /Users/olupton/build/cmake_debug/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_b3f90/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_b3f90.dir/build.make CMakeFiles/cmTC_b3f90.dir/build
Building C object CMakeFiles/cmTC_b3f90.dir/test_mpi.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc  -isystem /opt/local/include/mpich-mp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.15 -framework -o CMakeFiles/cmTC_b3f90.dir/test_mpi.c.o -c /opt/local/share/cmake-3.19/Modules/FindMPI/test_mpi.c
clang: error: no such file or directory: 'CMakeFiles/cmTC_b3f90.dir/test_mpi.c.o'
clang: warning: -framework -o: 'linker' input unused [-Wunused-command-line-argument]

which cause CMake 3.19.3 to fail to find MPI on this system.

On the same system MPICH 3.3.2 did not return the -framework OpenCL fragment and everything worked as expected.

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