MantisBT - CMake
View Issue Details
0015598CMakeCMakepublic2015-05-31 17:072016-01-04 11:51
Paul Durack 
 
normalmajoralways
closedunable to reproduce 
IntelUbuntu15.04
CMake 3.0.2 
 
0015598: CMAKE_Fortran_COMPILER_ID unset even though gfortran installed
duro@duro-vm:~/uvcdat-build$ cmake ../uvcdat -DCMAKE_INSTALL_PREFIX=/usr/local/uvcdat/2.2.0 -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake -DCDAT_BUILD_CMOR=ON -DCDAT_BUILD_GUI=ON -DCDAT_BUILD_MODE=ALL
[INFO] We reset your path to: /usr/local/uvcdat/2.2.0/Externals/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
-- CMAKE_Fortran_COMPILER_ID = ''.
CMake Warning at contrib/sciMake/sciFuncsMacros.cmake:23 (message):
  Variable CONFIG_SUMMARY is not defined, sciPrintString is unable to write
  to the summary file.
Call Stack (most recent call first):
  contrib/sciMake/sciFortranFindVersion.cmake:12 (sciPrintString)
  contrib/sciMake/sciFortranChecks.cmake:14 (include)
  CMake/cdat_modules/esmf_pkg.cmake:26 (include)
  CMakeLists.txt:468 (include)

CMake Error at contrib/sciMake/sciFortranFindVersion.cmake:160 (message):
  Unknown compiler ID, .
Call Stack (most recent call first):
  contrib/sciMake/sciFortranChecks.cmake:14 (include)
  CMake/cdat_modules/esmf_pkg.cmake:26 (include)
  CMakeLists.txt:468 (include)

-- Configuring incomplete, errors occurred!
See also "/home/duro/uvcdat-build/CMakeFiles/CMakeOutput.log".
See also "/home/duro/uvcdat-build/CMakeFiles/CMakeError.log".
duro@duro-vm:~/uvcdat-build$ which gfortran
/usr/bin/gfortran
duro@duro-vm:~/uvcdat-build$ gfortran --version
GNU Fortran (Ubuntu 4.9.2-10ubuntu13) 4.9.2
duro@duro-vm:~/uvcdat-build$ cmake --version
cmake version 3.0.2
As above
No tags attached.
log CMakeError.log (643) 2015-06-06 12:25
https://public.kitware.com/Bug/file/5470/CMakeError.log
log CMakeOutput.log (27,504) 2015-06-06 12:26
https://public.kitware.com/Bug/file/5471/CMakeOutput.log
log CheckFortran-CMakeFiles-CMakeError.log (624) 2015-06-06 12:32
https://public.kitware.com/Bug/file/5472/CheckFortran-CMakeFiles-CMakeError.log
log CheckFortran-CMakeFiles-CMakeOutput.log (50) 2015-06-06 12:32
https://public.kitware.com/Bug/file/5473/CheckFortran-CMakeFiles-CMakeOutput.log
log CMakeFiles-CMakeOutput.log (16,494) 2015-06-11 21:38
https://public.kitware.com/Bug/file/5474/CMakeFiles-CMakeOutput.log
Issue History
2015-05-31 17:07Paul DurackNew Issue
2015-06-01 09:05Brad KingNote Added: 0038865
2015-06-01 19:22Paul DurackNote Added: 0038872
2015-06-02 09:06Brad KingNote Added: 0038874
2015-06-02 23:33Paul DurackNote Added: 0038876
2015-06-03 10:53Brad KingNote Edited: 0038876bug_revision_view_page.php?bugnote_id=38876#r1798
2015-06-03 10:57Brad KingNote Added: 0038878
2015-06-06 12:25Paul DurackFile Added: CMakeError.log
2015-06-06 12:26Paul DurackFile Added: CMakeOutput.log
2015-06-06 12:32Paul DurackFile Added: CheckFortran-CMakeFiles-CMakeError.log
2015-06-06 12:32Paul DurackFile Added: CheckFortran-CMakeFiles-CMakeOutput.log
2015-06-06 12:34Paul DurackNote Added: 0038888
2015-06-08 10:41Brad KingNote Added: 0038895
2015-06-11 21:38Paul DurackFile Added: CMakeFiles-CMakeOutput.log
2015-06-11 21:40Paul DurackNote Added: 0038913
2015-06-12 14:44Paul DurackNote Added: 0038916
2015-06-15 09:23Brad KingNote Added: 0038925
2015-07-31 13:58Paul DurackNote Added: 0039211
2015-07-31 14:32Brad KingNote Added: 0039212
2015-07-31 14:32Brad KingStatusnew => resolved
2015-07-31 14:32Brad KingResolutionopen => unable to reproduce
2016-01-04 11:51Robert MaynardNote Added: 0040101
2016-01-04 11:51Robert MaynardStatusresolved => closed

