win11+VS2022 Fortran
配置见前序文章(OneAPI 2023.1+VS 2022.4.5)win11+VS2022 Fortran+lapack64_win11安装fortran csdn-CSDN博客
注意:intel oneAPI与visual studio版本是否兼容,参考https://www.intel.com/content/www/us/en/developer/articles/reference-implementation/intel-compilers-compatibility-with-microsoft-visual-studio-and-xcode.html
旧版visual studio安装包下载https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history#fixed-version-bootstrappers
准备安装包
通过Evaluate IMSL for Your Project | Free IMSL Trial以学生身份申请并下载
注意:
1.各版本支持的OneAPI与系统版本,详见IMSL(R) Fortran Numerical Library: Platform Support
目前运行发现intel oneAPI 2023.1使用Platform Interl oneAPI 2022.1版本合适。除了下载文件,Readme部分也值得认真研读。
安装IMSL库
双击fnl-2024.1.0-win110in221x64_eval.exe正常安装即可。
注意:
1.记住安装目录,后面会用到
2.选择FNL Documentation
环境配置
1.WIN11搜索输入“cmd”后回车,进入命令提示符
- start the Intel Fortran Command Prompt Window
cd <ROGUEWAVE_DIR>\imsl\fnl-<VER>\<ENV>\bin\
fnlsetup.bat
- NOTE: Environment variables set by
fnlsetup.bat
are only available for the duration of the current command prompt session. They are lost once the command prompt session is ended.
2.键盘按下“Win+R”,输入“control system”,确定→高级系统设置→环境变量后,添加path:
<ROGUEWAVE_DIR>\imsl\fnl-<VER>\<ENV>\lib
许可证安装
把下载下来的许可证,修改成imsl_eval.dat,放到E:\Program Files (x86)\RogueWave\license
注意:许可证文件名为imsl_eval,文件格式为DAT
配置IMSL
- Add Source Code to the Project
- Select Project -> Add Existing Item and add your Fortran source code file or for testing you may use
imslmp.f90
from<ROGUEWAVE_DIR>\imsl\fnl-<VER>\<ENV>\examples\validate
- Select Project -> Add Existing Item and add your Fortran source code file or for testing you may use
- Configure the project
- Click on Project -> Properties in the menu bar.
- Select Configuration Properties from the popup menu.
- Under Fortran -> Language, set Process OpenMP Directives to "Generate Parallel Code (/Qopenmp)".
- Under Fortran -> Floating Point, set Floating Point Exception Handling to "Produce NaN, signed infinity, and denormal results".
- Under Fortran -> Command Line, add the following switch in the Additional Options box:
/F60000000
- Click Apply, then OK to exit the Property Pages dialog box.
- Add the Include Files Directory
- In the Solution Explorer, right click on Project and select Properties.
- Select Configuration Properties from the menu.
- Under Fortran -> General, add
<ROGUEWAVE_DIR>\imsl\fnl-<VER>\<ENV>\include\dll
to the "Additional Include Directories" list. - Under Linker -> General, add
<ROGUEWAVE_DIR>\imsl\fnl-<VER>\<ENV>\lib
to the "Additional Library Directories" list. - Click Apply, then OK to exit the Property Pages dialog box.
- Choose compiler
- Right click on the project in Solution Explorer. Click on Intel Compiler. This will display the currently selected compiler. Click on the compiler and select 'IFORT Intel Fortran Compiler Classic' if it is not already selected.(一般默认IFORT)
- Link the IMSL Numerical Library
- In the Solution Explorer, right click on Project and select Properties.
- Select Linker -> General from the menu.
- Add
<Roguewave_dir>\imsl\fnl-<ver>\<env>\lib
to the "Additional Library Directories" list. - Click Apply.
- Select Linker -> Input from the menu.
- Add
imsl_dll.lib
to the "Additional Dependencies" list. - Click Apply, then OK to exit the Project Property Pages dialog box.
程序注意
use IMSL更换为:
include 'link_fnl_shared.h' !imsl 6.0及以后
use numerical_libraries
并且需要补充:
use operation_i