visual studio编译fortran

1、下载hpc-toolkithttps://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit-download.html

2、配置环境变量

检查ifx是否在环境变量中

3、

复制代码
# FORTRAN code
enable_language(Fortran)

if(${CMAKE_Fortran_COMPILER} MATCHES "ifort.*")
    set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS} -fltconsistency")
    set(CMAKE_Fortran_FLAGS_DEBUG   "${CMAKE_Fortran_FLAGS} -fltconsistency")
endif()

set(SRC
    *.f
    
)

add_library(xxx STATIC 
            ${SRC}
)

4、build

复制代码
cmake -S . -B build -G "Visual Studio 16 2019" -T "fortran=ifx"
相关推荐
liufeiyu19762 天前
VS 2026 升级后出现错误: 找不到指定的 SDK“Microsoft.NET.Sdk”
visual studio·vs 2026
霍霍的袁2 天前
【C++】map 和 set 的使用 | 从用法到底层
开发语言·c++·学习·visual studio
2501_915909063 天前
移动端开发工具链怎么组合比较好,iOS、Android、跨端三套配置方案
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
2501_915918413 天前
iOS编程用什么软件好?主流工具Xcode、AppCode、CodeRunner与新兴快蝎对比
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
VIP_CQCRE3 天前
在 Visual Studio 里接入 Ace Data Cloud:让 AI 编程助手直接用上 OpenAI 兼容接口
openai·ai编程·开发工具·visual studio·acedatacloud
VIP_CQCRE4 天前
在 Visual Studio 里接入 AI 编程助手:用 Ace Data Cloud 打通 OpenAI 兼容接口与 LMLocal
openai·ai编程·visual studio·acedatacloud·lmlocal
free-elcmacom4 天前
发际线警告!手撕《C陷阱与缺陷》终极 BOSS:signal 函数与 typedef 魔法
c语言·开发语言·visual studio code·visual studio
VIP_CQCRE4 天前
Visual Studio 也能丝滑接入大模型:用 Ace Data Cloud + LMLocal 打造 AI 编程体验
ai·大模型·visual studio·ace data cloud·lmlocal
千谦阙听4 天前
【 C++篇】:模板初阶——泛型编程、函数模板与类模板
开发语言·c++·学习·visual studio
滕州市燕猫虎计算机科技工作室个体工商户4 天前
IDEA:Command line is too long
java·ide·intellij-idea