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"
相关推荐
kun200310292 小时前
如何用Obsidian+VSCode生成文案排版并发布到公众号
ide·vscode·编辑器
JQLvopkk8 小时前
C# 实践AI :Visual Studio + VSCode 组合方案
人工智能·c#·visual studio
踏过山河,踏过海10 小时前
【qt-查看对应的依赖的一种方法】
qt·visual studio
开源技术12 小时前
Python GeoPandas基础知识:地图、投影和空间连接
开发语言·ide·python
承渊政道14 小时前
C++学习之旅【C++中模板进阶内容介绍】
c语言·c++·笔记·学习·visual studio
寻梦csdn1 天前
pycharm+miniconda兼容问题
ide·python·pycharm·conda
电饭叔1 天前
Jupyter学习中的问题--FileNotFoundError
ide·学习·jupyter
noBt1 天前
Windows IDEA 卡顿严重
java·ide·intellij-idea
小疙瘩1 天前
去掉 IDEA 中 mybatis配置文件的局部背景颜色(图解)
java·ide·intellij-idea
zhanglianzhao1 天前
Win 11 WSL 配置Claude code 并在VsCode中使用
ide·vscode·编辑器·claude·cladue code