[cmake-developers] [CMake 0014322]: FindMPI.cmake does not produce a complete list of compile and link flags (-pthread missing)

Mantis Bug Tracker mantis at public.kitware.com
Tue Jul 30 11:08:16 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14322 
====================================================================== 
Reported By:                higgins
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14322
Category:                   Modules
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-07-30 11:08 EDT
Last Modified:              2013-07-30 11:08 EDT
====================================================================== 
Summary:                    FindMPI.cmake does not produce a complete list of
compile and link flags (-pthread missing)
Description: 
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.

Additional Information: 
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}")

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-07-30 11:08 higgins        New Issue                                    
======================================================================




More information about the cmake-developers mailing list