PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

gnu c lib log2
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
yjs



Joined: 24 Dec 2005
Posts: 4

PostPosted: Sat Dec 24, 2005 10:19 pm    Post subject: gnu c lib log2 Reply with quote

My program use log2().
pgCC didn't find log2() in math.h.
How to solve this problem?
Back to top
View user's profile
David Norton



Joined: 18 Aug 2004
Posts: 20

PostPosted: Wed Dec 28, 2005 11:02 pm    Post subject: log2 Reply with quote

Hi YJS -

I think you'll find the log2 function in the libm library. If you add -lm to your link line, the compiler driver should find it for you.

-dave
Back to top
View user's profile
yjs



Joined: 24 Dec 2005
Posts: 4

PostPosted: Thu Dec 29, 2005 5:02 am    Post subject: Re: log2 Reply with quote

-lm didn't solve the problem.
log2() comes from c99 according to some book.
Even pgCC use -c9x,nothing change.

David Norton wrote:
Hi YJS -

I think you'll find the log2 function in the libm library. If you add -lm to your link line, the compiler driver should find it for you.

-dave
Back to top
View user's profile
David Norton



Joined: 18 Aug 2004
Posts: 20

PostPosted: Thu Dec 29, 2005 11:55 am    Post subject: Reply with quote

Can you post the compiler/link line and error messages? If you have a pointer to the source, that would be helpful too.
Back to top
View user's profile
yjs



Joined: 24 Dec 2005
Posts: 4

PostPosted: Thu Dec 29, 2005 9:32 pm    Post subject: Reply with quote

"fingers.cc" ,line 45 : error:identifier "log2" is undefined
fingerCount=(int)(ceil(log2(vsEstimateCount)));
^
David Norton wrote:
Can you post the compiler/link line and error messages? If you have a pointer to the source, that would be helpful too.
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
Goto page 1, 2  Next
Page 1 of 2

 
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