在Sublime Text 3上运行Intel Fortran [英] Running Intel Fortran on Sublime Text 3
问题描述
Sublime Text 3具有一个将文本编辑器链接到Gfortran的程序包,它可以正常运行.我想知道如何将Intel Fortran作为自定义版本添加到Sublime Text 3?据我了解,我需要继续构建系统并使用类似于以下代码的代码创建一个新文件(这是gfortran的示例).
Sublime Text 3 has a package that links the text editor to Gfortran and it runs without any problems. I would like to know how can I add Intel Fortran as a custom build to Sublime Text 3? From what I understand I need to go on build systems and create a new file with code similar to the one below (this is an example for gfortran).
{
"cmd": "gfortran ${file} -o ${file_base_name}",
"selector": "source.modern-fortran, source.fixedform-fortran",
}
如何为Intel Fortran做到这一点?
How could I do this for Intel Fortran?
额外:
This was asked before for Linux (I use Windows) here: Sublime Text 2 Build (Ctrl +B) Intel Fortran Compiler . The fix is supposed to be:
"cmd": ["ifort","$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.fortran90"
但是它在我的PC上不起作用.我收到以下消息:
But it doesn't work on my PC. I get the following message:
[WinError 2] The system cannot find the file specified
[cmd: ['ifort', 'C:\\Users\\username\\Desktop\\fortranfile.f90']]
[dir: C:\Users\username\Desktop]
[path: C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.4.210\windows\mpi\intel64\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\compiler;C:\MinGW\bin;C:\cygwin64\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\windows\system32;C:\MinGW\bin]
[Finished]
推荐答案
我设法在Sublime Text 3上运行Intel Fortran,方法是在New Build System中创建一个新文件,如下所示(我使用的是Intel 64 Visual Studio 2013环境):
I managed to run Intel Fortran on Sublime Text 3 by creating a new file in New Build System as follows (I am using Intel 64 Visual Studio 2013 environment):
{
"cmd": ["cmd", "/e:on", "/v:on", "/k", "ipsxe-comp-vars intel64 vs2013 && ifort ${file}"],
"file_regex": "^.*\\\\([0-9A-Za-z_]+\\.[A-Za-z0-9]+)\\(([0-9]+)\\):[ ]+error[ ]+#([0-9]+):[ ]+(.*)$",
"working_dir":"${file_path}",
"selector":"source.f ,source.for ,source.ftn ,source.f90 ,source.fpp ,source.i ,source.i90",
"encoding":"cp936",
"path":"C:\\Program Files (x86)\\IntelSWTools\\compilers_and_libraries_2017.4.210\\windows\\bin;${path}",
"variants":
[
{
"name": "Run",
"cmd": ["cmd", "/e:on", "/v:on", "/c", "ipsxe-comp-vars intel64 vs2013 && ifort ${file} && ${file_base_name}"]
}
]
}
这篇关于在Sublime Text 3上运行Intel Fortran的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!