2017-10-21 155 views
1

在这个伟大的网站的帮助下,我能够使用像这样在this answer中建议的“新构建系统”在Sublime Text 3中编译我的Fortran代码。在Sublime Text 3中编译Fortran时与英特尔MKL库链接?

{ 
    "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.2.187\\windows\\bin;${path}", 
    "variants": 
     [ 
      { 
       "name": "Run", 
       "cmd": ["cmd", "/e:on", "/v:on", "/c", "ipsxe-comp-vars intel64 vs2013 && ifort ${file} && ${file_base_name}"] 
      } 
    ] 

} 

现在,我想链接到MKL库,以从其高度优化的例程中受益。我想包括LAPACK例程,来自mkl_dfti的FFT,来自mkl_vsl的随机数等。我尝试将这些库添加到编译命令中,如下所示,但未成功。

"cmd": ["cmd", "/e:on", "/v:on", "/c", "ipsxe-comp-vars intel64 vs2013 && 
     ifort ${file} && ${file_base_name} mkl_lapack95_lp64.lib mkl_intel_lp64.lib 
     mkl_intel_thread.lib mkl_core.lib libiomp5md.lib"] 

我使用Windows 10并可以在Visual Studio 2013中访问这些库。我需要帮助配置Sublime Text以使用相同的库。

回答

2

英特尔Fortran编译器标志/ Qmkl添加了MKL库。 将“ifort $ {file}”更改为“ifort/Qmkl $ {file}”应该适合您。

+0

您通常需要做更多。 Tere是各种旗帜,你必须根据特定的点来选择。请参阅https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor –

相关问题