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"
相关推荐
new_zhou2 小时前
vs2019+qt工程中生成dump文件及调试
开发语言·qt·visual studio·dump调试
啊湘3 小时前
vscode 使用 github (适用CURSOR等使用)
ide·vscode·github·cursor·mcp
从此不归路4 小时前
FPGA 结构与 CAD 设计(第3章)下
ide·fpga开发
云堆客栈5 小时前
基于vscode的markdown编辑器部署方案
ide·vscode·编辑器
smileNicky5 小时前
Lombok @Data 在 IDEA 中运行报错解决方案
java·ide·intellij-idea
好大哥呀5 小时前
C++ IDE
开发语言·c++·ide
dust_and_stars6 小时前
ubuntu24 安装vscode
ide·vscode·编辑器
向上的车轮7 小时前
如何选择Python IDE?
开发语言·ide·python
Destiny_where7 小时前
Claude VSCode插件版接入强大的GLM(无需登录注册claude code)
ide·人工智能·vscode·编辑器·claude code
猫头虎7 小时前
Claude Code 2026 年1月9日迎来大更新:Agent 能力增强(2.1.0 详解 + 升级指南)
ide·人工智能·macos·langchain·编辑器·aigc·ai编程