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

Headers not installed #1076

Closed
Arfrever opened this issue Jan 12, 2015 · 8 comments
Closed

Headers not installed #1076

Arfrever opened this issue Jan 12, 2015 · 8 comments

Comments

@Arfrever
Copy link

Pillow does not install headers, but setup.py of now separate https://github.com/python-pillow/Sane project assumes that headers of Pillow are in os.path.join(distutils.sysconfig.get_python_inc(), "Imaging").

$ python3.4 setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.4
copying sane.py -> build/lib.linux-x86_64-3.4
running build_ext
building '_sane' extension
creating build/temp.linux-x86_64-3.4
x86_64-pc-linux-gnu-gcc -pthread -fPIC -DWITH_NUMPY -I/usr/include/python3.4/Imaging -I/usr/include/python3.4 -c _sane.c -o build/temp.linux-x86_64-3.4/_sane.o -Wunused-function
_sane.c:30:21: fatal error: Imaging.h: No such file or directory
 #include "Imaging.h"
                     ^
compilation terminated.
error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
@wiredfool
Copy link
Member

I've added a headers line in the distribution metadata, and with that it's possible to run python setup.py install_headers and get the headers installed to <python include dir>/Pillow/Imaging.h. They don't install with python setup.py install for some reason deep in distutils or setup tools, even though the sub-commands appear to setup properly. I've figured out how to force them, but I'm thinking that perhaps we'd be better off not installing them by default since sane is the only package that should need the header and I don't really want to encourage any others.

See https://github.com/wiredfool/Pillow/tree/install_headers

@Arfrever
Copy link
Author

libImaging/Imaging.h has #include "ImPlatform.h", so libImaging/ImPlatform.h also should be installed.

@Arfrever
Copy link
Author

Would it be possible to install headers to ${Python_include_dir}/Imaging instead of ${Python_include_dir}/Pillow?

@wiredfool
Copy link
Member

@Arfrever I think I'd be inclined to update sane, since the Pillow name is specified somewhere in the setuptools/distutils spaghetti.

@wiredfool
Copy link
Member

Ick, the headers don't install cleanly in a standard unix virtualenv, since it's symlinked to the system includes. It works in OSX, but only because of brew.

@wiredfool
Copy link
Member

Ok, I have a better idea that can break the compile time dependency between the two projects. We return the pointers to internal bits of the image object through im.unsafe_ptrs for PyAccess. We can use that here as well.

@wiredfool
Copy link
Member

See python-pillow/Sane#6

@aclark4life
Copy link
Member

Hopefully this is resolved. If not, please reopen.

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

3 participants