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"
相关推荐
不爱吃鱼的蔓热莓11 小时前
释放VSCode插件占用系统盘垃圾
ide·vscode·编辑器
2501_9151063213 小时前
iOS开发之Xcode常用调试技巧总结
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
bing_feilong17 小时前
vscode: ssh Got bad result from install script
ide·vscode·ssh
JavaEdge.17 小时前
Qodo v.s AI IDE Code Review
ide·人工智能·代码复审
ITKEY_18 小时前
Arduino IDE开发ESP32环境搭建到helloworld
ide·esp32
H.莓飛18 小时前
【C++】模板初阶
linux·开发语言·c++·visual studio
captain37619 小时前
Spring Web MVC入门(1)
ide·spring·java-ee·tomcat
蹊黎1 天前
C++中vector类的部分简单实现
开发语言·c++·visual studio
葵花日记1 天前
VS2022 美化指南:用 ClaudiaIDE 设置自定义编辑器背景
ide·visualstudio·编辑器