Linking error with parallelization

Linking error with parallelization

Hi there,

I have got the following linking error when Ihave addedtwo lines, "#pragma omp parallel for"on top of two differentfor-loops. The switches "/Qipo /Qopenmp" are on. If I remove the lines described above, the linking errors will not appear.

IPO compilation(0): warning #1201: too many functions; disabling COMDAT function packaging

xilink: executing 'link'

LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification

35763.obj : error LNK2001: unresolved external symbol ___kmpc_global_thread_num

35763.obj : error LNK2001: unresolved external symbol ___kmpc_for_static_init_4

35763.obj : error LNK2001: unresolved external symbol ___kmpc_for_static_fini

35763.obj : error LNK2001: unresolved external symbol ___kmpc_ok_to_fork

35763.obj : error LNK2001: unresolved external symbol ___kmpc_fork_call

35763.obj : error LNK2001: unresolved external symbol ___kmpc_serialized_parallel

35763.obj : error LNK2001: unresolved external symbol ___kmpc_end_serialized_parallel

PaintStudioRelease.exe : fatal error LNK1120: 7 unresolved externals

Does anybody know why?

Regards,

Kennant

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Dear Kennant,

First thing I would try is just -openmp by itself. Remove -ipo from the command line and see if it works.

Second, I would make sure icc is being used as the linker and make sure -ipo and -openmp are on the link command line.

Try those two suggestions and let me know how it works.

Regards,

Max

Hi Max,

I have tried your first suggestion and I still get linking errors like the following.

error LNK2019: unresolved external symbol ___kmpc_global_thread_num

error LNK2019: unresolved external symbol ___kmpc_for_static_init_4

error LNK2019: unresolved external symbol ___kmpc_for_static_fini

error LNK2019: unresolved external symbol ___kmpc_ok_to_fork

error LNK2019: unresolved external symbol ___kmpc_fork_call

error LNK2019: unresolved external symbol ___kmpc_serialized_parallel

error LNK2019: unresolved external symbol ___kmpc_end_serialized_parallel

I don't quite understand your second suggestion. I would assume that the ICC linkerwas beingused sincethe code wascompiled with ICC already. The linker doesn't recognize the "-openmp" switch.

Regards,

Kennant

Dear Kennant,

These functions are defined in the library libguide which is in our compiler's lib directory. This library must be linked into your code at link time. I believe if the -openmp switch is specified on the link command line, the library should be linked in automatically.

What are the command lines you are using for compilation and linking?

Is your link step separate from your compiler step? If so and you've made sure -openmp (or -lguide) is on the link command line, I'm not sure what else to try.

Regards,

Max

Leave a Comment

Please sign in to add a comment. Not a member? Join today