Notes
(0038865)
Brad King   
2015-06-01 09:05   
There may be more information in CMakeFiles/CMake*.log about the attempt made to identify the compiler. Please take a look at those files to see if they show the problem.
(0038872)
Paul Durack   
2015-06-01 19:22   
I did take a look at both the CMakeOutput.log and CMakeError.log - is there anything specifically that I'm searching for?

I also tried setting the env var "FC" to /usr/bin/gfortran however that didn't seem to solve the issue..
(0038874)
Brad King   
2015-06-02 09:06   
Please attach the log files here.
(0038876)
Paul Durack   
2015-06-02 23:33   
(edited on: 2015-06-03 10:53)
And here you go"

*****
CMakeError.log:
Looking for a Fortran compiler failed with the following output:
-- The Fortran compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_Fortran_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "FC" or the CMake cache entry CMAKE_Fortran_COMPILER to the full
  path to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
See also "/home/duro/uvcdat-build/CMakeFiles/CheckFortran/CMakeFiles/CMakeOutput.log".
See also "/home/duro/uvcdat-build/CMakeFiles/CheckFortran/CMakeFiles/CMakeError.log".

(0038878)
Brad King   
2015-06-03 10:57   
Re 0015598:0038876: Thanks. I edited it down to the relevant portion.

This is actually in a test project built via try_compile to determine whether a Fortran compiler can be detected. We'll have to look at the log for that one. Please use the "Upload File" section on this page to attach the "/home/duro/uvcdat-build/CMakeFiles/CheckFortran/CMakeFiles/CMakeError.log" file.
(0038888)
Paul Durack   
2015-06-06 12:34   
Brad, apologies for the delay. You should now have access to both the original log files along with their equivalents sourced from the uvcdat-build/CMakeFiles/CheckFortran/CMakeFiles subdir
(0038895)
Brad King   
2015-06-08 10:41   
Re 0015598:0038888: Thanks. The CheckFortran-CMakeFiles-CMakeError.log shows that the compiler was not found there:

 Compiler: CMAKE_Fortran_COMPILER-NOTFOUND

Let's try to reproduce this in a simpler test case. Create a fresh source tree containing just a CMakeLists.txt file with:

 cmake_minimum_required(VERSION 3.0)
 project(Issue15598 Fortran)

Then run CMake to configure that project and attach the log files here.
(0038913)
Paul Durack   
2015-06-11 21:40   
Apologies for the delay Brad, it seems things worked fine:

duro@duro-vm:~/cmake-build$ cmake ./
-- The Fortran compiler identification is GNU
-- Check for working Fortran compiler: /usr/bin/f95
-- Check for working Fortran compiler: /usr/bin/f95 -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/f95 supports Fortran 90
-- Checking whether /usr/bin/f95 supports Fortran 90 -- yes
-- Configuring done
-- Generating done
-- Build files have been written to: /home/duro/cmake-build

I've attached the output CMakeFiles/CMakeOutput.log above
(0038916)
Paul Durack   
2015-06-12 14:44   
Brad, just for completeness the CMakeLists.txt file for the project I'm trying to build contained this in the first 10 lines:

*****
#=============================================================================
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)

if ("${CMAKE_VERSION}" VERSION_LESS "2.8.12")
  message(WARNING "Your CMake version is ${CMAKE_VERSION} which is depreciated for UV-CDAT. The recommended minimum CMake version is 2.8.12. Using older versions can result in build errors particularly with Xcode 5")
endif()

# Project name and initial checks
#=============================================================================
project(cdat)
*****

I wonder if this is tripping over cmake v3.0.2?
(0038925)
Brad King   
2015-06-15 09:23   
Re 0015598:0038916: Since it works in the small test project and not under UV-CDAT then something in between must be triggering this problem. The lines you quoted should not affect this because they don't try to enable Fortran yet. You could try stripping the outer project down. Be sure to keep in the part that tries enabling Fortran inside a try_compile.
(0039211)
Paul Durack   
2015-07-31 13:58   
Brad, apologies for dropping this.. I've just managed to get UV-CDAT compiling, and it appears was likely due to a dependency that I hadn't installed.

I'm a little unsure how it has now been resolved, but I no longer have the issue described above.

Thanks,

P
(0039212)
Brad King   
2015-07-31 14:32   
Re 0015598:0039211: Okay, thanks for reporting back. If you do manage to reproduce it again please post back here with instructions.
(0040101)
Robert Maynard   
2016-01-04 11:51   
Closing resolved issues that have not been updated in more than 4 months.