Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

-parallel

brunocalado
Beginner
1,115 Views

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 Kudos
6 Replies
TimP
Honored Contributor III
1,115 Views
You should use ifort -parallel throughout, so that the references to OpenMP and pthread libraries are passed automatically through the linker script.
0 Kudos
brunocalado
Beginner
1,115 Views
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.
0 Kudos
Nuno_S_
Beginner
1,115 Views
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?
0 Kudos
Kevin_D_Intel
Employee
1,115 Views
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)
0 Kudos
Nuno_S_
Beginner
1,115 Views
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.
0 Kudos
Kevin_D_Intel
Employee
1,115 Views
Glad to hear that.
0 Kudos
Reply