[Cado-nfs-discuss] Cmake does not respect path to gcc

Emmanuel Thomé emmanuel.thome at gmail.com
Wed Jul 23 18:52:51 CEST 2014

Not obeying the user PATH is at the very least a misfeature, and I
personally would be inclined to naming it a quite severe bug.

We could change this behaviour, and this may be discussed.

On the other hand, it's entirely possible to constrain a particular CC. Just do:

CC=`which gcc` CXX=`which g++` make

or use local.sh to set these. If you prefer to use pure cmake, then
you'd have to change CMAKE_C_COMPILER and CMAKE_CXX_COMPILER with


On Wed, Jul 23, 2014 at 6:47 PM, Andreas Enge <andreas.enge at inria.fr> wrote:
> Hello,
> trying to install cado-nfs with the guix userland package manager:
>    https://www.gnu.org/software/guix/
> on top of a debian distribution, I hit the following bug.
> Gcc-4.8.2 is installed in a non-standard location, referenced in $PATH:
> $ which gcc
> /home/privat/.guix-profile/bin/gcc
> But the cmake check for gcc uses the debian one it finds in /usr/bin
> (and fails, potentially because it ends up mixing the guix and the
> debian linker):
> -- The C compiler identification is GNU 4.7.2
> -- The CXX compiler identification is GNU 4.7.2
> -- Check for working C compiler: /usr/bin/cc
> -- Check for working C compiler: /usr/bin/cc -- broken
> CMake Error at /gnu/store/w0pmvn1wcn1zj175fv2ima4bxlbw5cx1-cmake-2.8.12/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
>   The C compiler "/usr/bin/cc" is not able to compile a simple test program.
> To me this looks like a bug in cmake itself, or did I make a mistake?
> Or could you change your configuration so as to take $PATH into account?
> I also tried
>    CC=`which gcc` make
> without success.
> Andreas
> _______________________________________________
> Cado-nfs-discuss mailing list
> Cado-nfs-discuss at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/cado-nfs-discuss

More information about the Cado-nfs-discuss mailing list