Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9755

Linker error - Missing symbols from libcurl in fitsio package

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 6.14/04
    • Fix Version/s: 6.20/00
    • Component/s: Graphics
    • Labels:
      None
    • Environment:

      I was building on a MacBook Pro running OSX High Sierra but the problem will potentially affect any OS that is using v3.42 or greater of CFITSIO.

      Description

      In version 3.42 and greater of CFITSIO they have added the following feature

      From the CFITSIO release notes (https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/docs/changes.txt)

      Version 3.42 - August 2017 (Stand-alone release)

      • added https support to the collection of drivers handled in cfileio.c
        and drvrnet.c. This also handles the case where http transfers are
        rerouted to https. Note that this enhancement introduces a dependency
        on the libcurl development package. If this package is absent, CFITSIO
        will still build but will not have https capability.

      If the ./configure step finds curl installed on the system then it will enable this code and the resulting library libcfitsio.a will depend on libcurl. As the build of fitsio requires the static version of the CFITSIO library then a dependency on curl needs to be added to the CMakeLists.txt file for fitsio to avoid undefined symbols

      Undefined symbols for architecture x86_64:
      "_curl_easy_cleanup", referenced from:
      _https_open_network in libcfitsio.a(drvrnet.o)
      "_curl_easy_init", referenced from:
      _https_open_network in libcfitsio.a(drvrnet.o)
      "_curl_easy_perform", referenced from:
      _https_open_network in libcfitsio.a(drvrnet.o)
      "_curl_easy_setopt", referenced from:
      _https_open_network in libcfitsio.a(drvrnet.o)
      "_curl_global_cleanup", referenced from:
      _ffchtps in libcfitsio.a(cfileio.o)
      "_curl_global_init", referenced from:
      _ffihtps in libcfitsio.a(cfileio.o)
      ld: symbol(s) not found for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      make[2]: *** [lib/libFITSIO.so] Error 1
      make[1]: *** [graf2d/fitsio/CMakeFiles/FITSIO.dir/all] Error 2

       

      I was able to fix this by adding curl to the LIBRARIES line in the CMakeLists.txt file in fitsio

      LIBRARIES ${CFITSIO_LIBRARIES} curl

        Attachments

          Activity

            People

            • Assignee:
              amadio Guilherme Amadio
              Reporter:
              9bf0fda1db06f391c8e7 buckley@fnal.gov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Actual Start:
                Actual End: