MantisBT - CMake
View Issue Details
0014322CMakeModulespublic2013-07-30 11:082016-06-10 14:31
higgins 
Kitware Robot 
normalminoralways
closedmoved 
Linux3.2.0-49-generic
CMake 2.8.11.1 
 
0014322: FindMPI.cmake does not produce a complete list of compile and link flags (-pthread missing)
Openmpi produces the following

mpic++ --showme:compile
-I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread

mpic++ --showme:link
-pthread -L/usr/lib/openmpi/lib -lmpi_cxx -lmpi -lopen-rte -lopen-pal -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl

However, the regex code in FindMPI.cmake fails to pick-up flags that start with p.
To pick up flags starting with p I changed the following lines in FindMPI.cmake.

        # Extract include paths from compile command line
#ORIGINAL string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
          string(REGEX MATCHALL "(^| )-[Dfp]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")

        # Extract linker flags from the link command line
#ORIGINAL string(REGEX MATCHALL "(^| )-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
          string(REGEX MATCHALL "(^| )-[pWl]([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
No tags attached.
Issue History
2013-07-30 11:08higginsNew Issue
2016-06-10 14:29Kitware RobotNote Added: 0042332
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042332)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.