Partial success- cross-compiling 32-bit ROOT on 64-bit Linux

From: Konstantin Olchanski <olchansk_at_triumf.ca>
Date: Mon, 2 Feb 2009 12:20:34 -0800

Hi, roottalk! I want to report partial success cross-compiling 32-bit ROOT on regular 64-bit Linux. Doing this on Scientific Linux 4.7 and 5.2. The reason for cross-compiling is that all our remaining 32-bit machines are slow and do not have much memory.

SL47: success, but 2 problems:
  configure does not find 32-bit mysql libraries (SL do not put them in /usr/lib)   configure does not find 32-bit libxml2 libraries because libxml2-devel.i386     is not installed, and cannot be installed because /usr/bin/xml2-config     conflicts between 32-bit and 64-bit RPMs. Worked around this by     login as root and "ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml2.so"

SL52: success, but 2 problem:
  configure does not find 32-bit mysql libraries (SL do not put them in /usr/lib)   build picks up 64-bit gfortran libraries and fails. From the errors it was     not immediately obvious that the 32-bit libgfortran library was missing.     "yum install libgfortran.i386" fixed that.

  note 1: default install was missing libXpm-devel.i386 and some other 32-bit devel RPMs   note 2: the libxml2-devel problem did not show up because they fixed the conflict     and both 32-bit and 64-bit packages were already installed.

This is how I cross-compile:

svn checkout https://.... root_v5.22.00_SL52_32 cd root_v5.22.00_SL52_32
setarch i386 ../build.sh

The build script is attached: (note: it has a lot of historical baggage)

#!/bin/sh

export ROOTSYS=$PWD
echo ROOTSYS=$ROOTSYS

OPTCERN="--enable-cern --with-cern-libdir=/triumfcs/linux/cern/i386_redhat90/2003/lib" OPTDCAP32="--enable-dcache --with-dcap-incdir=/triumfcs/linux/dcache-client/dcache_1.7.0-39_i386/dcap/include --with-dcap-libdir=/triumfcs/linux/dcache-client/dcache_1.7.0-39_i386/dcap/lib" OPTDCAP64="--enable-dcache --with-dcap-incdir=/triumfcs/linux/dcache-client/dcache_1.7.0-39_x86_64/dcap/include --with-dcap-libdir=/triumfcs/linux/dcache-client/dcache_1.7.0-39_x86_64/dcap/lib" OPT32="$OPTCERN $OPTDCAP32"
OPT64="$OPTDCAP64"
case `uname -m` in
x86_64)

    OPT=$OPT64
;;

*)

    OPT="linux $OPT32"
;;

esac
CONFIGURE="./configure $OPT --enable-minuit2 --enable-mysql --enable-pgsql --enable-rpath" echo $CONFIGURE
$CONFIGURE
make clean
make distclean

find . -name '*.a' -exec /bin/rm -vf {} \;
find . -name '*.so' -exec /bin/rm -vf {} \;
find . -name '*.so.*' -exec /bin/rm -vf {} \;
make -j3      OPTFLAGS="-O2 -g"
make static   OPTFLAGS="-O2 -g"
make cintdlls OPTFLAGS="-O2 -g"

make install OPTFLAGS="-O2 -g"
make redhat OPTFLAGS="-O2 -g"

#end

-- 
Konstantin Olchanski
Data Acquisition Systems: The Bytes Must Flow!
Email: olchansk-at-triumf-dot-ca
Snail mail: 4004 Wesbrook Mall, TRIUMF, Vancouver, B.C., V6T 2A3, Canada
Received on Mon Feb 02 2009 - 21:20:46 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 05 2009 - 23:50:01 CET