PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

pgcc fails on ubuntu 12.04 for glob.h
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
EC-HPCS



Joined: 27 May 2011
Posts: 6

PostPosted: Wed Jun 12, 2013 9:16 am    Post subject: pgcc fails on ubuntu 12.04 for glob.h Reply with quote

Hi,

When I try to compile (with pgcc main.c):
Code:

#define _FILE_OFFSET_BITS 64
#include <glob.h>
#include <stdio.h>

int
main(int argc, char **argv) {
   printf("_FILE_OFFSET_BITS (%d)\n", _FILE_OFFSET_BITS);
}


I get:
Quote:

PGC-S-0035-Syntax error: Recovery attempted by replacing ',' by ')' (/usr/include/glob.h: 155)
PGC-S-0037-Syntax error: Recovery attempted by deleting ')' (/usr/include/glob.h: 158)
PGC-S-0082-Function returning array not allowed (/usr/include/glob.h: 158)
PGC-S-0069-Dummy parameter specification not allowed here (/usr/include/glob.h: 158)
PGC-S-0035-Syntax error: Recovery attempted by replacing ',' by ')' (/usr/include/glob.h: 160)
PGC-S-0037-Syntax error: Recovery attempted by deleting ')' (/usr/include/glob.h: 160)
PGC-S-0082-Function returning array not allowed (/usr/include/glob.h: 160)
PGC-S-0069-Dummy parameter specification not allowed here (/usr/include/glob.h: 160)
PGC-S-0043-Redefinition of symbol, __REDIRECT_NTH (/usr/include/glob.h: 160)
PGC-S-0043-Redefinition of symbol, glob64 (/usr/include/glob.h: 166)
PGC-S-0043-Redefinition of symbol, globfree64 (/usr/include/glob.h: 168)
PGC/x86-64 Linux 13.1-1: compilation completed with severe errors


I do not have similar problems with gcc (e.g., v 4.6.3).

Note:

    * the program compiles with pgcc under ubuntu 10.04, however, the glob.h files of 10.04 and 12.04 are different.
    * if the #define is moved after the #include of glob.h, pgcc does not complain. I don't see how this should be necessary, though.
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jun 12, 2013 12:12 pm    Post subject: Reply with quote

Hi EC-HPCS,

The problem is the "__REDIRECT_NTH" macro only gets defined (in src/cdefs.h) if __GNUC__ version > 2. Since we don't define __GNUC__, the macro isn't defined and the compiler intrupts it as a function prototype.

It "worked" before because "glob.h" had a guard to only use "__REDIRECT_NTH" is __GNUC__ > 2. Looks like this guard was removed.

The work around is for you to add "-D__GNUC__=3" to you build. It may cause other errors in your larger code, but does work for this small example.

I'll put in a request to add a definition for "__REDIRECT_NTH" in the cdefs.h file we ship.

- Mat
Back to top
View user's profile
EC-HPCS



Joined: 27 May 2011
Posts: 6

PostPosted: Thu Sep 26, 2013 1:34 pm    Post subject: update/fix/real workaround? Reply with quote

mkcolg wrote:
Hi EC-HPCS,

...

I'll put in a request to add a definition for "__REDIRECT_NTH" in the cdefs.h file we ship.

- Mat


We are still having this problem with the latest release (v13.8) and do not see any fix/change in it. Can I get an update on this issue and a timeframe for a fix?

In the meantime, is there a workaround that I can use for something more than trivial programs?
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Sep 26, 2013 2:19 pm    Post subject: Reply with quote

Hi EC-HPCS,

While I haven't verified it myself, TPR#19413 is fixed in 13.9 which happens to have been released today. Mind trying the new version and see it works for your full production code?

Thanks,
Mat
Back to top
View user's profile
EC-HPCS



Joined: 27 May 2011
Posts: 6

PostPosted: Mon Dec 09, 2013 1:06 pm    Post subject: pgi13.9 does not fix problem Reply with quote

Hi,

I've gotten around to trying out 13.9 and see that the sample code still does not work. What are the prospects of getting it fixed. I'd be surprised if I am the only one.

Thanks,
John
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