lava / matplotlib-cpp

Extremely simple yet powerful header-only C++ plotting library built on the popular matplotlib
MIT License
4.27k stars 1.12k forks source link

Fails to link when using Python2.7(Undefined ref to Py_dealloc) but works when linking with Python 3.9 #353

Open sierret opened 8 months ago

sierret commented 8 months ago

Hi. This may not be an issue with your project and it is also highly dependent on the user's local setup but I still think it's significant. The docs on the Github say to link using python2.7. This failed for me and could very well be an issue with my setup and some weird dependency issues especially since this is Linux. But all the same, when I tried to link against Python2.7 on Linux like to docs say, I get a 'Undefined reference to Py_dealloc'. But if I instead the linker flag for Python 3.9(and not Python2.7) it compiles and runs fine.

I pretty much ran the gauntlet of swapping linker flags, environment variables, adding path to packages/files, or package distributions and nothing seemed to make a difference. Only the python 3.9 flag fixed the issue. I only stopped short of building the packages from source.

It may also be a package version issue as well which I tried playing around with but no dice.

Again, different version of OS, then different distros of linux, then different package managers, then building from source vs package, then unique local setup can all affect an issue like this so it's hard to pin down. But all the same maybe that simple flag helps someone out.

Also maybe consider changing the quick setup instructions on the GitHub main to allow for python3.9 as well.