Project

General

Profile

Bug #529

md5.c does not compile under AIX 6.1

Added by Christoph Junghans about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

source='/u/chrj/opt/adressmacs/with_mpi/../src/gmxlib/md5.c' object='md5.lo' libtool=yes \
depfile='.deps/md5.Plo' tmpdepfile='.deps/md5.TPlo' \
depmode=aix /bin/sh /u/chrj/opt/adressmacs/with_mpi/../config/depcomp \
/bin/sh ../../libtool --mode=compile mpcc_r -q64 -DHAVE_CONFIG_H -I. -I/u/chrj/opt/adressmacs/with_mpi/../src/gmxlib -I../../src -I/u/chrj/opt/adressmacs/with_mpi/../include -DGMXLIBDIR=\"/u/chrj/opt/gromacs/adress2010-08-27/share/top\" -I/usr/local/include -O3 -qhot -qstrict -qarch=pwr6 -qtune=pwr6 -qcpluscmt -c -o md5.lo /u/chrj/opt/adressmacs/with_mpi/../src/gmxlib/md5.c
mpcc_r -q64 -DHAVE_CONFIG_H -I. -I/u/chrj/opt/adressmacs/with_mpi/../src/gmxlib -I../../src -I/u/chrj/opt/adressmacs/with_mpi/../include -DGMXLIBDIR=\"/u/chrj/opt/gromacs/adress2010-08-27/share/top\" -I/usr/local/include -O3 -qhot -qstrict -qarch=pwr6 -qtune=pwr6 -qcpluscmt -c -M /u/chrj/opt/adressmacs/with_mpi/../src/gmxlib/md5.c -o md5.o
"/u/chrj/opt/adressmacs/with_mpi/../src/gmxlib/md5.c", line 179.5: 1506-294 (S) Syntax error in expression on #if directive.
"/u/chrj/opt/adressmacs/with_mpi/../src/gmxlib/md5.c", line 189.5: 1506-294 (S) Syntax error in expression on #if directive.
"/u/chrj/opt/adressmacs/with_mpi/../src/gmxlib/md5.c", line 199.5: 1506-294 (S) Syntax error in expression on #if directive.
"/u/chrj/opt/adressmacs/with_mpi/../src/gmxlib/md5.c", line 215.5: 1506-294 (S) Syntax error in expression on #if directive.
"/u/chrj/opt/adressmacs/with_mpi/../src/gmxlib/md5.c", line 218.5: 1506-294 (S) Syntax error in expression on #if directive.

It seems like xlc does not understand '#if' integer comparisons.
I looked it up in xlc manual, see url above, and found nothing about comparisons.

History

#1 Updated by Roland Schulz about 9 years ago

Can you please test whether xlc accepts it if the comparison expression is in parenthesis?

Or do you also get this error in other files. E.g. because of:
gmx_system_xdr.h:#if (INT_MAX 2147483647)
vec.h:#if (GMX_POWERPC_SQRT2)

#2 Updated by Christoph Junghans about 9 years ago

you are right - simple example

$cat main.c
#define BYTE_ORDER 0
#if BYTE_ORDER == 0
#warning = works
#endif
#undef BYTE_ORDER
#define BYTE_ORDER 1
#if BYTE_ORDER => 0
#warning > works
#undef BYTE_ORDER
#define BYTE_ORDER -1
#endif
#if BYTE_ORDER <= 0
#warning < works
#endif
int main(){
return 0;
}
$xlc main.c
"main.c", line 3.2: 1506-948 (W) #warning = works
"main.c", line 7.16: 1506-294 (S) Syntax error in expression on #if directive.

I think it just has problems with => and <=, because < and > works.

#3 Updated by Roland Schulz about 9 years ago

I committed a change for these #if. Please test whether that fixes it.

#4 Updated by Erik Lindahl about 9 years ago

PS Roland: You might have seen that I committed a couple of lines to set the architecture endian based on the endian settings in config.h (which we check at configure time) - please adjust/revert if I did something stupid...

#5 Updated by Roland Schulz about 9 years ago

Erik thanks for mentioning it. No I hadn't seen that.

This was the cause of this error. ARCH_IS_BIG_ENDIAN has to be 0 or 1 not defined or not defined.

Christoph could you check that it is now OK? I think the error had nothing to do with xlc but with big endian. Thus I reverted my earlier attempt of fixing the bug.

#6 Updated by Christoph Junghans about 9 years ago

It compiles, thanks

Also available in: Atom PDF