Menu

#104 Problem compiling against libcfitsio

v3.60+
closed-fixed
5
2020-03-02
2020-02-09
Anonymous
No

I am trying to build HealPIX 3.60 against heasoft 6.26.1. When I configure the c++ package I get the following error from the src/cxx/configure file:
...
checking for g++ option to support OpenMP... none needed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cfitsio... yes
checking for ffgnrwll in -lcfitsio... no
configure: error: could not find the cfitsio library

Something went wrong ...
Quitting configuration script !

As far as I can tell, this function is present in libcfitsio.a, so I don't know how to correct this. Any help is appreciated.

Dan Suson

Discussion

  • Martin Reinecke

    Martin Reinecke - 2020-02-10

    Did you configure the C++ package via the cantral "configure" script (i.e. the one located in the root directory of the Healpix tarball)?

    Can you please upload the file src/cxx/config.log? That might help us narrowing down the problem.

     
  • Eric Hivon

    Eric Hivon - 2020-02-10

    Hi Dan,

    can you give a bit more details on your operating system (Linux, MacOS) and your C++ compiler ?
    Are you running the Healpix configure script in interactive or automatic mode (with option --auto) ?
    In the latter case, make sure to use the patched hpxconfig_functions.sh available at
    https://sourceforge.net/p/healpix/code/HEAD/tree/branches/branch_v360r1104/hpxconfig_functions.sh and type
    FITSDIR=${HEADAS}/lib FITSINC=${HEADAS}/include ./configure --auto=cxx
    in the Healpix top directory (assuming your using the sh, dash or bash shell.

    Eric

     
  • Eric Hivon

    Eric Hivon - 2020-02-10

    Hi Dan,
    did you compile HEASOFT yourself or are you using a pre-compiled version ?
    There seems to be 2 problems:
    1) in my tests, linking Healpix (C++ or F90) with precompiled cfitsio from Heasoft seems impossible, with the kind of error messages you are seeing
    2) on top of that, as described in https://healpy.readthedocs.io/en/1.5.0/install.html even if you compile HEASOFT yourself and survive to step 1 above:

    due to a conflict of header file names it is currently not possible to use the cfitsio library provided with the HEASOFT package for compilation of Healpix C++. HEASOFT’s include directory contains a file called “rotmatrix.h” which clashes with Healpix’s own rotmatrix.h.

    And this time the error message is far from explicit.

    It is therefore better to do your own clean compilation and installation of cfitsio from https://heasarc.gsfc.nasa.gov/fitsio/.
    While compiling cfitsio, you can spare yourself some future problems by disabling the linking to the curl library, ie
    add --disable-curl to the the cfitsio configure step.

     
  • Eric Hivon

    Eric Hivon - 2020-02-10
    • labels: --> heasoft, cfitsio library, curl library
    • assigned_to: Eric Hivon
     
  • Anonymous

    Anonymous - 2020-02-11

    Thank you, everyone, for your comments. I'll answer them as best I can.

    I'm running Slackware64-current with the Linux 5.4.7 kernel. Currently I'm working with the configure script in interactive mode. Once I know that it will work I will use the automatic mode and pass the values to be modified to the script. The goal is to build a SlackBuilds script that will create an installation package.

    As far as HEASOFT goes, I downloaded the latest source code and built it on my system first. I have worked around the rotmatrix issue by creating a patch that renames the HealPIX rotmatrix class hrotmatrix and modifies all of the files that call rotmatrix so they use hrotmatrix instead.

    I can rebuild HEASOFT if need be. Why do I need to disable the curl library?

    I did not find the file src/cxx/config.log.

    Thank you for the help so far.

     
  • Eric Hivon

    Eric Hivon - 2020-02-11

    Hi Dan,
    no need to rebuild Heasoft, since you built it yourself the first time.
    The offending header files actually are actually rotmatrix.h and pointing.h.
    Instead of modifying the Healpix sources files, you have 2 possibilities (in both cases, make sure to use the patched hpxconfig_functions.sh (sourceforge.net) )

    1. Install cfitsio on its own (with or without libcurl, more on that later) in a place different from ${HEADAS}, and then install Healpix providing the location of this newly installed cfitsio in FITSDIR and FITSINC.
    2. Do not install anything extra, but (assumig Heasoft was properly installed from sources):
      instead of setting FITSDIR=${HEADAS}/lib and FITSINC=${HEADAS}/include in Healpix, set
      FITSDIR=${HEADAS}/../heacore/PLATFORM/lib and
      FITSINC=${HEADAS}/../heacore/PLATFORM/include
      when running the Healpix configure script,
      where PLATFORM is something like x86_64-pc-linux-gnu-libc2.29 depending on your system.
      DO NOT SKIP THE heacore IN THE PATH !
      These new locations are free of the offending rotmatrix.h and pointing.h.

    The forthcoming releases of Healpix will be more explicit on which header files are needed for C++ and should be free of such conflicts.

    As for libcurl, it is used in cfisio to allow the FITS files handling over https.
    It is certainly nice to have, but it creates many problems during the installation of Healpix on systems where libcurl is provided in anaconda2 see bug #96.
    If the command curl-config --prefix works and returns something like /usr, then you should be OK and you can make a standard (=with libcurl enabled) installation of cfitsio.

    Cheers,
    Eric

     
  • Anonymous

    Anonymous - 2020-02-27

    I thought (hoped) that I could mark this as closed, but a related problem came up, Before I get to that, thank you, Eric, for how to deal with the previous problems. Your solutions worked perfectly and everything built without a problem. That created my current problem. I am running the configure script via the auto mode. I want it to do a global installation. The command line in the build script is

    FITSDIR=${HEADAS}/../heacore/${ARCH}-pc-linux-gnu-libc2.30/lib \
    FITSINC=${HEADAS}/../heacore/${ARCH}-pc-linux-gnu-libc2.30/include \
    F_SHARED=true \
    C_SHARED=true \
    PYTHON=/usr/bin/python3 \
    ps_com=/usr/bin/okular \
    pdf_com=/usr/bin/okular \
    gif_com=/usr/bin/gwenview \
    ./configure -L --auto=all

    Unfortunately, the -L command does not build the confdir directory in the Healpix tree. Indeed, I can't find it anywhere. When I run configure by hand it is created. Am I doing something wrong with the configure command or is this a bug?

    Thank you,
    Dan

     
  • Anonymous

    Anonymous - 2020-02-29

    Dear Eric,
    That seems to have fixed everything. This can be marked as closed.

    Sincerely,
    Dan

     
  • Eric Hivon

    Eric Hivon - 2020-03-02
    • status: open --> closed-fixed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB