[lammps-users] lammps and AIX, pppm.cpp fix

Dear all,

to compile lammps on an AIX, my system administrator helped me out and noted that in pppm.cpp there is a variable hz, which the xlc compiler substitutes to ‘100’, for some complicated but probably highly logical reason. Compilation stops there, logically :wink:

changing the name just in that file to h_z solves the issue. Since changing makes compilation on AIX easier and doesn’t make lammps less likely to compile on other systems, shall I submit a simple patch?

Greetings, Pim Schravendijk

This rings a long-ago bell, about some stupid setting in AIX system header
files that redefines "hz", so that user code can't use that variable name.
My recollection is that the solution is to use a compiler -U switch
to unset what the system header file has done. If this doesn't make
sense, ask your sys admin about it.

And send an email to IBM, telling them how dumb this is.

Steve

This rings a long-ago bell, about some stupid setting in AIX system header
files that redefines "hz", so that user code can't use that variable name.
My recollection is that the solution is to use a compiler -U switch
to unset what the system header file has done. If this doesn't make
sense, ask your sys admin about it.

And send an email to IBM, telling them how dumb this is.

which will have _no_ impact at all. this is IBM and they
are going to be compatible to all their sins dating back
to the stone age.

i had the same issue with MPI calls dereferencing NULL pointers
on messages that had a length of 0 on BG/L. all other MPI
implementations did the reasonable thing and not even look at 0
length data, IBM's MPI gave a nice segfault and hasn't been
fixed since. i saw this pop up on several mailing lists over time...

cheers,
   axel.

Pim - found the old thread on this problem:
lammps.sandia.gov/threads/thread.1281.html
which includes a work-around from Axel.

Good to see Axel hasn't mellowed any in the
intervening time ...

Steve