[CMake] [MinGW64] cmake can't validate cxx and fortran compilers.

David Cole david.cole at kitware.com
Thu Jul 8 06:38:43 EDT 2010


If you need to specify compilers that are not picked up by default, use
environment variables to do so.

See this FAQ entry:
http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F

Prefer the first method -- does it work if you set FC?

Also, make sure you use full paths to the compilers. If not using full
paths, then the executables must be in the PATH when cmake runs.


HTH,
David


On Thu, Jul 8, 2010 at 6:03 AM, Sisyphus <sisyphus1 at optusnet.com.au> wrote:

> Hi,
>
> Please consider this as a "report" rather than a "complaint" - and I'm not
> even sure that the problem lies with cmake. Faik it may be a plplot issue.
>
> I'm using the 64-bit MinGW64 (gcc) cross-compiler to build plplot-5.9.6 on
> Windows Vista64 and noticed that CMAKE_Fortran_COMPILER and
> CMAKE_CXX_COMPILER options are not working as I expect.
>
> With this particular compiler, the gcc, ar, g++ and gfortran executables
> are all prefixed with ' x86_64-w64-mingw32-'. There's no problem with
>
> -DCMAKE_C_COMPILER:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-gcc.exe
> and with
> -DCMAKE_AR:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-ar.exe
>
> But neither
>
> -DCMAKE_CXX_COMPILER:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-g++.exe
> nor
>
> -DCMAKE_Fortran_COMPILER:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-gfortran.exe
>
> enables the compiler in question to be found.
>
> Attached is the output of running
>
> cmake -G "MinGW Makefiles" -DBUILD_SHARED_LIBS=OFF
> -DCMAKE_INSTALL_PREFIX=install
> -DCMAKE_AR:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-ar.exe
> -DCMAKE_C_COMPILER:FILEPATH=x86_64-w64-mingw32-gcc.exe
> -DBUILD_TEST=ON
> -DCMAKE_Fortran_COMPILER:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-gfortran.exe
> ..
>
> I think the key bit is "The Fortran compiler identification is unknown".
> Why would that be the case for x86_64-w64-mingw32-g++.exe and
> x86_64-w64-mingw32-gfortran.exe, but not x86_64-w64-mingw32-gcc.exe and
> x86_64-w64-mingw32-ar.exe ?
>
> (I've omitted specifying the CXX argument above - but when I do specify it,
> output is essentially the same as for Fortran.)
>
> I should add that this is not actually a "show-stopper". If I create copies
> of the fortran and g++ executables named 'gfortran.exe' and 'g++.exe', then
> everything works fine - but that's a somewhat hackish solution.
>
> Btw, my gcc compiler version is currently 4.6.0, and I got the same
> behaviour with 4.4.4.
>
> If there's something else I can do/try to help solve this, I'm quite happy
> to oblige.
>
> Cheers,
> Rob
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100708/6f5b4b5d/attachment-0001.htm>


More information about the CMake mailing list