[CMake] Changing compiler

David Cole david.cole at kitware.com
Wed Apr 20 09:53:30 EDT 2011


On Wed, Apr 20, 2011 at 9:43 AM, David Doria <daviddoria at gmail.com> wrote:

> On Wed, Apr 20, 2011 at 9:04 AM, David Cole <david.cole at kitware.com>
> wrote:
> > If you are setting the CXX compiler, you should also probably be setting
> the
> > C compiler.
> >
> > I always use environment variables to do this:
> >
> >   export CC=/home/doriad/src/gcc-4.5.2/bin/gcc/gcc
> >   export CXX=/home/doriad/src/gcc-4.5.2/bin/gcc/g++
> >   ccmake ../../src/ITK
> >
> > If that still doesn't work, then inspect the contents of the file
> > CMakeFiles/CMakeError.log to see what the actual errors are, and post
> them
> > here. (CMakeFiles/CMakeOutput.log may also have relevant results in
> it...)
> >
> >
> > HTH,
> > David C.
>
> Hm, so there is no 'gcc' executable after I built gcc. Gcc's configure
> says: "The following languages will be built:
> c,c++,fortran,java,objc". So I'm assuming it should be there? I tried
> setting the ITK C compiler to g++ as well, but no dice.
>
> In CMakeFiles/CMakeError.log
>
> of course it says:
>
> CMakeCCompilerId.c:2:3: error: #error "A C++ compiler has been selected for
> C."
>
> The executables that were built are:
>
> [doriad at daviddesktop gcc]$ find . -executable -type f
> ./as
> ./cc1-dummy
> ./jcf-dump
> ./cc1
> ./jvgenmain
> ./gcj
> ./config.status
> ./lto-wrapper
> ./cc1plus-dummy
> ./cc1plus
> ./cc1obj-dummy
> ./gcov
> ./nm
> ./cpp
> ./f951
> ./xgcc
> ./cc1obj
> ./gfortran
> ./collect2
> ./collect-ld
> ./jc1
> ./g++
> ./gcov-dump
>
> Any thoughts?
>
> Thanks,
>
> David
>


Sounds like you must have gotten errors when you built gcc...

Pore through the log of what happened during the gcc build maybe?

Are you building gcc from source, or using some package manager to build it
for you? (MacPorts, something else?)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110420/f9c6d351/attachment.htm>


More information about the CMake mailing list