| View previous topic :: View next topic |
| Author |
Message |
Bonachea
Joined: 15 Mar 2005 Posts: 6
|
Posted: Thu Mar 30, 2006 5:46 am Post subject: PGI compiler version macro? |
|
|
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 |
|
 |
brentl
Joined: 20 Jul 2004 Posts: 69
|
Posted: Thu Mar 30, 2006 2:51 pm Post subject: |
|
|
| 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 |
|
 |
Bonachea
Joined: 15 Mar 2005 Posts: 6
|
Posted: Thu Mar 30, 2006 5:14 pm Post subject: |
|
|
> 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 |
|
 |
brentl
Joined: 20 Jul 2004 Posts: 69
|
Posted: Thu May 11, 2006 2:00 pm Post subject: |
|
|
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 |
|
 |
Bonachea
Joined: 15 Mar 2005 Posts: 6
|
Posted: Thu May 11, 2006 3:20 pm Post subject: |
|
|
> 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 |
|
 |
|