##清华大学开源软件镜像
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch
##中国科学技术大学开源软件镜像
Server = http://mirrors.ustc.edu.cn/msys2/msys/$arch/
##清华大学开源软件镜像
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686
##中国科学技术大学开源软件镜像
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686/
##清华大学开源软件镜像
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64
##中国科学技术大学开源软件镜像
Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64/
pacman -Syu
pacman -Syu 同步软件库并更新系统到最新状态
pacman -S -h 查看Pacman工具帮助
pacman -Q 列出所有已安装的软件包
pacman -Ss xx 查询软件xx的信息
pacman -S xx 安装软件xx
pacman -R xx 删除软件xx
pacman -Ss fortran
pacman -S mingw-w64-x86_64-gcc-fortran
program hello
Implicit none
!$OMP PARALLEL
print '(a)','Hello'
!$OMP END PARALLEL
end program hello
gfortran -o hello hello.f90
hello
gfortran -fopenmp -o hello hello.f90
hello
pacman -Ss gdb
pacman -S mingw64/mingw-w64-x86_64-gdb
python
检查python是否已经正常安装。如果未能正常安装,则可能需要手动将Python.exe所在路径添加到环境变量中。gfortran -o hello hello.f90
.\hello
pip install fortran-language-server
pip install fprettify
--indent=2
。program hello
implicit none
integer(kind=4)::a(4)=(/1,2,3,4/)
integer(kind=4)::i
!$OMP PARALLEL
do i=1,4
a(i)=a(i)+1
write(*,*) a(i)
end do
!$OMP END PARALLEL
end program hello
gfortran -o hello hello.f90
.\hello
{
"version": "2.0.0",
"tasks": [
{
"label": "compile",
"type": "shell",
"command": "gfortran",
"args": ["-g", "${file}", "-o", "${workspaceRoot}\\${fileBasenameNoExtension}.exe"],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Fortran",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "compile"
}
]
}
[1] 用 VS Code + MSYS 搞定 Windows 上的 Fortran 开发. URL: https://stblog.penclub.club/posts/Fortran/
[2] VS Code for Fortran. URL: https://www.bilibili.com/video/BV195411c71L?p=1&vd_source=3e2aa4e8d04cdb5d3d8e4bee573550a7
[3] 现代Fortran编程:拥抱开源Fortran环境,高效使用现代Fortran. URL: https://www.bilibili.com/video/BV1M5411M7Eo/?spm_id_from=333.788.recommend_more_video.15&vd_source=3e2aa4e8d04cdb5d3d8e4bee573550a7