astropy: astropy.wcs incompatible with wcslib 6.3

As mentioned by @privong in issue #9018, there is an error on import with astropy.wcs with wcslib version 6.3 and astropy 3.2.1. The backtrace is the following:

/usr/lib/python3.7/site-packages/astropy/wcs/__init__.py in <module>
     24 """
     25 
---> 26 from .wcs import *
     27 from . import utils
     28 

/usr/lib/python3.7/site-packages/astropy/wcs/wcs.py in <module>
     47 from astropy.io import fits
     48 from . import docstrings
---> 49 from . import _wcs
     50 
     51 from astropy.utils.compat import possible_filename

ImportError: /usr/lib/libwcs.so.6: undefined symbol: fits_read_wcstab

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

@nden The Arch package manager indicates that wcslib depends on cfitsio, so that dependency should be satisfied.

$ pacman -Qi wcslib
Name            : wcslib
Version         : 6.3-1
Description     : A C library that implements the 'World Coordinate System' (WCS) standard in FITS
[...]
Depends On      : cfitsio
[...]

Thanks! I was completely baffled… I’m not sure if the wcslib maintainer needs a ping.

  • --use-system-cfitsio links the FITS module against libcfitsio
  • --use-system-wcslib links the WCS module against libwcs, and not libcfitsio.

In this case it feels like astropy/wcs/setup_package.py needs to be updated to link to cfitsio.

# Might be nothing more than
cfg['libraries'] = ['cfitsio']

(If this is Arch Linux) I think this might be a bug in the wcslib package. It should not be defining a fits_read_wcstab symbol in libwcs.so at all when libcfitsio is detected by the configure script

https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/wcslib

I can’t reproduce the missing symbol behavior when I build cfitsio and wcslib from source. However,

$ sudo pacman -S wcslib

$ nm -D /usr/lib/libwcs.so|grep fits_read_wcstab                                                                                                                                                                         
                 U fits_read_wcstab

# Just showing here it defined/provided in libcfitsio
$ nm -D /usr/lib/libcfitsio.so|grep fits_read_wcstab
00000000000e5d00 T fits_read_wcstab

I wonder if the PKGBUILD should have explicitly passed --with-cfitsio[lib|inc]= instead of letting pkg-config do it.