Cannot compile ROOT 5.34.36 on Ubuntu 16.04.2

Hi,

I am trying to install ROOT 5.34.36 on Ubuntu 16.04.2.
The configuration goes fine, but after “make”, I get the following error:

g++ -shared -Wl,-soname,libGraf.so -m64 -O2 -Wl,–no-undefined -Wl,–as-needed -o lib/libGraf.so graf2d/graf/src/TPavesText.o graf2d/graf/src/TCurlyLine.o graf2d/graf/src/TMarker.o graf2d/graf/src/TCrown.o graf2d/graf/src/TLegendEntry.o graf2d/graf/src/TPolyLine.o graf2d/graf/src/TLink.o graf2d/graf/src/TEllipse.o graf2d/graf/src/TGraphPolargram.o graf2d/graf/src/TLine.o graf2d/graf/src/TDiamond.o graf2d/graf/src/TMathText.o graf2d/graf/src/TAttImage.o graf2d/graf/src/TPave.o graf2d/graf/src/TPie.o graf2d/graf/src/TPaveStats.o graf2d/graf/src/TBox.o graf2d/graf/src/TWbox.o graf2d/graf/src/TCurlyArc.o graf2d/graf/src/TArrow.o graf2d/graf/src/TGaxis.o graf2d/graf/src/TGraphQQ.o graf2d/graf/src/TTF.o graf2d/graf/src/TPaveLabel.o graf2d/graf/src/TLegend.o graf2d/graf/src/TPaveText.o graf2d/graf/src/TPoints.o graf2d/graf/src/TArc.o graf2d/graf/src/TImage.o graf2d/graf/src/TText.o graf2d/graf/src/TLatex.o graf2d/graf/src/TGraphPolar.o graf2d/graf/src/TCutG.o graf2d/graf/src/TPieSlice.o graf2d/graf/src/TFrame.o graf2d/graf/src/G__Graf.o -Llib -lCore -lCint -ldl -Llib -lHist -lMatrix -lRIO -lMathCore lib/libmathtext.a -lfreetype
lib/libfreetype.a(ftgzip.o): In function ft_gzip_stream_close': ftgzip.c:(.text+0x19a): undefined reference toinflateEnd’
lib/libfreetype.a(ftgzip.o): In function ft_gzip_file_fill_output': ftgzip.c:(.text+0x2a7): undefined reference toinflate’
lib/libfreetype.a(ftgzip.o): In function ft_gzip_file_io': ftgzip.c:(.text+0x335): undefined reference toinflateReset’
lib/libfreetype.a(ftgzip.o): In function FT_Stream_OpenGzip': ftgzip.c:(.text+0x55f): undefined reference toinflateInit2_'
ftgzip.c:(.text+0x613): undefined reference to `inflateEnd’
collect2: error: ld returned 1 exit status
/export/VIP/MY_GAMOS5_VIP09/external/root/5.34.36/root/graf2d/graf/Module.mk:46: recipe for target ‘lib/libGraf.so’ failed
make: *** [lib/libGraf.so] Error 1

sudo apt-get install libfreetype6-dev

No, that doesn’t help. I already have that library:

libfreetype6-dev is already the newest version (2.6.1-0.1ubuntu2.2)

sudo apt-get install zlib1g-dev

But I don’t really understand what happens … do you enforce building of “freetype” which comes with ROOT?

That gives me: zlib1g-dev is already the newest version (1:1.2.8.dfsg-2ubuntu4).

I don’t know what you mean with “enforce freeetype”. I first type configure and then make in the “root/5.34.36/root” directory without adjusting any files or anything else

And if you look inside of “bin/root-config”, what do you see in the line which begins with “features=”?

./configure --enable-builtin-freetype

In bin/root-config, there is the line:
features=“asimage astiff builtin_afterimage builtin_ftgl builtin_glew builtin_pcre cintex explicitlink fftw3 genvector memstat opengl python reflex shadowpw shared tmva vdt x11 xft xml thread”

I just tried “./configure --enable-builtin-freetype” and then make.
Now, I get a different error:

g++ -shared -Wl,-soname,libFFTW.so -m64 -O2 -Wl,–no-undefined -Wl,–as-needed -o lib/libFFTW.so math/fftw/src/TFFTRealComplex.o math/fftw/src/TFFTComplex.o math/fftw/src/TFFTComplexReal.o math/fftw/src/TFFTReal.o math/fftw/src/G__FFTW.o -Llib -lCore -lCint -ldl /usr/local/lib/libfftw3.a
/usr/bin/ld: /usr/local/lib/libfftw3.a(mapflags.o): relocation R_X86_64_32 against `.rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfftw3.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
/export/VIP/MY_GAMOS5_VIP09/external/root/5.34.36/root/math/fftw/Module.mk:45: recipe for target ‘lib/libFFTW.so’ failed

may be do make distclean before doing make

Ok, I redid the compilation, but the result is the same:

make distclean
./configure --enable-builtin-freetype
make

/usr/bin/ld: /usr/local/lib/libfftw3.a(mapflags.o): relocation R_X86_64_32 against `.rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfftw3.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
/export/VIP/MY_GAMOS5_VIP09/external/root/5.34.36/root/math/fftw/Module.mk:45: recipe for target ‘lib/libFFTW.so’ failed
make: *** [lib/libFFTW.so] Error 1

The error says that you have a FFTW3 library in “/usr/local/lib” which was not compiled with “-fPIC”.
Talk to the one who installed it there.
For me the best idea is to remove this additional library (plus any shared version of it and any related include files in “/usr/local/include”) and install the system default version:
sudo apt-get install libfftw3-dev

Ok, I might try this, although I am not very happy about poking around in /usr/lib directories, especially since I have no idea who installed it and why.
In any case, why does ROOT need this fftw2 library? Is there no way to install root without depending on this?

Any advice on how to uninstall this will be helpful too. I tried it with “apt-get remove” and by just renaming “the libfftw3.a”, but in both cases when after that I do “sudo apt-get install libfftw3-dev”, I get:

libfftw3-dev is already the newest version (3.3.4-2ubuntu1).

You should be able to simply configure with --disable-fftw3

Axel.

I tried that, and then I get:

lib/libfreetype.a(ftgzip.o): In function ft_gzip_stream_close': ftgzip.c:(.text+0x19a): undefined reference toinflateEnd’
lib/libfreetype.a(ftgzip.o): In function ft_gzip_file_fill_output': ftgzip.c:(.text+0x2a7): undefined reference toinflate’
lib/libfreetype.a(ftgzip.o): In function ft_gzip_file_io': ftgzip.c:(.text+0x335): undefined reference toinflateReset’
lib/libfreetype.a(ftgzip.o): In function FT_Stream_OpenGzip': ftgzip.c:(.text+0x55f): undefined reference toinflateInit2_'
ftgzip.c:(.text+0x613): undefined reference to `inflateEnd’
collect2: error: ld returned 1 exit status
/export/VIP/MY_GAMOS5_VIP09/external/root/5.34.36/root/graf2d/graf/Module.mk:46: recipe for target ‘lib/libGraf.so’ failed

That’s with ./configure --enable-builtin-freetype --disable-fftw3?

I am sorry, I forgot about that other flag.
I just tried it with both flags, and - indeed - now it compiles perfectly.
Thank you very much for your help, and sorry for sending my previous message too soon.

O no problem, glad we got it solved!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.