-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libsonata wheels do not mix well with non-wheel NEURON #273
Comments
We have an internal ticket with something similar (NSETM-2167). My diagnosis, at the time, was conflicting c++ implementations of
This also comes up on the order neuron is loaded vs libsonata; see NSETM-2167 above.
Could you describe this more? Perhaps using I'd really like to have this work more cleanly; however, I'm not sure what a good course of action is: I'd prefer to stick with As for hdf5, I think we compiled it statically at some point, with a newer version, but that would cause problems if someone was loading h5py if my memory serves - however, I could be wrong. |
I don't immediately know why we see symbols for the C++11 ABI I was being a bit sloppy with I believe the See also: neuronsimulator/nrn#1963 for more discussion of related issues causing problems in NEURON. My interpretation of this is that the implementation of re: future plans:
Regarding |
After some helpful extra explanations from @olupton; I have finally seen the light.
Probably the best we can do is augment the github actions to also build wheels w/ The BB5 case is special; it only has |
Not sure there's anything else we can do but produce I'm going to close this now, @olupton if you have any other ideas, let me know and we can reopen. Thanks. |
Hello, in case it will be useful: the wheel NEURON also triggers the issue. I am on an Ubuntu 22.04 with pip installed NEURON and libsonata. ❯ which nrnivmodl
/home/tuncel/.virtualenvs/py311-bluecellulab/bin/nrnivmodl
❯ pip list | grep NEU
NEURON 8.2.2
❯ pip list | grep libson
libsonata 0.1.22 Output:
|
Can you check whether pip is resolving to: The latter will be needed if you're using NEURON 8.2.2, based on: https://pypi.org/project/NEURON/#files |
Ah, ok. I have the former. PATH_TO_VENV/lib/python3.11/site-packages/libsonata-0.1.22.dist-info |
Yeah, the libc versions of 2.28 and 2.17 are incompatible; since you're on a new Ubuntu, pip will try and install the 2.28 wheels, but since none exist for NEURON, you're getting a mismatch. It's hacky, but it should work, to install the libsonata 2.17 wheel. |
Not sure we'll come to a better conclusion on this, so I'll close it. |
It seems that mixing
libsonata
frompip install libsonata
with aneuron
that was built with a standard (i.e. not-manylinux) toolchain leads to problems.See, for example, on BB5, where
module load neuron
is a Spack-built non-wheel NEURON installation:crashes with a backtrace
If we
pip install neuron
orpip install neuron-nightly
instead, it doesn't crash.@WeinaJi can provide more details on the original/full example, where the symptom was a
std::bad_alloc
, but it appears that the underlying issue is the same as in the above example.We suspect this is the same issue as https://stackoverflow.com/questions/51382355/stdregex-and-dual-abi#comment89745113_51385122; both libsonata and NEURON use
std::regex
, and in the problematic configuration thenlibsonata
is built in amanylinux
image with the old pre-C++11std::string
ABI, while NEURON is built in a standard toolchain with the C++11std::string
ABI. We found that building NEURON with the old ABI (-D_GLIBCXX_USE_CXX11_ABI=0
) made the issue go away and, as noted above, using a NEURON wheel (which also uses the pre-C++11 ABI thanks tomanylinux
the issue is also not seen.I also note that, taking the reproducer from the stackoverflow link, whether I get a segfault or a
std::bad_alloc
depends on which way around I linknew.o
andold.o
.Secondly, if we try to mitigate the above by using both
libsonata
andneuron
frommanylinux
wheels (or by forcing the old ABI when building NEURON), there is a problem with the HDF5 version.libsonata
bundles a version inside its wheel, but this appears to just be a shared library rather than a full installation that one can build against. This means that if one wants to build a.mod
file that needs to be linked against HDF5 (e.g. via libsonatareport) then it is necessary to build/link against some other HDF5, but this will then fail at runtime if the "other" HDF5 does not match the bundled version inlibsonata
.Needless to say, trying to have two different copies of a library like libhdf5.so in flight at the same time in the same executable does not seem like a good idea. Given that the wheels mangle library names, it seems like it's probably fragile even if the version numbers of hdf5 are the same in both cases. Tangentially related: #115.
[I experimented a bit with https://gcc.gnu.org/wiki/Visibility to see those features were sufficient to insulate libsonata and neuron from each other w.r.t. the above issues, but I didn't immediately succeed, and that might well be a misguided idea.]
Clearly the "good" answer is always "use a real package manager", so that there is only one version of each library in the dependency graph, and a single toolchain/ABI is used, but perhaps there is a worthwhile avenue to explore that would patch up the
pip
world...The text was updated successfully, but these errors were encountered: