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

openmp linking problems

askar
Beginner
857 Views
Hello all,
i am trying to compile a f90 code with ifc compiler using -openmp. The command line that i use for compilation is
"-O3 -align dcommons -align sequence -arch host -tune host -openmp -fpp2".
The compilation of the each subroutine of the code is ok but i keep getting the following error messages during linking :
undefined reference to `__kmpc_for_static_fini'
undefined reference to `omp_in_parallel_'
undefined reference to `__kmpc_end_serialized_parallel'
undefined reference to `omp_get_max_threads_'
undefined reference to `getarg_'
undefined reference to `__kmpc_for_static_init_4'
undefined reference to `kmp_set_stacksize_'
undefined reference to `iargc_'
undefined reference to `__kmpc_serialized_parallel'
undefined reference to `__kmpc_fork_call'
undefined reference to `__kmpc_global_thread_num'
undefined reference to `__kmpc_ok_to_fork'
Any help is appreciated.Thanks.
Andreas
0 Kudos
3 Replies
TimP
Honored Contributor III
857 Views
You must either use
ifc -openmp
as the link command, or supply -lguide as an argument, if you use gcc or ld as the link command.
You won't get anywhere without using one of the programs ifc, ifort, gcc, ld... as the link command.
0 Kudos
askar
Beginner
857 Views
Thanks for your reply.
Of course i use the ifc command. I ommited it in the command line posted, because i use a makefile for the compilation and this command line is pasted from there. Nevertheless the ifc command is already set in the Makefile.
Do you haveanother idea?
0 Kudos
TimP
Honored Contributor III
857 Views
It looks like you are not linking against the OpenMP library libguide.a, or the "portability" library.

The function references you quote should be resolved in the link, if the options -Vaxlib and -openmp are included in the ifc link command line.
0 Kudos
Reply