Problem with building colvars/lammps as a shared library

Dear Axel,

I was compiling LAMMPS (your most recent developmental version from git) as a shared library that included the colvars package.

When I tried loading the lammps.so library like so, I received the following error:

from ctypes import CDLL
CDLL(“liblammps.so”)
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/pacerepov1/python/2.7/lib/python2.7/ctypes/init.py”, line 365, in init
self._handle = _dlopen(self._name, mode)
OSError: /nv/pj1/rverploegh3/LAMMPS/lammps-icms/src/liblammps.so: undefined symbol: _ZN12colvarmodule8rotation18crossing_thresholdE

I am assuming that the problem is the undefined symbol but I am not sure how to fix it.
undefined symbol: _ZN12colvarmodule8rotation18crossing_thresholdE

The most recent LAMMPS version I had been using was Feb.2015, and I did not encounter this error then.

If you need any more information, let me know.

Best regards,

Ross

Dear Axel,

I was compiling LAMMPS (your most recent developmental version from git) as
a shared library that included the colvars package.

When I tried loading the lammps.so library like so, I received the following
error:

from ctypes import CDLL
CDLL("liblammps.so")

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/pacerepov1/python/2.7/lib/python2.7/ctypes/__init__.py",
line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /nv/pj1/rverploegh3/LAMMPS/lammps-icms/src/liblammps.so: undefined
symbol: _ZN12colvarmodule8rotation18crossing_thresholdE

I am assuming that the problem is the undefined symbol but I am not sure how
to fix it.
undefined symbol: _ZN12colvarmodule8rotation18crossing_thresholdE

The most recent LAMMPS version I had been using was Feb.2015, and I did not
encounter this error then.

did you recompile the colvars library after updating the sources with git?
there were changes to it in a recent commit and those could trigger an
error message like this.

axel.

Axel,

Yes I did, just this morning. My compilation (both the libcolvars.a and the liblammps.so) did not throw any errors, which is why I am puzzled.

The flags in my colvars make file are: (probably not helpful)
CXX = mpic++
CXXFLAGS = -O3 -ip -no-prec-div -fPIC # -DCOLVARS_DEBUG
ARCHIVE = ar
ARCHFLAG = -rc
SHELL = /bin/sh
SHFLAGS = -fPIC

Regards,

Ross

Axel,

Yes I did, just this morning. My compilation (both the libcolvars.a and the liblammps.so) did not throw any errors, which is why I am puzzled.

i am having no problems linking with the static library and i didn't
see a problem during the last set of building RPMS (which includes
RPMs with the python module).
you did a "make pu" / "make package-update" after pulling from git in
the main directory, too, right?
i'm trying to build manually on my machine now to double check.

more later,
     axel.

Axel,

Yes I did the package update. I cloned your most recent version this morning to a new folder.

I run the following build script from the lammps-icms directory:

Axel,

Yes I did the package update. I cloned your most recent version this morning to a new folder.

well, it works for me. it don't see any obvious mistakes in what you
tell me, so i don't know what is going wrong.

axel.

Axel,

I was using an old make file...

It builds just fine now.

Best regards,

Ross