PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

CUDA FORTRAN: Undefined reference to `randomgpu__entry'

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
tom.rb.edwards



Joined: 02 Dec 2010
Posts: 35

PostPosted: Sun Feb 13, 2011 9:38 am    Post subject: CUDA FORTRAN: Undefined reference to `randomgpu__entry' Reply with quote

I've been trying to use the mersenne twister parallel random number generator in CUDA Fortran, by interfacing to the CUDA C implementation as instructed from PGI insider: http://www.pgroup.com/lit/articles/insider/v2n1a4.htm.

I downloaded the source code, loaded the pgi 10.8 module in linux, and tried to build the code by typing 'make' in the terminal. It did fine for a bit, then came up with this error:

Code:
/home/theory/phrkaj/Projects/pgi_mc_example/./src/mcCUF_5.F90:146: undefined reference to `randomgpu__entry'
make: *** [mcCUF_5.out] Error 2


It's probably got something to do with the ISO_C_BINDING, since nvcc adds '__entry' to the end of the function name. Any thoughts on how to fix this?

Thanks in advance
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Feb 14, 2011 10:20 am    Post subject: Reply with quote

Hi Tom,
Quote:

It's probably got something to do with the ISO_C_BINDING, since nvcc adds '__entry' to the end of the function name. Any thoughts on how to fix this?
Most likely. NVIDIA has a tendency to change their symbol names from release to release. Use the 'nm' utility on the Mersenne Twister object file ('nm obj/MersenneTwister_kernel.o') to see what they've called the entry function. Next, change the C binding name to match.

Hope this helps,
Mat
Back to top
View user's profile
tom.rb.edwards



Joined: 02 Dec 2010
Posts: 35

PostPosted: Tue Feb 15, 2011 3:41 am    Post subject: Reply with quote

Quote:
Use the 'nm' utility on the Mersenne Twister object file ('nm obj/MersenneTwister_kernel.o') to see what they've called the entry function. Next, change the C binding name to match.


Thanks a bunch! In the article, it was assumed that '__entry' would be appended to the end of a function name in CUDA. I guess that's not the case anymore. All I had to do was replace 'randomgpu__entry' with 'randomgpu' in the mcCUF_5.f90 source code.

Cheers
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