[cmake-developers] [CMake 0015182]: FindMPI.cmake fails to properly detect Intel MPI 5.0.1

Mantis Bug Tracker mantis at public.kitware.com
Tue Sep 30 16:26:23 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15182 
====================================================================== 
Reported By:                Kelly Thompson
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15182
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-09-30 16:26 EDT
Last Modified:              2014-09-30 16:26 EDT
====================================================================== 
Summary:                    FindMPI.cmake fails to properly detect Intel MPI
5.0.1
Description: 
The FindMPI.cmake module queries for include path and link libraries by
attempting to use various options (e.g.: -showme:compile) of
MPI_${lang}_COMPILER.  

      # Check whether the -showme:compile option works. This indicates that we
have either OpenMPI
      # or a newer version of LAM-MPI, and implies that -showme:link will also
work.
      execute_process(
        COMMAND ${MPI_${lang}_COMPILER} -showme:compile
        OUTPUT_VARIABLE  MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
        ERROR_VARIABLE   MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
        RESULT_VARIABLE  MPI_COMPILER_RETURN)

For Intel MPI, MPI_CXX_COMPILER has the value 'mpiicpc.'  The command 'mpiicpc
-showme:compile' fails, but returns a '0' error code:

% mpiicpc -showme:comple; echo $?
icpc: command line warning http://public.kitware.com/Bug/view.php?id=10006:
ignoring unknown option '-showme:comple'
/var/lib/perceus/vnfs/asc-fe/rootfs/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o:
In function `_start':
(.text+0x20): undefined reference to `main'
0

I have contacted Intel support and they confirmed that this is by design. 
Unknown compiler options are considered to be warnings, not errors. 

This issue can be fixed by adding more complex logic to test the error state of
the 'mpiicpc -showme:compile' command.  In my local install of CMake, I added
the following logic:

  if( "${MPI_COMPILE_CMDLINE}" MATCHES "undefined reference")
    set( MPI_COMPILER_RETURN 255 )
  endif()

This appears to solve the problem of incorrect information being saved in
MPI_LINK_CMDLINE, MPI_INCDIRS, and MPI_LIBDIRS.


Steps to Reproduce: 
Before running cmake, I needed to set these environment variables:

export CXX=`which mpiicpc`
export CC=`which mpiicc`
export MPIEXEC=`which srun`

So that FindMPI would query the correct MPI compile wrappers.

See bug description for more details.


Additional Information: 
I can reproduce this issue with Intel MPI 5.0.1 and Intel MPI 4.1.3 on two
different systems (RHEL 6.4 and RHEL 6.5)
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-09-30 16:26 Kelly Thompson New Issue                                    
======================================================================



More information about the cmake-developers mailing list