PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Relocation error with -Mprof

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Christopher Hulbert



Joined: 01 Dec 2005
Posts: 76

PostPosted: Tue Aug 28, 2012 8:07 am    Post subject: Relocation error with -Mprof Reply with quote

I'm trying to compile a shared library with profiling enabled, however I get relocation errors despite compiling with -fPIC. The problem seems to be the profiling flag (-Mprof=func). Is it possible to include profiling with shared libraries?

[chulbert@fourier tmp]$ cat junk.f90
module a
contains
subroutine a_foo()
end subroutine
end module

subroutine b()
end subroutine
[chulbert@fourier tmp]$ cat junk.c
void a(void)
{
}
[chulbert@fourier tmp]$ pgfortran -V

pgfortran 12.3-0 64-bit target on x86-64 Linux -tp nehalem
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2012, STMicroelectronics, Inc. All Rights Reserved.
[chulbert@fourier tmp]$ pgfortran -fPIC -shared -Mprof=func junk.f90
/usr/bin/ld: /tmp/pgfortranFP7DzlQHdvu.o: relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
/tmp/pgfortranFP7DzlQHdvu.o: could not read symbols: Bad value
[chulbert@fourier tmp]$ pgcc -fPIC -shared -Mprof=func junk.c
/usr/bin/ld: /tmp/pgccu-88MyhhPob.o: relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
/tmp/pgccu-88MyhhPob.o: could not read symbols: Bad value
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6129
Location: The Portland Group Inc.

PostPosted: Wed Aug 29, 2012 8:55 am    Post subject: Reply with quote

Hi Chris,

Right now we don't support instrumented profiling within FPIC code. We have a old open feature request for it (TPR#14852) but it doesn't look like it was ever given a high enough priority to implement. I have a mail into the Compile Engineering Manager to see what can be done.

Before I push on engineering, can you see if use the sample based profiler, pgcollect, would work for you? pgcollect does not require the code to instrumented and is capable of profiling all parts of your program, including shared libraries.

Best Regards,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group