gfortran连接标志为openmp [英] gfortran linking flag for openmp
本文介绍了gfortran连接标志为openmp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用 gfortran
链接多个.o文件。我编译了这样的文件(在makefile中):
I'm trying to link multiple .o files using gfortran
. I've compiled the files like so (in a makefile):
gfortran -c -fopenmp file1.f
gfortran -c -fopenmp file2.f
现在我想链接文件OpenMP。我知道与英特尔编译器链接标志是 -liomp5
,所以要链接文件与英特尔编译器,将调用:
Now I'd like to link the files with an option for OpenMP. I know with the Intel compiler the linking flag is -liomp5
, so to link the files with the Intel compiler one would call:
ifort -o a.out file1.o file2.o -liomp5
这显然不是GNU编译器的正确标志。什么是 gfortran
的正确OpenMP链接标志是什么?
This is obviously not the correct flag for the GNU compiler. What is the correct OpenMP linking flag for gfortran
?
推荐答案
也是 -fopenmp
:
gfortran -fopenmp -o a.out file1.o file2.o
这篇关于gfortran连接标志为openmp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文