【发布时间】:2016-03-15 02:48:26
【问题描述】:
这是一个简单的问题,我需要在 mingw32 上创建一个 CMake 构建器。我想在 CMakeLists.txt 中定义编译器(虽然我想在稍后调用 cmake 时指定它)。 txt 文件如下所示:
cmake_minimum_required(VERSION 3.4)
SET(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_GENERATOR "MinGW Makefiles")
message("generator is set to ${CMAKE_GENERATOR}")
#set (CMAKE_Fortran_COMPILER "C:/Program Files/PGI/win64/15.10/bin")
set (CMAKE_Fortran_COMPILER "C:/Program Files (x86)/Silverfrost/FTN95")
然后它返回:
generator is set to MinGW Makefiles
-- The Fortran compiler identification is unknown
-- Check for working Fortran compiler: C:/Program Files (x86)/Silverfrost/FTN95
-- Check for working Fortran compiler: C:/Program Files (x86)/Silverfrost/FTN95 -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake- 3.4/Modules/CMakeTestFortranCompiler.cmake:54 (message):
The Fortran compiler "C:/Program Files (x86)/Silverfrost/FTN95" is not able
to compile a simple test program.
我做错了什么?我知道它没有正确找到编译器。感谢您的帮助。
编辑。正如建议的那样,我发布了 CMakeError.log
Compiling the Fortran compiler identification source file "CMakeFortranCompilerId.F" failed.
Compiler: C:/Program Files (x86)/Silverfrost/FTN95
Build flags:
Id flags: -v
The output was:
Access is denied
Compiling the Fortran compiler identification source file "CMakeFortranCompilerId.F" failed.
Compiler: C:/Program Files (x86)/Silverfrost/FTN95
Build flags:
Id flags:
The output was:
Access is denied
Compiling the Fortran compiler identification source file "CMakeFortranCompilerId.F" failed.
Compiler: C:/Program Files (x86)/Silverfrost/FTN95
Build flags:
Id flags: -c
The output was:
Access is denied
Compiling the Fortran compiler identification source file "CMakeFortranCompilerId.F" failed.
Compiler: C:/Program Files (x86)/Silverfrost/FTN95
Build flags:
Id flags: -fpp
The output was:
Access is denied
Checking whether the Fortran compiler is Compaq using "-what" did not match "Compaq Visual Fortran":
Checking whether the Fortran compiler is NAG using "-V" did not match "NAG Fortran Compiler":
Determining if the Fortran compiler works failed with the following output:
Change Dir: C:/Users/RolandGuichard/Desktop/SATURN/SATGPU/testcm/CMakeFiles/CMakeTmp
Run Build Command:"C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/devenv.com" "CMAKE_TRY_COMPILE.sln" "/build" "Debug" "/project" "cmTC_e9efb"
The Application Data folder for Visual Studio could not be created.
我可以在这里追踪更多信息吗?谢谢。
【问题讨论】:
-
必须有一些更完整的日志文件包含实际的编译错误。
-
是的,会有帮助吗?
-
谁知道呢,没看到。您绝对应该发布它。
-
检查您的构建目录中的 CMakeFiles/CMakeError.log。