Skip to content
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

Install _compat.h #138

Closed
jamesjer opened this issue Mar 6, 2020 · 5 comments
Closed

Install _compat.h #138

jamesjer opened this issue Mar 6, 2020 · 5 comments
Assignees

Comments

@jamesjer
Copy link
Contributor

jamesjer commented Mar 6, 2020

The headers cPersistence.h and ring.h are listed in headers in setup.py, but _compat.h is not, so it is not installed like the others. This is a problem because cPersistence.h has this on line 18:

#include "_compat.h"

The missing header causes the BTrees build to fail.

@jamadden jamadden self-assigned this Mar 6, 2020
@jamadden
Copy link
Member

jamadden commented Mar 7, 2020

As near as I can tell, this library has never installed the _compat.h header as such, even back when the first standalone release, 4.0.0, was made.

persistent/setup.py

Lines 64 to 65 in c9272cb

headers = ['persistent/cPersistence.h',
'persistent/ring.h']

It is included as data installed alongside the .py files, though. Typically, that's the directory that winds up on the compiler command line. E.g., on my Raspbian box, I see BTrees compile with -I/<path-to-venv>/local/lib/python2.7/site-packages. BTrees includes persistent/cPersistence.h, which is next to persistent/_compat.h in that directory.

BTrees also ships with its own _compat.h header, and because of the use of unqualified paths in the #include lines, that's the one that should be used when compiling BTrees. I don't recall the vagaries of C include file order right now, but even if that one is picked up first before persistent/_compat.h when reading persistent/cPersistence.h I think that'd be ok: We get "lucky" in that the BTree version is a superset of the persistent version (as far as other .h files are concerned).

I had no trouble installing persistent 4.6.1 from source from PyPI and then installing BTrees 4.6.1 from source from PyPI (on 32-bit Raspbian arm just to be sure).

Maybe it would help if you could provide more details about the failure you're seeing.

@jugmac00
Copy link
Member

jugmac00 commented Mar 8, 2020

@d-maurer
Copy link

d-maurer commented Mar 8, 2020 via email

@jugmac00
Copy link
Member

jugmac00 commented Mar 8, 2020

Thanks Dieter. Maybe it's about time for me to learn at least some basic C.

@jamesjer
Copy link
Contributor Author

Thanks for the helpful information. It turns out that the way I had been injecting "-IBTrees" in to the build flags for the C compiler stopped working, leading to the compiler's inability to find _compat.h. I fixed that issue and BTrees builds fine again. Sorry for the noise. Let's close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants