Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

-parallel

brunocalado
ビギナー
1,951件の閲覧回数

I am trying to use -parallel feature.

I create the program and the env vars. But when I compile I got this:

[plain]../src/main.f90:(.text+0x2b): undefined reference to `__kmpc_begin' ../src/main.f90:(.text+0x35): undefined reference to `__kmpc_global_thread_num' ../src/main.f90:(.text+0x4b): undefined reference to `__kmpc_ok_to_fork' ../src/main.f90:(.text+0x70): undefined reference to `__kmpc_fork_call' ../src/main.f90:(.text+0x80): undefined reference to `__kmpc_serialized_parallel' ../src/main.f90:(.text+0xe4): undefined reference to `__kmpc_end_serialized_parallel' ../src/main.f90:(.text+0x126): undefined reference to `__kmpc_end' ../src/main.f90:(.text+0x1a2): undefined reference to `__kmpc_for_static_init_4' ../src/main.f90:(.text+0x2cd): undefined reference to `__kmpc_for_static_fini' [/plain]

0 件の賞賛
6 返答(返信)
TimP
名誉コントリビューター III
1,951件の閲覧回数
You should use ifort -parallel throughout, so that the references to OpenMP and pthread libraries are passed automatically through the linker script.
brunocalado
ビギナー
1,951件の閲覧回数
Quoting - tim18
You should use ifort -parallel throughout, so that the references to OpenMP and pthread libraries are passed automatically through the linker script.

I did it.

I am under linux using eclipse with photran. I enable the option parallel.

But I still getting the same message.
Nuno_S_
ビギナー
1,951件の閲覧回数
Hi I'm having similar problems. I've recently installed the 2013 full pack, and was trying to use Intel's -guide -parallel feature on one of my fortran programs. It compiles perfectly (with flag -parallel ) even with the suggested changes from -guide but when linking (with flag -parallel) it complains and gives the following error messages minim.f:(.text+0x7e6): undefined reference to `__kmpc_global_thread_num' minim.f:(.text+0x809): undefined reference to `__kmpc_ok_to_fork' minim.f:(.text+0x86c): undefined reference to `__kmpc_fork_call' minim.f:(.text+0xad7): undefined reference to `__kmpc_for_static_init_4' minim.f:(.text+0xcdd): undefined reference to `__kmpc_critical' minim.f:(.text+0xd03): undefined reference to `__kmpc_end_critical' minim.f:(.text+0xd10): undefined reference to `__kmpc_for_static_fini' What could be wrong here? How to fix this?
Kevin_D_Intel
従業員
1,951件の閲覧回数
Nuno - are you also using eclipse/photran? What’s wrong is the appropriate OpenMP library was not included in the link. If you are not using eclipse/photran and link using “ld” then the link is lacking the required libs. ld does not understand the -parallel option. The preferred/recommended fix is to use the “ifort” driver with the -parallel option to link (instead of ld) to ensure the appropriate libraries are linked. If you cannot use the ifort driver to link, then include the appropriate libraries with ld. On your ld command line, try including: -Bstatic -lifcoremt -Bdynamic -liomp5 (these are only differences in libs linked by ifort when -parallel is used)
Nuno_S_
ビギナー
1,951件の閲覧回数
disregard my last post. I was rechecking my Makefile and it wasn't calling the -parallel flag on linking. Fixed and linked fine. Testing the program now and it is using more than 1 core. Thanks Intel, this is a very nice feature.
Kevin_D_Intel
従業員
1,951件の閲覧回数
Glad to hear that.
返信