MantisBT - CMake |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0015182 | CMake | CMake | public | 2014-09-30 16:26 | 2015-05-04 09:05 |
|
Reporter | Kelly Thompson | |
Assigned To | Chuck Atkins | |
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | Linux | OS | Red Hat Enterprise Linux | OS Version | 6.5 |
Product Version | CMake 3.0 | |
Target Version | CMake 3.2 | Fixed in Version | CMake 3.2 | |
|
Summary | 0015182: 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 #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) |
Tags | No tags attached. |
Relationships | related to | 0014991 | closed | Kitware Robot | FindMPI doesn't pass compiler flags to $MPICC -show. Finds wrong libraries for Xeon Phi native mode. |
|
Attached Files | doublecheckerror.diff (3,882) 2014-12-04 13:51 https://public.kitware.com/Bug/file/5311/doublecheckerror.diff usecompilerewrapper.diff (892) 2014-12-04 14:01 https://public.kitware.com/Bug/file/5312/usecompilerewrapper.diff 0001-FindMPI-Factor-out-compiler-wrapper-execution-into-h.patch (3,787) 2014-12-04 14:17 https://public.kitware.com/Bug/file/5313/0001-FindMPI-Factor-out-compiler-wrapper-execution-into-h.patch 0002-FindMPI-Workaround-Intel-MPI-5.0.1-exit-code-problem.patch (1,470) 2014-12-04 14:17 https://public.kitware.com/Bug/file/5314/0002-FindMPI-Workaround-Intel-MPI-5.0.1-exit-code-problem.patch linkflags.diff (2,284) 2014-12-04 17:23 https://public.kitware.com/Bug/file/5315/linkflags.diff |
|
Issue History |
Date Modified | Username | Field | Change |
2014-09-30 16:26 | Kelly Thompson | New Issue | |
2014-10-17 15:28 | Arch D. Robison | Note Added: 0037044 | |
2014-10-20 09:31 | Brad King | Note Added: 0037054 | |
2014-10-30 12:25 | Brad King | Assigned To | => Chuck Atkins |
2014-10-30 12:25 | Brad King | Status | new => assigned |
2014-10-30 12:26 | Brad King | Note Added: 0037108 | |
2014-10-30 12:26 | Brad King | Target Version | => CMake 3.2 |
2014-12-04 08:41 | Brad King | Note Added: 0037374 | |
2014-12-04 09:30 | RolandSchulz | Note Added: 0037377 | |
2014-12-04 11:06 | Alin M Elena | Note Added: 0037380 | |
2014-12-04 11:22 | Brad King | Note Added: 0037381 | |
2014-12-04 13:49 | Alin M Elena | Note Added: 0037383 | |
2014-12-04 13:51 | Alin M Elena | File Added: doublecheckerror.diff | |
2014-12-04 13:52 | Alin M Elena | Note Added: 0037384 | |
2014-12-04 14:01 | Alin M Elena | Note Added: 0037385 | |
2014-12-04 14:01 | Alin M Elena | File Added: usecompilerewrapper.diff | |
2014-12-04 14:17 | Brad King | File Added: 0001-FindMPI-Factor-out-compiler-wrapper-execution-into-h.patch | |
2014-12-04 14:17 | Brad King | File Added: 0002-FindMPI-Workaround-Intel-MPI-5.0.1-exit-code-problem.patch | |
2014-12-04 14:18 | Brad King | Note Added: 0037386 | |
2014-12-04 16:28 | Alin M Elena | Note Added: 0037391 | |
2014-12-04 17:22 | Alin M Elena | Note Added: 0037392 | |
2014-12-04 17:23 | Alin M Elena | File Added: linkflags.diff | |
2014-12-05 09:20 | Brad King | Note Added: 0037394 | |
2014-12-05 09:28 | Brad King | Note Added: 0037395 | |
2014-12-05 13:18 | Brad King | Relationship added | related to 0014991 |
2014-12-08 09:01 | Brad King | Note Added: 0037403 | |
2014-12-08 09:01 | Brad King | Status | assigned => resolved |
2014-12-08 09:01 | Brad King | Resolution | open => fixed |
2014-12-08 09:01 | Brad King | Fixed in Version | => CMake 3.2 |
2015-05-04 09:05 | Robert Maynard | Note Added: 0038694 | |
2015-05-04 09:05 | Robert Maynard | Status | resolved => closed |
Notes |
|
(0037044)
|
Arch D. Robison
|
2014-10-17 15:28
|
|
I ran into this issue with Intel MPI 5.0.1 and RHEL 7.0. |
|
|
(0037054)
|
Brad King
|
2014-10-20 09:31
|
|
|
|
(0037108)
|
Brad King
|
2014-10-30 12:26
|
|
|
|
(0037374)
|
Brad King
|
2014-12-04 08:41
|
|
|
|
(0037377)
|
RolandSchulz
|
2014-12-04 09:30
|
|
This has been fixed in Intel MPI 5.0.2 |
|
|
(0037380)
|
Alin M Elena
|
2014-12-04 11:06
|
|
Indeed 5.0.2 seems to have no issue in finding the correct c++ and c details... only fortran fails...
Maybe I shall open a separate bug? |
|
|
(0037381)
|
Brad King
|
2014-12-04 11:22
|
|
Re 0015182:0037380: No separate issue needed. The FindMPI module may need a change for this issue regardless of to which language it applies.
Even if upstream Intel MPI is fixed it would be nice to support the broken versions if possible anyway. The thread linked in 0015182:0037108 has a patch and my review of it. That would be a good starting point for continuing work on a workaround. |
|
|
(0037383)
|
Alin M Elena
|
2014-12-04 13:49
|
|
There are three issues I see
1. Failure to detect undefined reference. I attached patch based on KT and Brad suggestions.
2. Failure to use the wrapper as a compiler and skip the detection via interrogation.
3. Using wrong wrappers to interrogate for intel mpi and intel compilers. eg. mpif90 instead of mpiifort (NB: If a user uses I_MPI_F90=ifort, or c/c++ equivalents this issue is gone, but I think we shall not rely on user.) |
|
|
(0037384)
|
Alin M Elena
|
2014-12-04 13:52
|
|
the patch I have spoken above is doublecheckerror.diff |
|
|
(0037385)
|
Alin M Elena
|
2014-12-04 14:01
|
|
patch for issue 2. usecompilerewrapper.diff
shall be applied after first patch. |
|
|
(0037386)
|
Brad King
|
2014-12-04 14:18
|
|
Re 0015182:0037384: Thanks. I've factored the first patch out into:
0001-FindMPI-Factor-out-compiler-wrapper-execution-into-h.patch
0002-FindMPI-Workaround-Intel-MPI-5.0.1-exit-code-problem.patch
with some minor revisions. Please test these. |
|
|
(0037391)
|
Alin M Elena
|
2014-12-04 16:28
|
|
Thanks Brad! Tested it seems to work, fixes issue 1.
now we are ready for issue 2.
and one more issue.
4. the linker information is not parsed, see below
-- MPI_C_INCLUDE_PATH /ichec/packages/intel/intel-cluster-studio-2015/impi_5.0.1/intel64/include
-- MPI_C_LINK_FLAGS
-- MPI_C_LIBRARIES /ichec/packages/intel/intel-cluster-studio-2015/impi_5.0.1/intel64/lib/libmpifort.so;/ichec/packages/intel/intel-cluster-studio-2015/impi_5.0.1/intel64/lib/release/libmpi.so;/ichec/packages/intel/intel-cluster-studio-2015/impi_5.0.1/intel64/lib/libmpigi.a;/usr/lib64/libdl.so;/usr/lib64/librt.so;/usr/lib64/libpthread.so
-- Configuring done
-- Generating done
-- Build files have been written to: /ichec/home/staff/alin/findmpi/5.0.1
[alin@fionn2:~/findmpi/5.0.1]: mpicc -compile-info
gcc -I/ichec/packages/intel/intel-cluster-studio-2015/impi_5.0.1/intel64/include -L/ichec/packages/intel/intel-cluster-studio-2015/impi_5.0.1/intel64/lib/release -L/ichec/packages/intel/intel-cluster-studio-2015/impi_5.0.1/intel64/lib -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker /ichec/packages/intel/intel-cluster-studio-2015/impi_5.0.1/intel64/lib/release -Xlinker -rpath -Xlinker /ichec/packages/intel/intel-cluster-studio-2015/impi_5.0.1/intel64/lib -Xlinker -rpath -Xlinker /opt/intel/mpi-rt/5.0/intel64/lib/release -Xlinker -rpath -Xlinker /opt/intel/mpi-rt/5.0/intel64/lib -lmpifort -lmpi -lmpigi -ldl -lrt -lpthread |
|
|
(0037392)
|
Alin M Elena
|
2014-12-04 17:22
|
|
patch for issue 4 (2 too) linkflags.diff |
|
|
(0037394)
|
Brad King
|
2014-12-05 09:20
|
|
|
|
(0037395)
|
Brad King
|
2014-12-05 09:28
|
|
Re 0015182:0037392: Thanks. I think these other fixes may take a few iterations so let's move discussion back to the dev list. Please use Git to create a commit and "git format-patch" to construct a patch with author/date/message/etc. and send to the list. |
|
|
(0037403)
|
Brad King
|
2014-12-08 09:01
|
|
I'm resolving this issue because the originally reported problem has been addressed. Alin, please bring remaining patches to the developer mailing list as requested in 0015182:0037395.
|
|
|
(0038694)
|
Robert Maynard
|
2015-05-04 09:05
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|