I've had some recent trouble with the library interface, which can be
reproduced via the following code (call this "test.c"):
/***** BEGIN CODE */
#include <stdio.h>
#include <library.h>
int main (int argc, char** argv) {
void *lmp;
lammps_open_no_mpi(argc, argv, &lmp);
lammps_file (lmp, "in.test1");
lammps_file (lmp, "in.test2");
lammps_close (lmp);
}
/***** END CODE */
The contents of in.test1 and in.test2 are the single lines
print "HELLO!"
and
print "HELLO AGAIN!"
respectively.
I tested this on my SVN checkout and on a brand new build from today's
tarball (version from 22-Mar-2013); both segfault during the read of the
second file. I tried a version from 21-Nov-2013 and another from
14-Mar-2013, and didn't get the same problem, though those ARE using a
different machine and complier.
It only seems to be a problem when the SECOND file is read; I can do
other things through the library interface (lammps_command, for example)
without problems, and the first lammps_file call goes smoothly and doesn't
mess anything up.
Compiling steps:
make stubs
make makelib
make -f Makefile.lib serial
gcc -c -I$LAMMPS_SRC/STUBS test.c
g++ test.o $LAMMPS_SRC/STUBS/libmpi_stubs.a \
$LAMMPS_SRC/liblammps_serial.a -lfftw3
Suggestions are welcome!
Karl D. Hammond
University of Tennessee, Knoxville
[email protected]...
"You can never know everything, and part of what you know is always
wrong. A portion of wisdom lies in knowing that. A portion of courage
lies in going on anyway."
"Nothing ever goes as you expect. Expect nothing, and you will not be
surprised."