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"
相关推荐
李少兄5 小时前
解决IntelliJ IDEA 提交代码时无复选框问题
java·ide·intellij-idea
sniper_fandc6 小时前
IDEA修改系统缓存路径,防止C盘爆满
java·ide·intellij-idea
CUIYD_19896 小时前
Eclipse 常用搜索功能汇总
java·ide·eclipse
byte轻骑兵8 小时前
365 天技术创作手记:从一行代码到四万同行者的相遇
ide·vscode·编辑器
点云侠10 小时前
解决Visual Studio 2022编译工程速度慢的问题
开发语言·c++·ide·算法·计算机视觉·visual studio
奥特曼打小白10 小时前
Visual Studio Code的第一次安装
ide·vscode·编辑器
weixin_4569042710 小时前
Vscode中开发VUE项目的调试方案
ide·vue.js·vscode
和小胖112210 小时前
第二讲 Vscode+Python+anaconda 高阶环境配置
ide·vscode·python
峥嵘life11 小时前
Android Studio新版本编译release版本apk实现
android·ide·android studio
陈老老老板12 小时前
Visual Studio Code 中为Copilot 添加 Bright Data 的 Web MCP
ide·vscode·copilot