PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

libpng-1.6.9 fails to compile with PGI 14.3 and 14.1

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



Joined: 07 Jun 2007
Posts: 5

PostPosted: Wed Mar 12, 2014 10:24 am    Post subject: libpng-1.6.9 fails to compile with PGI 14.3 and 14.1 Reply with quote

I've gotten the following errors when compiling libpng-1.6.9

The error occurs in pngvalid.c

Code:

pgcc -DHAVE_CONFIG_H -I.   -DNDEBUG -DpgiFortran   -Msignextend  -c -o contrib/libtests/pngvalid.o contrib/libtests/pngvalid.c
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0037-Syntax error: Recovery attempted by deleting keyword if (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-S-0025-Illegal character: '\43' (contrib/libtests/pngvalid.c: 6784)
PGC-F-0008-Error limit exceeded (contrib/libtests/pngvalid.c: 6784)
PGC/x86-64 Linux 14.3-0: compilation aborted
make[1]: *** [contrib/libtests/pngvalid.o] Error 2
make[1]: Leaving directory `/usr/local/libpng-1.6.9'
make: *** [all] Error 2


and seems to center around this line block
Code:

         that->pm->limit += pow(
#           if PNG_MAX_GAMMA_8 < 14
               (that->this.bit_depth == 16 ? 8. :
                  6. + (1<<(15-PNG_MAX_GAMMA_8)))
#           else
               8.
#           endif
               /65535, data.gamma);
      }


And "whack-a-moling" this by commenting out the # if loop will cause a similar error to happen down later in the code.

E.g.,
Code:

    that->pm->limit += pow(
#           if DIGITIZE
               1.1
#           else
               1.
#           endif
               /255, data.gamma);
      }
   }



Ideas?

Thanks
Bill
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Mar 12, 2014 11:27 am    Post subject: Reply with quote

Hi Bill,

The problem is that "pow" is getting preprocessed into "__builtin_pow". Keeping the pre-processed file (-P) shows the line gets turned into:
Quote:
that -> pm -> limit += __builtin_pow ( # if 11 < 14 ( that -> this . bit_depth == 16 ? 8. : 6. + ( 1 << ( 15 - 11 ) ) ) # else 8. # endif / 65535 , image_transform_data_rgb_to_gray . gamma ) ;
Hence the syntax error with the "#"s and "if". The fix is to add the flag "-Mnobuiltin" to CFLAGS and the generic libm pow will be used.

Hope this helps,
Mat
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