MantisBT - CMake
View Issue Details
0015845CMake(No Category)public2015-11-12 09:512016-05-02 08:30
Damian Rouson 
Brad King 
normalminoralways
closedfixed 
Cray XC40Linux
CMake 3.3.2 
CMake 3.4.1CMake 3.4.1 
0015845: CMake fails to identify the Cray compilers' version numbers
As demonstrated below, CMake 3.0.1 fails to identify the version of the Cray C, Fortran, and C++ compilers. CMake 3.3.2 and CMake 3.4.0-rc3 exhibit the same behavior. This bug is also archived at https://github.com/sourceryinstitute/AdHoc/tree/master/src/cmake. [^]
> cat CMakeLists.txt
project(cray_compiler_version_bug LANGUAGES Fortran C CXX)
if(
   "${CMAKE_Fortran_COMPILER_VERSION}" MATCHES "" AND
   "${CMAKE_C_COMPILER_VERSION}" MATCHES "" AND
   "${CMAKE_CXX_COMPILER_VERSION}" MATCHES ""
  )
  message(FATAL_ERROR
    "CMAKE_Fortran_COMPILER_VERSION, CMAKE_C_COMPILER_VERSION, CMAKE_CXX_COMPILER_VERSION are all empty."
  )
endif()

> mkdir build && cd build

> FC=ftn cmake ..
-- The Fortran compiler identification is Cray
-- The C compiler identification is Cray
-- The CXX compiler identification is Cray
-- Check for working Fortran compiler: /opt/cray/craype/2.4.2/bin/ftn
-- Check for working Fortran compiler: /opt/cray/craype/2.4.2/bin/ftn -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /opt/cray/craype/2.4.2/bin/ftn supports Fortran 90
-- Checking whether /opt/cray/craype/2.4.2/bin/ftn supports Fortran 90 -- yes
-- Check for working C compiler: /opt/cray/craype/2.4.2/bin/cc
-- Check for working C compiler: /opt/cray/craype/2.4.2/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /opt/cray/craype/2.4.2/bin/CC
-- Check for working CXX compiler: /opt/cray/craype/2.4.2/bin/CC -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:7 (message):
  CMAKE_Fortran_COMPILER_VERSION, CMAKE_C_COMPILER_VERSION,
  CMAKE_CXX_COMPILER_VERSION are all empty.


-- Configuring incomplete, errors occurred!
See also "/home/users/p01923/AdHoc/src/cmake/bug-xxxxx/build/CMakeFiles/CMakeOutput.log".
p01923@swan:~/AdHoc/src/cmake/bug-xxxxx/build> cmake --version
cmake version 3.0.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
No tags attached.
related to 0015664closed Chuck Atkins CMake detects the wrong version for the C and C++ Cray Compiler 
Issue History
2015-11-12 09:51Damian RousonNew Issue
2015-11-12 10:30Brad KingRelationship addedrelated to 0015664
2015-11-12 11:00Brad KingNote Added: 0039867
2015-11-13 08:39Brad KingAssigned To => Brad King
2015-11-13 08:39Brad KingStatusnew => resolved
2015-11-13 08:39Brad KingResolutionopen => fixed
2015-11-13 08:39Brad KingFixed in Version => CMake 3.5
2015-11-13 08:39Brad KingTarget Version => CMake 3.5
2015-11-18 10:23Brad KingNote Added: 0039879
2015-11-18 10:23Brad KingFixed in VersionCMake 3.5 => CMake 3.4.1
2015-11-18 10:23Brad KingTarget VersionCMake 3.5 => CMake 3.4.1
2016-05-02 08:30Robert MaynardNote Added: 0040963
2016-05-02 08:30Robert MaynardStatusresolved => closed

Notes
(0039867)
Brad King   
2015-11-12 11:00   
As of 3.4.0-rc3 the version detection should work for Cray C and C++ compilers but not Fortran. Here is the missing implementation for the latter:

 Cray: Implement Fortran compiler version detection
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09f754f0 [^]
(0039879)
Brad King   
2015-11-18 10:23   
This has now been merged to 'release' for inclusion in 3.4.1.
(0040963)
Robert Maynard   
2016-05-02 08:30   
Closing resolved issues that have not been updated in more than 4 months.