gfortran linking flag for openmp

限于喜欢 提交于 2019-12-14 03:53:38

问题


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

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

This is obviously not the correct flag for the GNU compiler. What is the correct OpenMP linking flag for gfortran?


回答1:


It is -fopenmp as well:

gfortran -fopenmp -o a.out file1.o file2.o


来源:https://stackoverflow.com/questions/37490944/gfortran-linking-flag-for-openmp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!