Home | News | Documentation | Download

Compile Error on Ubuntu 18.04


#1

Ubuntu 18.04
gcc 4.8.5
root version 5.34/36

This error came up when attempting to compile.

g++ -pipe -m64 -Wshadow -Wall -W -Woverloaded-virtual -fPIC -Iinclude -pthread -I. -I/home/manuel/root/cint/cint/inc -o graf2d/fitsio/src/G__FITSIO.o -c graf2d/fitsio/src/G__FITSIO.cxx
g++ -shared -Wl,-soname,libFITSIO.so -m64 -O2 -Wl,–no-undefined -Wl,–as-needed -o lib/libFITSIO.so graf2d/fitsio/src/TFITS.o graf2d/fitsio/src/G__FITSIO.o -Llib -lCore -lCint -ldl -Llib -lHist -lGpad -lGraf -lMatrix /usr/lib/x86_64-linux-gnu/libcfitsio.a -lpthread -lz
/usr/lib/x86_64-linux-gnu/libcfitsio.a(cfileio.o): In function ffihtps': (.text+0xbe9a): undefined reference tocurl_global_init’
/usr/lib/x86_64-linux-gnu/libcfitsio.a(cfileio.o): In function ffchtps': (.text+0xbeb5): undefined reference tocurl_global_cleanup’
/usr/lib/x86_64-linux-gnu/libcfitsio.a(drvrmem.o): In function bzip2uncompress2mem': (.text+0x1262): undefined reference toBZ2_bzReadOpen’
(.text+0x1289): undefined reference to BZ2_bzRead' (.text+0x12c0): undefined reference toBZ2_bzReadClose’
(.text+0x131e): undefined reference to BZ2_bzReadClose' (.text+0x1397): undefined reference toBZ2_bzReadClose’
(.text+0x13f7): undefined reference to BZ2_bzReadClose' /usr/lib/x86_64-linux-gnu/libcfitsio.a(drvrnet.o): In functionhttps_open_network’:
(.text+0x761): undefined reference to curl_easy_init' (.text+0x778): undefined reference tocurl_easy_setopt’
(.text+0x7a1): undefined reference to curl_easy_setopt' (.text+0x7b7): undefined reference tocurl_easy_setopt’
(.text+0x7cd): undefined reference to curl_easy_setopt' (.text+0x810): undefined reference tocurl_easy_setopt’
/usr/lib/x86_64-linux-gnu/libcfitsio.a(drvrnet.o):(.text+0x833): more undefined references to curl_easy_setopt' follow /usr/lib/x86_64-linux-gnu/libcfitsio.a(drvrnet.o): In functionhttps_open_network’:
(.text+0x8df): undefined reference to curl_easy_perform' (.text+0x905): undefined reference tocurl_easy_cleanup’
(.text+0x93c): undefined reference to curl_easy_setopt' (.text+0x94d): undefined reference tocurl_easy_setopt’
(.text+0x955): undefined reference to curl_easy_perform' (.text+0x9b5): undefined reference tocurl_easy_setopt’
(.text+0x9bd): undefined reference to curl_easy_perform' (.text+0xa63): undefined reference tocurl_easy_cleanup’
(.text+0xb07): undefined reference to curl_easy_setopt' (.text+0xb0f): undefined reference tocurl_easy_perform’
collect2: error: ld returned 1 exit status
/home/manuel/root/graf2d/fitsio/Module.mk:45: recipe for target ‘lib/libFITSIO.so’ failed
make: *** [lib/libFITSIO.so] Error 1


#2

may be @amadio has an idea about it.


#3

That doesn’t look like a problem in ROOT, but a problem in the static version of the cfitsio library on your system. Notice that all missing symbols come from it. Try adding libcurl to the linking step of libFITSIO.so in ROOT and it may work. Alternatively, try to use the shared version of libcfitsio from your system.


#4

Had similar problem recently and I just went with 5.34/38 instead which worked fine in 18.04.


#5

This has been reported as https://sft.its.cern.ch/jira/browse/ROOT-9755

@mp2u this thread is relevant - do you have objections against me moving it into the ROOT section?


#6

Hi. I am facing the similar problem as posted. I am using root version 5.34 on Ubuntu 18.04. I do not know how to implement the solution you suggested. Can you please elaborate the steps?


#7

I tried solution given on https://sft.its.cern.ch/jira/browse/ROOT-9755 following the reply by @Axel . But I am still getting the same error. But there might be an error in the way I am implementing the solution. In the CMakeLists.txt file, it was written:

ROOT_LINKER_LIBRARY(FITSIO *.cxx G__FITSIO.cxx LIBRARIES ${CFITSIO_LIBRARIES} DEPENDENCIES Hist Gpad Graf Matrix)

I tried two things:

  1. removed " DEPENDENCIES Hist Gpad Graf Matrix)" and wrote “curl”
  2. Added “curl” through comma
    ROOT_LINKER_LIBRARY(FITSIO *.cxx G__FITSIO.cxx LIBRARIES ${CFITSIO_LIBRARIES} DEPENDENCIES Hist Gpad Graf Matrix, curl)

None of these options resolve the errors. Please tell me what is the correct way of doing it.