[cmake-developers] [CMake 0014448]: Cmake picks up the wrong compiler at the startup

Mantis Bug Tracker mantis at public.kitware.com
Sat Sep 28 16:27:51 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14448 
====================================================================== 
Reported By:                Zachary Deretsky
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14448
Category:                   CMake
Reproducibility:            have not tried
Severity:                   major
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2013-09-28 16:27 EDT
Last Modified:              2013-09-28 16:27 EDT
====================================================================== 
Summary:                    Cmake picks up the wrong compiler at the startup
Description: 
I built cmake-2.8.12-rc3 with bootstrap -- -DBUILD_TESTING=FALSE and I encounter
further problems. Let me explain, bear with me.

We have been building a fairly large package continuously and successfully for a
couple of years with Cmake 2.8.8.
We are using our own tool chain including binutils 2.23.2 and gcc 4.6.3.
The reason is that our code has to be built and run on the Amazon cloud
computers and on the local PCs, so we need very tight control on both the tools
and the libraries we link with.

Now with the cmake-2.8.12-rc3 I just built I get a cmake error below. I repeat,
our code builds perfectly well with Cmake 2.8.8. Cmake picks up the correct ld,
but insists on using /usr/bin/cc. When I moved /usr/bin/cc to /usr/bin/cc_tmp
cmake tells me to:

CMake Error: your C compiler: "/usr/bin/cc" was not found.   Please set
CMAKE_C_COMPILER to a valid compiler path or name.

I set
 set(${CMAKE_C_COMPILER}
"/AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/bin/gcc")

at the top of CMakeLists.txt file, it did not help.

Is there way to force cmake use the compiler above? Thank you, Zach.


zach at cloud1-12:~/p5/arptop/arp/build$ cmake ..
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at
/AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/stow/cmake-2.8.12-rc3/share/cmake-2.8/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:

   Change Dir: /home/zach/p5/arptop/arp/build/CMakeFiles/CMakeTmp

  

  Run Build Command:/usr/bin/make "cmTryCompileExec2304154031/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec2304154031.dir/build.make
  CMakeFiles/cmTryCompileExec2304154031.dir/build

  make[1]: Entering directory
  `/home/zach/p5/arptop/arp/build/CMakeFiles/CMakeTmp'

  
 
/AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/stow/cmake-2.8.12-rc3/bin/cmake
  -E cmake_progress_report
  /home/zach/p5/arptop/arp/build/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object
  CMakeFiles/cmTryCompileExec2304154031.dir/testCCompiler.c.o

  /usr/bin/cc -o CMakeFiles/cmTryCompileExec2304154031.dir/testCCompiler.c.o
  -c /home/zach/p5/arptop/arp/build/CMakeFiles/CMakeTmp/testCCompiler.c

  Linking C executable cmTryCompileExec2304154031

  
 
/AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/stow/cmake-2.8.12-rc3/bin/cmake
  -E cmake_link_script CMakeFiles/cmTryCompileExec2304154031.dir/link.txt
  --verbose=1

  /usr/bin/cc
  -L/AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib64
  -L/AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib
  CMakeFiles/cmTryCompileExec2304154031.dir/testCCompiler.c.o -o
  cmTryCompileExec2304154031 -rdynamic

  /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/bin/ld:
  this linker was not configured to use sysroots

  collect2: ld returned 1 exit status

  make[1]: Leaving directory
  `/home/zach/p5/arptop/arp/build/CMakeFiles/CMakeTmp'

  make[1]: *** [cmTryCompileExec2304154031] Error 1

  make: *** [cmTryCompileExec2304154031/fast] Error 2

  

  

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


-- Configuring incomplete, errors occurred!
See also "/home/zach/p5/arptop/arp/build/CMakeFiles/CMakeOutput.log".
See also "/home/zach/p5/arptop/arp/build/CMakeFiles/CMakeError.log".
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-09-28 16:27 Zachary DeretskyNew Issue                                    
======================================================================




More information about the cmake-developers mailing list