我正在尝试在 linux 上编译 OPENMP fortran 代码。我有大约 230 个子程序。我用来编译代码的代码如下: 1)一开始我用下面的命令编译了每个子程序
ifort -c -override-limits -openmp *.for
然后所有的子程序现在都有一个单独的目标文件。
2)然后我尝试通过以下命令将目标文件编译为可执行文件
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 程序。
谢谢
贾巴巴