2012-11-11 126 views
2

我有一個針對ifort進行了優化的程序,但是我想用gfortran編譯它。這裏的標誌提供:用gfortran編譯代替ifort

FCFLAGS= -Vaxlib -CB -mcmodel=large -O -openmp -DOMP 

我已經在手動輸入一看兩個試圖找到相應的選項,但我一直沒能找到任何東西(除了-openmp其他 - fopenmp,我已經知道了)。

回答

2

這是,通過選擇等價表的選項:

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相同的性能。

+1

是否有完整的等價表? – gregmacfarlane

+0

@gregmacfarlane,我不這麼認爲。但可以通過閱讀手冊來構建它。 –