Compiling 32bit ROOT on 64bit Kubuntu

Dear ROOT-ians,

for the past few days, I have been trying to produce a 32bit ROOT installation on a Kubuntu 11.04 x64 system. I took the following steps:

  • Replaced all occurrences of /usr/lib with /usr/lib32 in the configure script, as it does not look in the 32bit directory by default (is this necessary? is there an option to tell the script to search additional directories?)

  • Added “-L/usr/lib32 -L/usr/lib32/i386-linux-gnu -Werror” to OPTFLAGS in $ROOTSYS/config/Makefile.linux

  • Added “-L/usr/lib32/gcc-snapshot/lib -lquadmath” to F77FLAGS in $ROOTSYS/config/Makefile.linux

  • Installed a whole lot of libraries using getlibs. Separatly installed and compiled python and openssl in 32bit mode to get the correct header files.

I run the configure script as follows (configure32 is the version with /usr/lib replaced, as mentioned above):

./configure32 linux --with-python-incdir=/opt/python_i386/Python-2.7.1/Include --with-python-libdir=/opt/python_i386/Python-2.7.1 --with-ssl-libdir=/opt/openssl_i386/openssl-0.9.8o --with-ssl-incdir=/opt/openssl_i386/openssl-0.9.8o/include --with-xrootd-opts=--syslibs=/usr/lib32/i38-linux-gnu

which works. Afterwards, I do make and this also works. Executing root also works, but when I try start Eve with TEveManager::Create(), I get

/opt/root/root-52800c/bin/root.exe: symbol lookup error: /opt/root/root-52800c/lib/libASImage.so: undefined symbol: png_create_read_struct

I do not understand at all, why this does not work, there is libpng.so in /usr/lib32 (which was also found by the configure script). I found this post [url]libASImage undefined symbol png_create_read_struct which mentions the same problem, but obviously, I have already verified that the libpng.so is there. Also,

ldd libASImage.so 
        linux-gate.so.1 =>  (0xf771c000)
        libfreetype.so.6 => /usr/lib32/libfreetype.so.6 (0xf75e1000)
        libjpeg.so.62 => /usr/lib32/libjpeg.so.62 (0xf75c1000)
        libtiff.so.4 => /usr/lib32/libtiff.so.4 (0xf7566000)
        libXpm.so.4 => /usr/lib32/libXpm.so.4 (0xf7555000)
        libXext.so.6 => /usr/lib32/libXext.so.6 (0xf7546000)
        libX11.so.6 => /usr/lib32/libX11.so.6 (0xf742a000)
        libXft.so.2 => /usr/lib32/libXft.so.2 (0xf7416000)
        libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf732b000)
        libm.so.6 => /lib32/libm.so.6 (0xf72e0000)
        libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf72c4000)
        libc.so.6 => /lib32/libc.so.6 (0xf7167000)
        libz.so.1 => /usr/lib32/libz.so.1 (0xf7151000)
        libxcb.so.1 => /usr/lib32/libxcb.so.1 (0xf7138000)
        libdl.so.2 => /lib32/libdl.so.2 (0xf7134000)
        libfontconfig.so.1 => /usr/lib32/libfontconfig.so.1 (0xf7105000)
        libXrender.so.1 => /usr/lib32/libXrender.so.1 (0xf70fb000)
        /lib/ld-linux.so.2 (0xf771d000)
        libXau.so.6 => /usr/lib32/libXau.so.6 (0xf70f6000)
        libXdmcp.so.6 => /usr/lib32/libXdmcp.so.6 (0xf70f0000)
        libexpat.so.1 => /lib32/libexpat.so.1 (0xf70c6000)

So it seems, everything was linked correctly, but why does libASImage.so not need libpng.so? I am confused. Does anyone have any idea how to solve this? If you need any more information, I will be glad to provide it.

Thanks in advance for your help!

Best regards,
eDude

PS:

After the 32bit compilation did not go through, I tried to get at least the regular x64 version (regular for a x64 system, that is). After encountering and circumventing the “-O2”->"-O" and the “undefined reference to adler32” problems, I was able to compile it.

Imagine my surprise when I found out that I have exactly the same error:

$ /opt/root/root-52800c-x64> root
root [0] TEveManager::Create()
/opt/root/root-52800c-x64/bin/root.exe: symbol lookup error: /opt/root/root-52800c-x64/lib/libASImage.so: undefined symbol: png_create_read_struct

To prove that I am using another version:

$ /opt/root/root-52800c-x64> file `which root`
/opt/root/current-x64/bin/root: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped

This was with a fresh checkout of root.cern.ch/svn/root/tags/v5-28-00c and with

./configure --with-x11-libdir=/usr/lib/x86_64-linux-gnu --with-xft-libdir=/usr/lib/x86_64-linux-gnu --with-xext-libdir=/usr/lib/x86_64-linux-gnu --with-xrootd-opts=--syslibs=/usr/lib/x86_64-linux-gnu

Am I the only one having this problem? Maybe I screwed up the libraries somewhere. Can somebody point me to a likley where the problem originates? Is it libpng.so?

Again: thanks in advance for any replies!

Best regards,
eDude

Ok, I solved it, kind of…

I uninstalled all libpng that were installed, and removed all 32-bit libpngs that I could find. Now 32bit and 64bit compile and run as far as I can tell.

Still, would be interesting to know where this problem came from… oh well.

Cheers,
eDude

I am trying to compile 64-bit root on 64-bit Kubuntu. I would be interested to know how you got around the adler32 problem:

Creating executable …/…/bin/xrdadler32
g++ -m64 -D_ALL_SOURCE -D_REENTRANT -D_GNU_SOURCE -fPIC -rdynamic -Wall -Wno-deprecated -D__linux__ -O2 …/…/obj/Xrdadler32.o …/…/lib/libXrdPosix.a …/…/lib/libXrdClient.a -L…/…/lib -lXrdNet -lXrdOuc -lXrdNetUtil -lXrdSys -lnsl -lrt -ldl -lc -o …/…/bin/xrdadler32
…/…/obj/Xrdadler32.o: In function main': /data/Downloads/Linux/root/net/xrootd/src/xrootd/src/XrdApps/Xrdadler32.cc:176: undefined reference toadler32’
/data/Downloads/Linux/root/net/xrootd/src/xrootd/src/XrdApps/Xrdadler32.cc:218: undefined reference to adler32' /data/Downloads/Linux/root/net/xrootd/src/xrootd/src/XrdApps/Xrdadler32.cc:255: undefined reference toadler32’
collect2: ld returned 1 exit status

Ian

Just checking out root version 5.29 from the trunk seems to solve all problems!

Ian