用gfortran而不是ifort编译 [英] Compiling with gfortran instead of ifort
本文介绍了用gfortran而不是ifort编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个针对ifort进行了优化的程序,但是我想改用gfortran编译它。以下是提供的标志:
FCFLAGS= -Vaxlib -CB -mcmodel=large -O -openmp -DOMP
我已经查看了手册条目,试图找到相应的选项,但我找不到任何东西(除了我已经知道的-Open MP for-fOpenMP)。
推荐答案
这是按选项列出的选项等价表:
ifort gfortran Commentary
-----------------------------------------------------------------------
-Vaxlib Enables old VAX library compatibility
(should not be necessary with gfortran
and newer ifort versions)
-CB -fbounds-check Enables array bounds check at run-time
-mcmode=large -mcmodel=large Enables large memory model
-O -O2 Enables optimisaiton
-openmp -fopenmp Enables OpenMP support
-DOMP -DOMP Preprocessor option (defines the OMP symbol)
请注意,启用边界检查和大内存模型会减慢代码执行速度。还要注意的是,单独使用-O
可以使用ifort
(相当于-O2
)和gfortran
(相当于-O1
)实现不同级别的优化。还要注意的是,ifort
比gfortran
更优化。您可能需要提供更多选项来微调后者,以便达到与ifort
相同的性能。
这篇关于用gfortran而不是ifort编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文