PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

PGC-S-0240-Unmatched #endif

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



Joined: 01 Feb 2006
Posts: 2

PostPosted: Fri Feb 15, 2013 3:21 pm    Post subject: PGC-S-0240-Unmatched #endif Reply with quote

Hello,

I have to compile libpng (libpng-1.5.14) which is required for WRF. I end up on this error:

make all-am
make[1]: Entering directory `/home/wrfcomp/WRF.3.4.1.ARW.pgi/libpng-1.5.14'
source='png.c' object='libpng15_la-png.lo' libtool=yes \
DEPDIR=.deps depmode=pgcc /bin/sh ./depcomp \
/bin/sh ./libtool --tag=CC --mode=compile pgcc -DHAVE_CONFIG_H -I. -DPNG_CONFIGURE_LIBPNG -g -c -o libpng15_la-png.lo `test -f 'png.c' || echo './'`png.c
libtool: compile: pgcc -DHAVE_CONFIG_H -I. -DPNG_CONFIGURE_LIBPNG -g -c png.c -MD -fpic -DPIC -o .libs/libpng15_la-png.o
PGC-S-0240-Unmatched #endif (./pngpriv.h: 1740)
PGC/x86-64 Linux 13.1-1: compilation completed with severe errors

I checked the .h and i can't find any unmatched #endif

Neither gcc/gfortran (4.4.6) or intel (13.0.1) fail on this compilation.

Plateform is linux centos 6.2 x64

Any idea ?

Regards,

Arnaud
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Feb 15, 2013 5:03 pm    Post subject: Reply with quote

Hi Arnaud,

The problem here has to do with how the file "pnglibconf.h" is getting generated. Our preprocessor will put a space between a "*" and "/" unless it's the end of a comment. The authors aren't expecting this, hence when they preprocess the following line from "scripts/pnglibconf.dfa"
Code:
PNG_DEFN_MAGIC-/PNG_JOIN*  pnglibconf.h - library build configuration */-PNG_DEFN_END

our preprocessor can't tell "/PNG_JOIN*" is the beginning of a comment, so adds the space between the end "*" and "/". Of course, this causes the compile error since the comment doesn't get closed and the whole file becomes one big comment. This then cascades into the error you see.

The work around is to use "cpp" to pre-process this file by setting the environment variable "CPP=cpp" before running configure.

Hope this helps,
Mat
Back to top
View user's profile
arns



Joined: 01 Feb 2006
Posts: 2

PostPosted: Fri Feb 15, 2013 5:14 pm    Post subject: Reply with quote

Thanks for the quick answer. I will try to report back to libpng people and try to find a fix.

Thanks.

Arnaud
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