在mingw32中将CMake用于Fortran代码

问题描述 投票:0回答:1

这是一个简单的问题,我需要在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.

我可以在此处跟踪更多信息吗?谢谢。

cmake fortran mingw32
1个回答
0
投票

[帮助他人:四年后,我遇到了同样的问题。我通过确保像这样在CMakeList.txt中指向FORTRAN可执行文件的确切位置来解决了它。这为我解决了。让我知道它是否有效。

© www.soinside.com 2019 - 2024. All rights reserved.