[lammps-users] build lammps with MEAM package

Hello everyone,

I’m trying to build lammps with the MEAM package. I followed the instructions on the LAMMPS documentation, and first I built the library libmeam.a in the lammps/lib/meam directory (using ifort). I then modified my Makefile in the LAMMPS src directory to include a link to the library:

LINKFLAGS = -O -L/home/jasanc2/lammps-24Sept07/lib/meam
USRLIB = -lmeam -lstdc++

however, when I compiled the code I get multiple errors like this one:

/home/jasanc2/lammps-24Sept07/lib/meam/libmeam.a(meam_setup_done.o)(.text+0x7c2): In function compute_pair_meam_': undefined reference to for_check_mult_overflow64’

/home/jasanc2/lammps-24Sept07/lib/meam/libmeam.a(meam_setup_done.o)(.text+0x130b): In function compute_pair_meam_':undefined reference to for_write_seq_lis’

There’s a section in the documentation that says: “Note that linking a Fortran library to a C++ code can be problematic (e.g. Fortran routine names can’t be found due to non-standard underscore rules) and typically requires additional C++ or F90 libraries be included in the link. You may need to read documentation for your compiler about how to do this correctly.”

I think this might be the source of the error I’m getting and I was wondering if anyone had come across this and could give me any suggestions.

thanks
Jaime Sanchez

Hello everyone,

I'm trying to build lammps with the MEAM package. I followed the
instructions on the LAMMPS documentation, and first I built the library
libmeam.a in the lammps/lib/meam directory (using ifort). I then modified my
Makefile in the LAMMPS src directory to include a link to the library:

LINKFLAGS = -O -L/home/jasanc2/lammps-24Sept07/lib/meam
USRLIB = -lmeam -lstdc++

however, when I compiled the code I get multiple errors like this one:

/home/jasanc2/lammps-24Sept07/lib/meam/libmeam.a(meam_setup_done.o)(.text+0x7c2):
In function `compute_pair_meam_': undefined reference to
`for_check_mult_overflow64'

/home/jasanc2/lammps-24Sept07/lib/meam/libmeam.a(meam_setup_done.o)(.text+0x130b):
In function `compute_pair_meam_':undefined reference to `for_write_seq_lis'

jaime,

you are missing to provide the library with the functions needed
by the intel fortran runtime (-lifcore). see my mail to this
list of about 10 days ago in the source forge mailing list archives.

There's a section in the documentation that says: "Note that linking a
Fortran library to a C++ code can be problematic (e.g. Fortran routine names
can't be found due to non-standard underscore rules) and typically requires
additional C++ or F90 libraries be included in the link. You may need to
read documentation for your compiler about how to do this correctly."

I think this might be the source of the error I'm getting and I was
wondering if anyone had come across this and could give me any suggestions.

yes, you are right. the suggestion in the manual to read the
fortran compiler documentation is actually a pretty good one
already. searching through the mailing list archive or using
google, should have told you at least, that you are not the
first person with this problem. ;-))

cheers,
   axel.

Hi Axel,

thank you for the suggestions. I was able to make lammps with the MEAM package and run the examples given in lammps.

Jaime