[lammps-users] LAMMPS Compiling Problem

hi, Steve and Axel,

I can compile it successfully with gcc under Debian Sid, but failed at RH cluster.

I compare the preprocessed source codes from the both conditions( -E parameter) on RH cluster, and found if “lmptype.h” is put in the top, INT64_MAX will be replaced by 9223372036854775807L, else INT64_MAX still be INT64_MAX. More detailed see attached files.

Help it useful for solving this problem.

Cun Zhang

PS:

Compile with the following command:

icc -O -I/usr/include -I/home_soft/home/lnmzc/soft/fftw-2.1.5/include -I/home_soft/soft/x86_64/mpi/impi/4.0.0.028/intel64/include -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -DFFT_FFTW -E -c create_atoms.cpp

Compile envirenment:

[rh] uname -a Linux LB270210 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:19 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux [rh] icc -v
Version 11.0
[rh]$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: …/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)

lmptypeorderproblem.tar.gz (151 KB)

thanks for the info. this confirms the results of additional tests that i
and others made.
we are discussing solutions that are both portable
and easy to maintain. stay tuned.

in the mean time, try adding

-D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS

to your CCFLAGS and either ignore the warnings or comment out the lines:

#define __STDC_LIMIT_MACROS

and

#define __STDC_FORMAT_MACROS

in lmptype.h as a workaround.

thanks again,
    axel.

Just posted a 15Feb patch that should fix this. The hope
is that these 8-byte data types will now be correctly specified
on all possible platforms, but that is probably too optimistic.

Thanks to Peter and Axel for their help.

Steve