MantisBT - CMake
View Issue Details
0015334CMakeCMakepublic2015-01-03 19:342016-06-10 14:31
jhuang 
Kitware Robot 
immediatemajoralways
closedmoved 
LinuxSUSE Linux Enterprise Server 11 SP3 (x86_64)
CMake 3.1 
 
0015334: CMake cannot work
I installed the latest CMake from Binary and try to test it with a very simple project, but there're some error in console:

-------------------Console output---------------------------------

-- The C compiler identification is unknown
CMake Error at /home/jhuang/local/package/cmake-3.1.0-Linux-x86_64/share/cmake-3 .1/Modules/CMakeDetermineCCompiler.cmake:172 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- The CXX compiler identification is unknown
CMake Error at /home/jhuang/local/package/cmake-3.1.0-Linux-x86_64/share/cmake-3 .1/Modules/CMakeDetermineCXXCompiler.cmake:170 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Check for working C compiler: /usr/bin/cc
CMake Error at /home/jhuang/local/package/cmake-3.1.0-Linux-x86_64/share/cmake-3 .1/Modules/CMakeTestCCompiler.cmake:47 (try_compile):
  Unknown extension ".c" for file

    /home/jhuang/cmake_test/CMakeFiles/CMakeTmp/testCCompiler.c

  try_compile() works only for enabled languages. Currently these are:

    C CXX

  See project() command to enable other languages.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /home/jhuang/local/package/cmake-3.1.0-Linux-x86_64/share/cmake-3 .1/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/usr/bin/cc" is not able to compile a simple test program.

  It fails with the following output:





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "/home/jhuang/cmake_test/CMakeFiles/CMakeOutput.log".
See also "/home/jhuang/cmake_test/CMakeFiles/CMakeError.log".
-------------------Console output---------------------------------

Following is the 172 in CMakeDetermineCCompiler.cmake
# configure variables set in this file for fast reload later on
configure_file(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
  ${CMAKE_PLATFORM_INFO_DIR}/CMakeCCompiler.cmake
  @ONLY
  )

Why there's an CMakeERROR on this line, no any hints, even in the CMakeOutput.log and CMakeError.log
No tags attached.
txt CMakeLog and CMakeList.txt (2,587) 2015-01-03 19:34
https://public.kitware.com/Bug/file/5338/CMakeLog%20and%20CMakeList.txt
Issue History
2015-01-03 19:34jhuangNew Issue
2015-01-03 19:34jhuangFile Added: CMakeLog and CMakeList.txt
2015-01-04 08:45Alex MerryNote Added: 0037549
2015-01-04 08:49jhuangNote Added: 0037550
2015-01-08 12:24Brad KingNote Added: 0037637
2016-06-10 14:29Kitware RobotNote Added: 0042696
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0037549)
Alex Merry   
2015-01-04 08:45   
Well, the first question I'd have is: do you actually have a working C compiler installed? Because the line "Check for working C compiler: /usr/bin/cc -- broken" says that CMake thinks you don't.
(0037550)
jhuang   
2015-01-04 08:49   
Sure, I have a can-work C compiler installed, I tried it with a simple c program, and the Cpp compiler installed is also can-work.
(0037637)
Brad King   
2015-01-08 12:24   
The "configure_file Problem configuring file" error message is not very informative by itself. It is reported by configure_file whenever cmMakefile::ConfigureFile returns 0. That method is here:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmMakefile.cxx;hb=v3.1.0#l3926 [^]

Most of the code paths that return 0 contain a more informative error message. It looks like if cmSystemTools::CopyFileIfDifferent fails then the call sites in ConfigureFile do not report any error message. Internally that calls SystemTools::CopyFileAlways which is low level and expects the caller to deal with failure. That is here:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/kwsys/SystemTools.cxx;hb=v3.1.0#l2211 [^]

Check that file permissions are set such that CMake can read all of its own sources and write to the build tree.
(0042696)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.