esheldon / fitsio

A python package for FITS input/output wrapping cfitsio
GNU General Public License v2.0
134 stars 58 forks source link

Please add a --with-system-fitsio flag to all setup.py targets #82

Open olebole opened 8 years ago

olebole commented 8 years ago

Currently (in 0.9.8), there is a flag --with-system-fitsio that works for the build_ext argument of setup.py. This is not very useful, since when I do a python setup.py build or python setup.py install, the flag cannot be added, and the extension is then rebuild with the internal copy of cfitsio. It would be good, if build and install also would accept this flag. I need it for packaging on Debian #40.

esheldon commented 8 years ago

does anyone know how to address this issue? I did not add the --with-system-fitsio feature so I'm not sure how to proceed

esheldon commented 8 years ago

Note one reason to make this difficult is that most installs of cfitsio in the wild are way out of date and will not in fact work with fitsio at all.

olebole commented 8 years ago

I would not take this as too seriously: the --with-system-cfitsio is probably mainly for package maintainers, and they would put the dependency requirements (if they are documented) into the package metadata.

dnamurphy commented 8 years ago

If you change: self.use_system_fitsio = True in def initialize_options(self) you can setup fitsio with the system-installed version. For good measure (I wasn't sure if this would have had an effect) I also added: self.compiler.add_library('bz2') to def build_extensions() under the else: statement.

I can confirm this then uses the system cfitsio. Be sure to remove your existing build sub-directory, and if you are configuring and compiling cfitsio beforehand, use: ./configure --with-bzip2

esheldon commented 8 years ago

the question @olebole raises is how to add this to all targets