答复: Need Help: upgrade to the latest LAMMPS, Compiling Errors

Dear Liu,

write_restart.o xdr_compat.o -lreax -lpoems -lmeam -lmpich -lmpl -lpthread -lfftw3 -ljpeg -lvoro++
-lgfortran -lgfortran

why are there two -lgfortran?

And, It is possible that the old version is compiled fine but the new version is not.

because there are some changes in the new version.

so you should look for other reasons. I guess that the required lib can not be found or the libs you use are inconsistent with each other.

I mean one lib is compiled by compiler 1, the other lib is compiled by compiler 2.

Good luck

Lan

-o …/lmp_g++
/usr/local/lib/libmpich.a(ad_iwrite.o): In function ADIOI_GEN_aio_wait_fn': ad_iwrite.c:(.text+0x12a): undefined reference to aio_suspend64’
ad_iwrite.c:(.text+0x1d8): undefined reference to aio_error64' ad_iwrite.c:(.text+0x1f1): undefined reference to aio_return64’
/usr/local/lib/libmpich.a(ad_iwrite.o): In function ADIOI_GEN_aio_poll_fn': ad_iwrite.c:(.text+0x2de): undefined reference to aio_error64’
ad_iwrite.c:(.text+0x30d): undefined reference to aio_return64' /usr/local/lib/libmpich.a(ad_iwrite.o): In function ADIOI_GEN_aio’:
ad_iwrite.c:(.text+0x494): undefined reference to aio_write64' ad_iwrite.c:(.text+0x501): undefined reference to aio_read64’
collect2: ld returned 1 exit status
make[1]: *** […/lmp_g++] Error 1
make[1]: Leaving directory `/home/qi/lammps/src/Obj_g++’
make: *** [g++] Error 2

In fact, this message has nothing to do with LAMMPS, But I do not understand that under the same condition, I compile the old one, there is no error, then new one, errors come.

I will try to compile, too. My machine is different from yours, so I try to solve it by myself, first. Thanks again.

Dear Liu,

write_restart.o xdr_compat.o -lreax -lpoems -lmeam -lmpich -lmpl -lpthread
-lfftw3 -ljpeg -lvoro++
-lgfortran -lgfortran

why are there two -lgfortran?

this is harmless and will happen, e.g. if two packages are installed
that both use a library written in fortran for low-level work..

And, It is possible that the old version is compiled fine but the new
version is not.
because there are some changes in the new version.
so you should look for other reasons. I guess that the required lib can not
be found or the libs you use are inconsistent with each other.
I mean one lib is compiled by compiler 1, the other lib is compiled by
compiler 2.

this is not the case here either. there is an aio library for
interfacing the asynchronous i/o facilities in the linux kernel. that
just needs to be linked to. this whole mess won't happen in the first
place, if people would be using the mpi compiler wrappers that add
those automatically, instead of having to second guess what low-level
libraries MPICH is requiring.

axel

Hello all, I have solve that problem, just modify the Makefile.g++.

Original:

MPI library, REQUIRED

see discussion in doc/Section_start.html#2_2 (step 5)

can point to dummy MPI library in src/STUBS as in Makefile.serial

INC = path for mpi.h, MPI compiler settings

PATH = path for MPI library

LIB = name of MPI library

MPI_INC = -DMPICH_SKIP_MPICXX
MPI_PATH =
MPI_LIB = -lmpich -lmpl -lpthread

Modified:
MPI_LIB = -lmpich -lrt -lmpl -lpthread

Just add “-lrt”, I see a page in Chinese about dispaly card. You can have a look.
Thanks all.

http://wzw19191.blog.163.com/blog/static/1311354702009926105421341/

BTW: It is suggested to add “/lib64/” (Where is your libaio.so.* in) to file "/etc/ld.so.conf
", then ldconfig as root, too. Thanks all.

BTW:

If I add openKIM to compile, a new error appears:

g++ -O -DLAMMPS_GZIP -DLAMMPS_JPEG -I…/…/lib/reax -I…/…/lib/poems -DLMP_MPIIO -I…/…/lib/meam -DMPICH_SKIP_MPICXX -DFFT_FFTW3 -I/home/qi/openkim-api-v1.3.1/KIM_API -I/usr/local/include/voro++ -c …/pair_kim.cpp
…/pair_kim.cpp: In member function ‘void LAMMPS_NS::PairKIM::set_kim_model_has_flags()’:
…/pair_kim.cpp:1010:34: error: expected primary-expression before ‘;’ token
(kimerror == KIM_STATUS_OK)<;
^
make[1]: *** [pair_kim.o] Error 1
make[1]: Leaving directory `/home/qi/lammps-1Feb14/src/Obj_g++’
make: *** [g++] Error 2

I have a look at file pair_kim.cpp, ana compare it. In old versions, there is no “<”.
Anyone who can help me about this?

BTW:

If I add openKIM to compile, a new error appears:

g++ -O -DLAMMPS_GZIP -DLAMMPS_JPEG -I../../lib/reax -I../../lib/poems
-DLMP_MPIIO -I../../lib/meam -DMPICH_SKIP_MPICXX -DFFT_FFTW3
-I/home/qi/openkim-api-v1.3.1/KIM_API -I/usr/local/include/voro++ -c
../pair_kim.cpp
../pair_kim.cpp: In member function 'void
LAMMPS_NS::PairKIM::set_kim_model_has_flags()':
../pair_kim.cpp:1010:34: error: expected primary-expression before ';' token
      (kimerror == KIM_STATUS_OK)<;
                                  ^
make[1]: *** [pair_kim.o] Error 1
make[1]: Leaving directory `/home/qi/lammps-1Feb14/src/Obj_g++'
make: *** [g++] Error 2

I have a look at file pair_kim.cpp, ana compare it. In old versions, there
is no "<".
Anyone who can help me about this?

what is there to help. this is an obvious typo.

axel

O, I know. Thank you all.

just delete the char. Somehow it must have crept in
by accident. An update will be in the next patch.

Steve