2016-04-25 256 views
0

我觉得完全失去了试图让CMake在Windows上工作。我有一个有Fortran和C文件的项目(ECCODES)。如果我不使用CMake,我可以编译Fortran文件。但是这个项目带有大量的CMake文件。我看下面的错误,它对我说:“即使您在不使用CMake时编译Fortran文件,我(CMake)也无法编译简单的Fortran程序。”任何人都可以理解这一点吗?我试图使用mingw64,因为我无法在Windows版本的这个项目上使用cygwin。在Mac OS X和GNU/Linux的一切都建立很好,但我必须在Windows上运行这个项目......如何使用CMake在Windows/MinGW上编译基本的Fortran文件?

Error:The Fortran compiler "c:/gcc-5.1.0-tdm64-1-fortran/bin/gfortran.exe" is not able to compile a simple test program. 
It fails with the following output: 
Change Dir: C:/Users/knauthg/.CLion2016.1/system/cmake/generated/ECCodes-45f4e5f3/45f4e5f3/__default__/CMakeFiles/CMakeTmp 
Run Build Command:"C:/mingw64/bin/mingw32-make.exe" "cmTC_93cb8/fast" 
C:/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_93cb8.dir\build.make CMakeFiles/cmTC_93cb8.dir/build 
mingw32-make.exe[1]: Entering directory 'C:/Users/knauthg/.CLion2016.1/system/cmake/generated/ECCodes-45f4e5f3/45f4e5f3/__default__/CMakeFiles/CMakeTmp' 
Building Fortran object CMakeFiles/cmTC_93cb8.dir/testFortranCompiler.f.obj 
c:\gcc-5.1.0-tdm64-1-fortran\bin\gfortran.exe -c C:\Users\knauthg\.CLion2016.1\system\cmake\generated\ECCodes-45f4e5f3\45f4e5f3\__default__\CMakeFiles\CMakeTmp\testFortranCompiler.f -o CMakeFiles\cmTC_93cb8.dir\testFortranCompiler.f.obj 
CMakeFiles\cmTC_93cb8.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_93cb8.dir/testFortranCompiler.f.obj' failed 
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_93cb8.dir/testFortranCompiler.f.obj] Error 1 
mingw32-make.exe[1]: Leaving directory 'C:/Users/knauthg/.CLion2016.1/system/cmake/generated/ECCodes-45f4e5f3/45f4e5f3/__default__/CMakeFiles/CMakeTmp' 
Makefile:125: recipe for target 'cmTC_93cb8/fast' failed 
mingw32-make.exe: *** [cmTC_93cb8/fast] Error 2 
CMake will not be able to correctly generate this project. 

回答

0

之前,我用的gfortrantdm-gcc Windows 64位版本。我通过Simply Fortran切换到了gfortran的64位版本,现在整个ECCODES项目都使用CMake完成。我仍然使用MingW64 gcc编译C文件。

Hat给John Wasilewski的提示是thread of Physics Forums,他给出了关于Simply Fortran的提示。

相关问题