View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013619CMakeCMakepublic2012-10-30 13:152013-03-04 08:38
ReporterMichael Bachmann 
Assigned To 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionno change required 
Platformamd64OSRedhat LinuxOS Version4.0
Product Version 
Target VersionCMake 2.8.10Fixed in VersionCMake 2.8.10 
Summary0013619: cmake 2.8.10-rc3: gcc which is placed in PATH is not used but the system compiler
Descriptione.g.: gcc 4.5.2 executable is situated under:
/opt/gcc-4.5.2/bin/gcc

gcc 3.4.6 executable is situated under:
/usr/bin/gcc

the PATH environment variable is set as follows:
export PATH=/opt/gcc-4.5.2/bin:/usr/bin:$PATH

=> executing "which gcc" prints "/opt/gcc-4.5.2/bin/gcc"
Steps To ReproduceUsing cmake (2.8.10-rc3) gcc 3.4.6 is configured when executing:
cmake ../mysrc

Using cmake-gui (2.8.10-rc3) gcc 4.5.2 is configured when executing:
cmake-gui ../mysrc


In previous releases cmake and cmake-gui used both gcc 4.5.2 during configuration (the gcc executable which is found first via the PATH variable)
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0031351)
Brad King (manager)
2012-10-30 13:25

I think you've encountered this change:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e58e5bb [^]

which was intentional as detailed in the commit message.

However, I cannot reproduce any selection difference between cmake and cmake-gui. What is the output from CMake in each case? I'm looking for output like:

 -- The C compiler identification is GNU 4.7.1
 -- Check for working C compiler: /usr/bin/cc
 -- Check for working C compiler: /usr/bin/cc -- works

from the command-line tool and in the configuration log window of cmake-gui.
(0031354)
Michael Bachmann (reporter)
2012-10-31 05:27

OK. This is not a bug.

No, I have not encountered this change yet and it is very unexpected. But it makes sense now.

The output is:
-- The C compiler identification is GNU 3.4.6
-- The CXX compiler identification is GNU 3.4.6
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
...
for both: cmake-gui and cmake.

So: When setting explicitly the environment variables CC and CXX:
$ export CC=/opt/gcc-4.5.2/bin/gcc
$ export CXX=/opt/gcc-4.5.2/bin/c++

cmake and cmake-gui use gcc 4.5.2 like before:
-- The C compiler identification is GNU 4.5.2
-- The CXX compiler identification is GNU 4.5.2
-- Check for working C compiler: /opt/gcc-4.5.2/bin/gcc
-- Check for working C compiler: /opt/gcc-4.5.2/bin/gcc -- works
...

Another way to explicitly use gcc 4.5.2 is using the command line option "-D" to explicitly define the compiler paths:
cmake -DCMAKE_C_COMPILER:FILEPATH=/opt/gcc-4.5.2/bin/gcc -DCMAKE_CXX_COMPILER:FILEPATH=/opt/gcc-4.5.2/bin/c++

But this works only with the cmake executable...

Thank you for your help!
(0031356)
Brad King (manager)
2012-10-31 07:30

Thanks for reporting back!
(0032494)
Robert Maynard (manager)
2013-03-04 08:38

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-10-30 13:15 Michael Bachmann New Issue
2012-10-30 13:25 Brad King Note Added: 0031351
2012-10-31 05:27 Michael Bachmann Note Added: 0031354
2012-10-31 07:30 Brad King Note Added: 0031356
2012-10-31 07:30 Brad King Status new => resolved
2012-10-31 07:30 Brad King Resolution open => no change required
2012-10-31 10:52 David Cole Fixed in Version => CMake 2.8.10
2012-10-31 10:52 David Cole Target Version => CMake 2.8.10
2013-03-04 08:38 Robert Maynard Note Added: 0032494
2013-03-04 08:38 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team