说明:本系列文章为个人笔记,如有不正确之处,请参考官方相关文档,如果错误发现,我会尽量更新修改。另外,以下内容不保证对于所有版本的编译器都正确,编译器的实现也可能有一些变化之处,具体参考官方文档。
更多说明请参考http://blog.youkuaiyun.com/gengshenghong/article/details/7034748中补充说明部分。
Summary:前面介绍了编译器和PGO相关的工具,这里介绍的工具不一定是PGO相关的工具。
(1) 编译器选项映射工具
对于编译器,有很多选项,对于那些熟悉于某一平台(比如win)的选项,但是对其它平台(比如Lin)的同功能的选项不太熟悉的时候,如果需要转换平台,比较头疼的就是去寻找相同功能的选项。编译器选项映射工具提供了这一功能来帮助用户找到另一平台的同功能选项。
PS:不支持Mac OS。
1. 使用方式:
有两种方式使用这一功能,第一是使用编译器的选项/Qmap-opts;第二是直接运行map_opts工具。
2. 使用编译器选项
语法:<compiler command> <map-opts option> <compiler option(s)>
举例:icl /Qmap-opts /Od /FA /Qipo
Intel(R) Compiler option mapping tool
mapping Windows options to Linux for C++
'-Qmap-opts' Windows option maps to
--> '-map-opts' option on Linux
--> '-map_opts' option on Linux
'-Od' Windows option maps to
--> '-O0' option on Linux
'-FA' Windows option maps to
--> no equivalent Linux option found
'-Qipo' Windows option maps to
--> '-ipo' option on Linux
3. 使用map_opts
语法:map_opts [-nologo] -t<target OS> -l<language> -opts <compiler option(s)>
其中,<target OS> = {l|linux|w|windows}、<language> = {f|fortran|c},都是可选的。
举例:map_opts -opts /Od /FA /Qipo
Intel(R) Compiler option mapping tool
mapping Windows options to Linux for C++
'-Od' Windows option maps to
--> '-O0' option on Linux
'-FA' Windows option maps to
--> no equivalent Linux option found
'-Qipo' Windows option maps to
--> '-ipo' option on Linux
(2) 无