VisCloud
SDN+SBC+TDW

How to build SAGE on Scientific Linux 6.5

Scientific Linux, which is released and maintained by the biggest Europa science community, is Redhat Linux and CentOS compatibility. It is providing stable computational and visualization environment. This tips shows how to build SAGE middleware on Scientific Linux 6.5.

  1. Install Libraries
  2. Install the build dependencies.
    sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    sudo yum install SDL readline freeglut libjpeg ImageMagick libXmu libXi \
    glew SDL_ttf wxGTK wxPython numpy poppler pygame gcc gcc-c++ SDL-devel \
    readline-devel freeglut-devel libjpeg-devel ImageMagick-devel libXmu-devel \
    libXi-devel glew-devel SDL_ttf-devel poppler-devel svn git cmake \
    jack-audio-connection-kit-devel fontconfig-devel libpng-devel libtool-ltdl-devel \
    libv4l-devel gnutls-devel yasm glibc-devel.i686 gstreamer-plugins-base-devel
    				

  3. Build and Install GCC 4.6.3
  4. Scientific Linux 6.5 has gcc 4.4.7. Optional RPM repository, which is Extra Packages for Enterprise Linux (EPEL) has a newly gcc package (4.7.3). Also EPEL repository packages are compatible with Scientific Linux. However, SAGE and attached applications are required gcc 4.6 because another version throws any error (ex. implicit functions). So, you shoud build and install gcc 4.6.3 from source.
    wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-4.6.3/gcc-4.6.3.tar.bz2
    tar -jxvf gcc-4.6.3.tar.bz2
    cd gcc-4.6.3
    ./contrib/download_prerequisites
    cd ..
    mkdir gcc-build-4.6.3
    cd gcc-build-4.6.3
    ../gcc-4.6.3/configure --program-suffix=-4.6 --enable-languages=c++
    make -s -j4
    sudo make install
    				
    You shoud swtich mainly gcc version to 4.6 from 4.4.
    sudo mv /usr/bin/gcc /usr/bin/gcc-4.4
    sudo update-alternatives --install /usr/bin/gcc gcc /usr/local/bin/gcc-4.6 46
    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 44
    sudo mv /usr/bin/g++ /usr/bin/g++-4.4
    sudo update-alternatives --install /usr/bin/g++ g++ /usr/local/bin/g++-4.6 46
    sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 44
    sudo mv /usr/bin/c++ /usr/bin/c++-4.4
    sudo update-alternatives --install /usr/bin/c++ c++ /usr/local/bin/c++-4.6 46
    sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/c++-4.4 44
    				

  5. Build and Install libvncserver 0.9.9
  6. Scientific Linux 6.5 repository provides libvncserver 0.9.7 rpm packages. But, libserver 0.9.9 is required SAGE.
    wget http://sourceforge.net/projects/libvncserver/files/libvncserver/0.9.9/LibVNCServer-0.9.9.tar.gz
    tar -zxvf LibVNCServer-0.9.9.tar.gz
    cd LibVNCServer-0.9.9
    ./configure --prefix=/usr/
    make
    sudo make install
    

  7. Build and Install Qt 4.8.5
  8. Qt 4.8.5 is required SAGE application such as mplayer, vnc and so on. You shoud build and install Qt 4.8.5 from source.
    wget http://download.qt-project.org/archive/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz
    tar -zxvf qt-everywhere-opensource-src-4.8.5.tar.gz
    cd qt-everywhere-opensource-src-4.8.5
    ./configure
    gmake -j4
    sudo gmake install
    				
    Next, create the library config file on the system. Following is in the config file (/etc/ld.so.conf.d/qt-4.8.5.conf).
    /usr/local/Trolltech/Qt-4.8.5/lib
    				
    Then, you shoud configure for Qt environment. Please update the the following to the Qt profiler file (/etc/profile.d/qt.sh). Actually, you add red character lines in the original script.
    # Qt initialization script (sh)
    
    # In multilib environments there is a preferred architecture, 64 bit over 32 bit in x86_64,
    # When a conflict is found between two packages corresponding with different arches,
    # the installed file is the one from the preferred arch. This is very common for executables
    # in /usr/bin, for example. If the file /usr/bin/foo is found in an x86_64 package and in an
    # i386 package, the executable from x86_64 will be installe
    
    if [ -z "${QTDIR}" ]; then
    
    case `uname -m` in
    x86_64 | ia64 | s390x | ppc64 )
    	QT_PREFIXES="/usr/local/Trolltech/Qt-4.8.5 /usr/lib64/qt-3.3 /usr/lib/qt-3.3" ;;
    * )
    	QT_PREFIXES="/usr/local/Trolltech/Qt-4.8.5 /usr/lib/qt-3.3 /usr/lib64/qt-3.3" ;;
    esac
    
    for QTDIR in ${QT_PREFIXES} ; do
    test -d "${QTDIR}" && break
    done
    unset QT_PREFIXES
    
    if ! echo ${PATH} | /bin/grep -q $QTDIR/bin ; then
    PATH=$QTDIR/bin:${PATH}
    fi
    
    QTINC="$QTDIR/include"
    QTLIB="$QTDIR/lib"
    
    export QTDIR QTINC QTLIB PATH
    
    fi
    				
    After that, you shoud reload the config files and libraries.
    . /etc/profile
    sudo ldconfig
    				
    If your computer already installed qt-devel and qt3-devel packages, you have to remove these packages.
    sudo rpm -e qt-devel qt3-devel
    				

  9. Build SAGE
  10. This document aims to build SAGE middlware from source code. Please, refer to the offical SAGE installation document on the SAGE web site. Probably, developer's document on the SAGE web site shows essential of source code build.
    svn co svn://iridium.evl.uic.edu/sage2012/trunk/ sage-dev
    cd sage-dev
    ./configure
    make
    make build
    				

The research was partially supported by "Research on high functional network platform technology for large-scale distributed computing", entrusted research from NICT.
This work was partially supported by JSPS KAKENHI Grant Number 24700295, 26540053 and 18K11355.