Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 并行程序给出错误“未定义对_Kmpc_ok_to_fork的引用”_Linux_Fortran_Openmp_Intel - Fatal编程技术网

Linux 并行程序给出错误“未定义对_Kmpc_ok_to_fork的引用”

Linux 并行程序给出错误“未定义对_Kmpc_ok_to_fork的引用”,linux,fortran,openmp,intel,Linux,Fortran,Openmp,Intel,我正在尝试在linux上编译OPENMP fortran代码。我有大约230个子程序。我用来编译代码的代码如下: 1首先,我用以下命令编译了每个子例程 ifort -c -override-limits -openmp *.for ifort *.o -o myprogram 然后,所有子例程现在都有一个单独的对象文件 2然后我尝试通过以下命令将对象文件编译为可执行文件 ifort -c -override-limits -openmp *.for ifort *.o -o myprogr

我正在尝试在linux上编译OPENMP fortran代码。我有大约230个子程序。我用来编译代码的代码如下: 1首先,我用以下命令编译了每个子例程

ifort -c -override-limits -openmp *.for
ifort *.o -o myprogram
然后,所有子例程现在都有一个单独的对象文件

2然后我尝试通过以下命令将对象文件编译为可执行文件

ifort -c -override-limits -openmp *.for
ifort *.o -o myprogram
我得到了以下错误:

WINDWAVE.F90:(.text+0x1c9d): undefined reference to `__kmpc_global_thread_num'
WINDWAVE.F90:(.text+0x1cb0): undefined reference to `__kmpc_ok_to_fork'
WINDWAVE.F90:(.text+0x1eea): undefined reference to `__kmpc_fork_call'
WINDWAVE.F90:(.text+0x1f09): undefined reference to `__kmpc_serialized_parallel'
WINDWAVE.F90:(.text+0x214b): undefined reference to `__kmpc_end_serialized_parallel'
WINDWAVE.F90:(.text+0x2427): undefined reference to `__kmpc_for_static_init_4' 
WINDWAVE.F90:(.text+0x29c7): undefined reference to `__kmpc_for_static_fini'
WINDWAVE.F90:(.text+0x29da): undefined reference to `__kmpc_barrier'
WINDWAVE.F90:(.text+0x2a50): undefined reference to `__kmpc_for_static_init_4'
WINDWAVE.F90:(.text+0x3773): undefined reference to `__kmpc_for_static_fini'
WINDWAVE.F90:(.text+0x3786): undefined reference to `__kmpc_barrier'
WINDWAVE.F90:(.text+0x37fc): undefined reference to `__kmpc_for_static_init_4'
WINDWAVE.F90:(.text+0x4a58): undefined reference to `__kmpc_for_static_fini'
WINDWAVE.F90:(.text+0x4a6b): undefined reference to `__kmpc_barrier'
WINDWAVE.F90:(.text+0x4a8f): undefined reference to `__kmpc_single'
WINDWAVE.F90:(.text+0x4d18): undefined reference to `__kmpc_end_single'
WINDWAVE.F90:(.text+0x4d2b): undefined reference to `__kmpc_barrier'
WINDWAVE.F90:(.text+0x4da9): undefined reference to `__kmpc_for_static_init_4'
WINDWAVE.F90:(.text+0x4fc5): undefined reference to `__kmpc_for_static_fini'
WINDWAVE.F90:(.text+0x4fd8): undefined reference to `__kmpc_barrier'
WINDWAVE.F90:(.text+0x504e): undefined reference to `__kmpc_for_static_init_4'
WINDWAVE.F90:(.text+0x596f): undefined reference to `__kmpc_for_static_fini'
WINDWAVE.F90:(.text+0x5982): undefined reference to `__kmpc_barrier'
WINDWAVE.F90:(.text+0x59fb): undefined reference to `__kmpc_for_static_init_4'
WINDWAVE.F90:(.text+0x6369): undefined reference to `__kmpc_for_static_fini'
WINDWAVE.F90:(.text+0x637c): undefined reference to `__kmpc_barrier'
WINDWAVE.F90:(.text+0x63f2): undefined reference to `__kmpc_for_static_init_4'
WINDWAVE.F90:(.text+0x6b8d): undefined reference to `__kmpc_for_static_fini'
WINDWAVE.F90:(.text+0x6ba0): undefined reference to `__kmpc_barrier'
WINDWAVE.o: In function `windwave_mp_fetch_':
WINDWAVE.F90:(.text+0x9cfd): undefined reference to `__kmpc_global_thread_num'
WINDWAVE.F90:(.text+0x9d10): undefined reference to `__kmpc_ok_to_fork'
WINDWAVE.F90:(.text+0x9da0): undefined reference to `__kmpc_fork_call'
WINDWAVE.F90:(.text+0x9dbc): undefined reference to `__kmpc_serialized_parallel'
WINDWAVE.F90:(.text+0x9e59): undefined reference to `__kmpc_end_serialized_parallel'
WINDWAVE.F90:(.text+0xa0ea): undefined reference to `__kmpc_for_static_init_4'
WINDWAVE.F90:(.text+0xa109): undefined reference to `__kmpc_for_static_fini'
WINDWAVE.F90:(.text+0xa118): undefined reference to `__kmpc_barrier'
我正在使用intel 13 composer编译程序。我不知道如何使用libiomp5md的链接

请帮我摆脱这个错误。我试了好几次,但都没有得到这个错误

如果我不使用openmp标志,程序将运行,但不会将其视为openmp程序

谢谢


Jdbaba

快速浏览英特尔论坛表明,您可能还需要在第二个命令上使用-openmp选项,以使其链接到openmp库


您可以通过谷歌搜索“kmpc\u global\u thread\u num”来发现这一点。对英特尔论坛的快速扫描表明,您可能还需要第二个命令上的-openmp选项,以使其链接到openmp库


你可以通过谷歌搜索“kmpc全球线程数”来发现这个问题,我也有同样的问题,搜索后,有人建议了这个方法,为我工作。调用ifort时只需添加此选项:

 -openmp -fpp -auto

这个问题可能是由于没有链接到mp库造成的。

我也有同样的问题,搜索后,有人提出了这个方法,对我有效。调用ifort时只需添加此选项:

 -openmp -fpp -auto

问题可能是由于未链接到mp库。

Jim,非常感谢。我在谷歌上搜索了一下,但没有找到。我很高兴我问了关于stackoverflow的问题。再次感谢你帮我做这件事。吉姆,非常感谢你。我在谷歌上搜索了一下,但没有找到。我很高兴我问了关于stackoverflow的问题。再次感谢你帮我做这件事。