2016-04-25 20 views
1

Ich verwende CMake, um ein Fortran-Projekt unter Windows vorzubereiten. Ich habe einige Einlass Fortran-Compiler mit VC2015 installiert ist, und wenn ich cmake den folgenden Fehler habenCMake Intel Fortran Compiler ist nicht in der Lage, ein einfaches Programm zu kompilieren

-- Check for working Fortran compiler: D:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/ifc.exe 
-- Check for working Fortran compiler: D:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/ifc.exe -- broken 
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/CMakeTestFortranCompiler.cmake:54 (message): 
    The Fortran compiler "D:/Program Files (x86)/Microsoft Visual Studio 
    14.0/VC/bin/ifc.exe" is not able to compile a simple test program. 

    It fails with the following output: 

    Change Dir: D:/Dev/plaf/build/CMakeFiles/CMakeTmp 

    Run Build Command:"nmake" "/NOLOGO" "cmTC_f7da8\fast" 

     "D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f 
    CMakeFiles\cmTC_f7da8.dir\build.make /nologo -L 
    CMakeFiles\cmTC_f7da8.dir\build 

    Building Fortran object 
    CMakeFiles/cmTC_f7da8.dir/testFortranCompiler.f.obj 

     "D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\ifc.exe" -c 
    D:\Dev\plaf\build\CMakeFiles\CMakeTmp\testFortranCompiler.f -o 
    CMakeFiles\cmTC_f7da8.dir\testFortranCompiler.f.obj 

    usage: D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\ifc.exe 
    [subcommand] [options...] 

    subcommands: 
     OBJ   Convert an interface file into a dummy object file which can be archived into a static lib. 
     EMBED   Embed an interface file into an existing static lib, producing a new lib. 
     EXTRACT  Extract an embedded interface file from an existing static lib, producing the ifc. 
     LOCATE   Find all embedded interface files and print their offset + size to stdout. 

    NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 
    14.0\VC\bin\ifc.exe"' : return code '0x1' 

Mein Verständnis des Fehlers (korrigieren Sie mich, wenn ich falsch bin), ist, dass Cmake den Compiler mit den falschen Flags verwendet , also während der Beispielprogrammkompilierung funktioniert es einfach nicht.

Wie kann ich das beheben? (Der Fehler scheint anders als das, was ich in den meisten anderen Posts gesehen habe)

+0

zu wählen. Wenn Sie von Visual Studio meinen, ja, ich habe gerade ein neues Fortran Hallo Welt-Projekt erstellt, kompiliert und läuft ohne Probleme. –

+0

Was ist deine CMake-Version? Manchmal muss man etwas optimieren, um mit neueren Versionen zu arbeiten. – usr1234567

+0

cmake Version 3.5.2 –

Antwort

0

es passierte bei mir, als ich MinGW zum kompilieren verwendete. Die Lösung ist, "MinGW Makefiles" anstelle von Visual Studio in der Konfiguration von CMake