PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

PGI compiler version macro?
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
Bonachea



Joined: 15 Mar 2005
Posts: 6

PostPosted: Thu Mar 30, 2006 5:46 am    Post subject: PGI compiler version macro? Reply with quote

Hi -

I need to programmatically query the Portland Group C compiler version in order to conditionally compile code which uses the new inline assembly support added in version 6.1.

I cannot find a version query macro anywhere in the PGI documentation or verbose compile output - is there a macro hiding somewhere that can be used to check the compiler version? (eg gcc has __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__, etc)

Thanks...
Back to top
View user's profile
brentl



Joined: 20 Jul 2004
Posts: 69

PostPosted: Thu Mar 30, 2006 2:51 pm    Post subject: Reply with quote

No, it doesn't appear that we do. But that's a good idea. I've entered a feature request, and for your tracking purposes, it is TPR 3791
Back to top
View user's profile
Bonachea



Joined: 15 Mar 2005
Posts: 6

PostPosted: Thu Mar 30, 2006 5:14 pm    Post subject: Reply with quote

> No, it doesn't appear that we do. But that's a good idea. I've entered a
> feature request, and for your tracking purposes, it is TPR 3791

Thanks - having that in future versions would definitely be helpful, but it obviously doesn't help me with my immediate problem (especially since I'm trying to detect the difference between 6.1 and releases before 6.1).

Is there any other way to detect from the preprocessor whether I'm using 6.1 or newer? (eg any other random predefined preprocessor tokens that happen to first appear in 6.1?)
Back to top
View user's profile
brentl



Joined: 20 Jul 2004
Posts: 69

PostPosted: Thu May 11, 2006 2:00 pm    Post subject: Reply with quote

In our 6.1-5 compilers, we have now started supporting these version query macros: __PGIC__, __PGIC_MINOR__, and __PGIC_PATCHLEVEL__

Sorry, I can't think of anything right off hand to help with previous compilers...
Back to top
View user's profile
Bonachea



Joined: 15 Mar 2005
Posts: 6

PostPosted: Thu May 11, 2006 3:20 pm    Post subject: Reply with quote

> In our 6.1-5 compilers, we have now started supporting these version
> query macros: __PGIC__, __PGIC_MINOR__, and
> __PGIC_PATCHLEVEL__


Cool - thanks.

> Sorry, I can't think of anything right off hand to help with previous compilers...

I devised the following filthy hack to detect PGI versions supporting the full gcc asm syntax (the critical piece of info I needed):

#include "omp.h"
#if defined(_PGOMP_H)
/* 6.1.1 or newer */
#else
/* 6.0.8 or older */
#endif

I'll definitely use your new version macros in cases where they're available.
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 © 2001, 2002 phpBB Group