-
Notifications
You must be signed in to change notification settings - Fork 39
Provide a way to use installed xpa library #26
Comments
@olebole : I am restructuring the directory structure using astropy helpers. Once I'll get the installation working again I'll see how to do it. I'll update you when I'll have more info. |
@montefra – I don't remember if this has been discussed or is technically possible / easy to implement, but if it is, the best (easiest to maintain / package) solution would be to separate I might be wrong, but I think none of the Astropy-affiliated packages (see http://www.astropy.org/affiliated/) bundles things in |
@cdeil separating xpa is fine if it does not require two steps to install pyds9 (i.e. installing xpa first). @montefra One problem with picking up an installed version will be knowing the installed location, since it's not mandatory to install xpa in a directory automatically searched by gcc/ld. Aside from that, in setup.py/make, could we simply search the system directories for libxpa.* and xpa.h and, if found, modify the data_files variable and skip the build? Or perhaps Python has an easy way to mimic gnu configure's AC_CHECK_LIB macro: https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Libraries.html? |
Ah, I think now I understand ... XPA is a C library only, so So the options are:
I guess changing the location of the Python wrapper (from pyds9 package to the We've discussed this, but has there been a decision on this? If this is still unclear, maybe keeping XPA and the Python wrapper bundled in the @montefra @ericmandel What do you think?
I usually call |
I don't need an automatic solution here; something like |
As one extra data point, I'm on Mac and am using Macports. Based on the xpa portfile I currently get:
and based on the pyds9 portfile I have:
If the recommendation "in xpa.py, the _libpath should be set to libxpa.so.1" is followed, this would mean it has to be patched by Mac users, whereas at the moment it just works (no patching needed). |
The macport |
Outside of its use in DS9, I don't think there is much call for using XPA in general, or an XPA connection to Python in particular. XPA is pretty old technology (from the 1990s) so I doubt any new projects would (or should) use it. So I don't think separating XPA from pyds9 would be worth the effort.
Right, thanks! I forgot about pkg-config. XPA should have a xpa.pc file but I see it does not. So I will add one and we can take it from there. Since the pyds9 build of XPA already checks the current host for the library extension (to differentiate Mac from Linux from Windows), we probably can add another check pretty easily to bypass the build entirely. This would be automatic once the xpa pkg-config is in place, while preserving the library name properly. |
@olebole @montefra @cdeil I added pkg_config support to the main XPA repository (and also got rid of a few new clang warnings in tcl.c, which is not compiled by pyds9). The new XPA version is 2.1.17. We should now be able to run pkg-config inside setup.py to determine whether a given host has the XPA libraries already installed. (I can't do this right now, but can work on it later in the month, unless @montefra gets to it first). |
@ericmandel: thank for it. I'll update the xpa submodule tomorrow. If I can figure out how astropy build stuff in cextern I'll try to do it. Anyway on Sunday I'll leave for a 2 weeks trip and I don't know if/how much time I'll have. |
We certainly can leave this until you get back from your trip! |
For Debian, I need to use the
xpa
package provided by Debian instead of the convenience copy that comes with pyds9. Other distributions (Fedora) may have the same requirement.Therefore it would be nice to have an option to use an already installed XPA library (header and development files).
The text was updated successfully, but these errors were encountered: