Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
33 Views

Annotation Error undifined subroutine calls Fortran

Compiler Version: icc 16.0.0

Advisor XE Version: 2016

I've added annotations as per the documentation and the tutorials provided with the tools which as follows

use advisor_annotate

call annotate_site_begin( "MySite1" )

call annotate_iteration_task( "MyTask1" )

call annotate_site_end

Compiling it as

mpiifort -O3 -g -I/opt/intel/advisor_xe/include/ -L/opt/intel/advisor_xe/lib64/ -ladvisor  abcd.f90 -o abcd.out

But when I try to do this Compilation error occurs

abcd.f90: In function 'abcd_main:
/home/Test/abcd/src/abcd.f90:undefined reference to 'advisor_annotate_mp_annotate_site_begin_'
/home/Test/abcd/src/abcd.f90:undefined reference to 'advisor_annotate_mp_annotate_iteration_task_'
/home/Test/abcd/src/abcd.f90:undefined reference to 'advisor_annotate_mp_annotate_site_end_'
[abcd.out] Error 1

 

 

0 Kudos
1 Reply
Highlighted
Moderator
33 Views

You need to put your source file before the -ladvisor portion of your compile line.  When linking static libraries, if a function is not needed at the time it is added to the link list, it isn't used.  So the three functions (and everything else in libadvisor.a) will be discarded, because none of them are needed at link time.  If you put your file first, the references it needs are known to the linker, and when those are found, they will be used.

0 Kudos