Version 31 (modified by muszala, 9 years ago) (diff)


<< back >>

Building the CCA Tool Chain on Surveyor

The build below works. This is still a work in progress however as we try to further automate the entire build process.

The shell prompt is >>. Valid instructions as of Oct. 13 2010--SPM. The order of the build is summarized here.

  1. Libtool-2.4
  2. zlib-1.2.5
  3. libxml-2.7.3
    • run select regression tests
  4. babel out of dev repo (build and tests here)
    • run select regression tests
  5. cca-spec-babel
  6. ccaffeine
  7. bocca
  8. Test the tool chain.

1. Build Libtool 2.4

Libtool may be built using patches or may be built by downloading an already patched tar-ball and building with that.

a. Build Libtool with provided patches

  • Download the source
    >>tar xvfz libtool-2.4.tar.gz
    >>cd libtool-2.4/
  • Use wget or download the following two patches into the libtool-2.4/ directory.
  • Patch the Libtool-2.4 source and run 'bootstrap', which rebuilds autotools:
    >> patch -p0 -i shl_load.c.patch
    patching file libltdl/loaders/shl_load.c
    >> patch -p0 -i libtool.m4.patch
    patching file libltdl/m4/libtool.m4
  • Run configure. I set my install location in my .bashrc file. I'm building out of my home directory and not scratch since you cannot run regression tests out of /scratch and we will need to test both libxml and babel later on.
    >>env | grep LIBTOOL_LOCATION
    >>./configure CC=bgxlc_r CXX=bgxlC_r F77=bgxlf_r FC=bgxlf90_r \
    LDFLAGS="-qnostaticlink -r" --enable-shared \
    --disable-static --enable-ltdl-install --prefix=$LIBTOOL_LOCATION \
    --host=powerpc-bgp-linux-gnu CFLAGS=-qpic
    >>make ; make install
  • All should complete without errors. The last few lines of the entire build process should be:
     /usr/bin/install -c -m 644 ./doc/libtool.1 ./doc/libtoolize.1 '/gpfs/home/muszala/ccaToolBuild/install/libtool-2.4/share/man/man1'
    make[3]: Leaving directory `/gpfs/home/muszala/ccaToolChain/libtool-2.4'
    make[2]: Leaving directory `/gpfs/home/muszala/ccaToolChain/libtool-2.4'
    make[1]: Leaving directory `/gpfs/home/muszala/ccaToolChain/libtool-2.4'

b. Build Libtool from patched tar ball

  • You do not need to had patch this tar ball.
    >>tar xvfz libtool-2.4-bgpPatch.tgz
    >>cd libtool-2.4-bgpPatch/
    >>./configure CC=bgxlc_r CXX=bgxlC_r F77=bgxlf_r FC=bgxlf90_r \
    LDFLAGS="-qnostaticlink -r" --enable-shared \
    --disable-static --enable-ltdl-install --prefix=$LIBTOOL_LOCATION \
    --host=powerpc-bgp-linux-gnu CFLAGS=-qpic
    >>make ; make install

2. Build zlib-1.2.5

  • Download source and extract:
    >>tar xvfz zlib-1.2.5.tar.gz
    >>cd zlib-1.2.5
  • Configure and build. I use bash so can set environment variables this way:
    >>CC=mpixlc CFLAGS="-qpic" ./configure  --static --prefix=/gpfs/home/muszala/ccaToolBuild/install/zlib-1.2.5
  • make install will end with an error, but this error occurs after moving libz.a so it should be OK.
    >> make install
    cp libz.a /gpfs/home/muszala/ccaToolBuild/install/zlib-1.2.5/lib
    cp  /gpfs/home/muszala/ccaToolBuild/install/zlib-1.2.5/lib
    cp: missing destination file operand after `/gpfs/home/muszala/ccaToolBuild/install/zlib-1.2.5/lib'
    Try `cp --help' for more information.
    make: *** [install-libs] Error 1
    >>ls ../../ccaToolBuild/install/zlib-1.2.5/lib/
    libz.a  pkgconfig

3. Build libxml-2.7.3

Sub-sections a and b allow you to build from original source or patched source that we provide. Sub-section c pertains to both cases and is used to run two select regression test on Surveyor compute nodes. These tests are also used to show that our libtool build is correct.

a. Build and patch yourself

  • Download and extract source:
    >>tar xvfz libxml2-2.7.3.tar.gz
    >>cd libxml2-2.7.3/
  • Rerun aclocal, autoconf and automake and make sure you point aclocal to the libtool installation directory you used to build libtool-2.4.
    >>env | grep LIBTOOL_LOCATION
    >>aclocal --verbose -I /gpfs/home/muszala/ccaToolBuild/install/libtool-2.4/share/aclocal

  • Important step. Since libxml was released with an older version of libtool, you also need to update
    >>cp /gpfs/home/muszala/ccaToolBuild/install/libtool-2.4/share/libtool/config/ .
  • configure, then build and install.
    >>env | grep LIBXML2_LOC
    >>./configure --prefix=$LIBXML2_LOC CC=mpixlc_r CPP="gcc -E" \
    --with-python=/bgsys/drivers/ppcfloor/gnu-linux/bin/python \
    --with-zlib=/gpfs/home/muszala/ccaToolBuild/install/zlib-1.2.5 --enable-shared \
    --disable-static LDFLAGS=-qnostaticlink
    >>make ; make install

b. Use a pre-patched version

  • I use the same location for LIBXML2_LOC as in the above example.
    >>tar xvfz libxml2-2.7.3-bgpPatch.tgz
    >>cd libxml2-2.7.3-bgpPatch/ 
    >>./configure --prefix=$LIBXML2_LOC CC=mpixlc_r CPP="gcc -E" \
    --with-python=/bgsys/drivers/ppcfloor/gnu-linux/bin/python \
    --with-zlib=/gpfs/home/muszala/ccaToolBuild/install/zlib-1.2.5 --enable-shared \
    --disable-static LDFLAGS=-qnostaticlink
    >>make ; make install

c. Run two regression tests on back-end nodes.

>>cd .libs
>>qsub --mode script -A cca-tools -t 60 -n 1 -O testapi --env LD_LIBRARY_PATH=$LIBXML2_LOC/lib ./testapi
>>qsub --mode script -A cca-tools -t 60 -n 1 -O runtest --env LD_LIBRARY_PATH=$LIBXML2_LOC/lib ./runtest
  • When the runs complete, you should see 6 new files:
    >>ls -ltr testapi.* runtest.*
    -rw-r--r-- 1 muszala users     0 2010-10-06 05:14 testapi.error
    -rw-r--r-- 1 muszala users  1390 2010-10-06 05:15 runtest.output
    -rw-r--r-- 1 muszala users   105 2010-10-06 05:15 runtest.error
    -rw-r--r-- 1 muszala users  1673 2010-10-06 05:15 testapi.output
    -rw-r--r-- 1 muszala cobalt 3229 2010-10-06 05:15 runtest.cobaltlog
    -rw-r--r-- 1 muszala cobalt 3227 2010-10-06 05:16 testapi.cobaltlog
  • The results of testapi.output look like:
    >>tail testapi.output 
    Testing xmlsave : 4 of 10 functions ...
    Testing xmlschemas : 15 of 25 functions ...
    Testing xmlschemastypes : 26 of 34 functions ...
    Testing xmlstring : 26 of 30 functions ...
    Testing xmlunicode : 166 of 166 functions ...
    Testing xmlwriter : 51 of 79 functions ...
    Testing xpath : 30 of 38 functions ...
    Testing xpathInternals : 106 of 117 functions ...
    Testing xpointer : 17 of 21 functions ...
    Total: 1161 functions, 291335 tests, 0 errors
  • While the results of runtest.output and runtest.error look like:
    >>tail runtest.output 
    ## Path URI conversion tests
    ## Schemas regression tests
    ## Relax-NG regression tests
    ## Relax-NG streaming regression tests
    ## Pattern regression tests
    ## C14N with comments regression tests
    ## C14N without comments regression tests
    ## C14N exclusive without comments regression tests
    ## Catalog and Threads regression tests
    Total 8 tests, 2 errors, 0 leaks
    >>more runtest.error 
    failed the URL passing test for urip:// b.htmlSpecific platform thread support not detected

4. Build Babel out of the dev. repo

  • The babel directions have their own page since babel is often used without the entire CCA tool chain.

5. Build cca-babel-spec

  • Check out source:
    >>svn co cca-spec
    >>cd cca-spec/cca-spec-babel
  • The rest of these instructions are very similar to those found here. I've put them here so the entire tool-chain build is on one page.
    >>env | grep CCA
    >> env | grep BABEL_INSTALL
    >>env | grep LIBXML2_LOC
    >>./configure CPP="gcc -E" CC=mpixlc_r CXX=mpixlcxx_r FC=mpixlf2003_r F77=mpixlf77_r \
      --with-babel-config=$BABEL_INSTALL/bin/powerpc64-ibm-bgp-babel-config \
      --with-libxml2=$LIBXML2_LOC --with-babel-python \
      --host=powerpc-bgp-linux-gnu --target=powerpc64-ibm-bgp \
      target_alias=powerpc64-ibm-bgp --prefix=$CCA_INSTALL_DIR
  • Replace the LIBTOOL_LINKFLAGS variable in makefiles:
    >>find . -name "Makefile" -exec sed -il -e 's|LIBTOOL_LINKFLAGS=.*|LIBTOOL_LINKFLAGS=-qnostaticlink|g' {} \; -print
  • Add -qnostaticlink to some more builds that don't check LIBTOOL_LINKFLAGS:
    >>find . -name Makefile -exec sed -il -e 's|LOCALFLAGS=\(.*\)|LOCALFLAGS=\1 -qnostaticlink|g' {} \; -print
  • 'make clean all install'
  • Edit *Vars* scripts to point to the right
    >>cd $CCA_INSTALL_DIR/share
    >>find . -name '*Vars*' -exec sed -i1 \

6. Build ccaffeine

  • As in step 5, these instructions are similar to those found here. I have only kept the 'cut and paste' instructions and have modified path names in configure to match steps 1-5.
  • Check out the code:
    >>svn co
    >>cd ccaffeine
  • Configure and build:
    >>chmod +x
    >>./configure CPP="gcc -E" CC=mpixlc_r CXX=mpixlcxx_r FC=mpixlf2003_r F77=mpixlf77_r \
      --with-csb-config=$CCA_INSTALL_DIR/bin/cca-spec-babel-config \
      --with-babel-python LDFLAGS="-qnostaticlink" --host=powerpc-bgp-linux-gnu \
      --target=powerpc64-ibm-bgp target_alias=powerpc64-ibm-bgp --prefix=$CCA_INSTALL_DIR \
      --with-boost=/home/norris/soft/boost-1_38_0/include/boost-1_38 \
      --with-xml2-config=$LIBXML2_LOC/bin/xml2-config \
      --with-xml2-includes=-I/$LIBXML2_LOC/include/libxml2 \
      --with-xml2-libs=-L$LIBXML2_LOC/lib \
    >>make clean all install
    >>cd cxx/drivers ; make clean ; touch .preload-lo ; make all ; rm .preload-lo ; make .preload-lo 
    >>cd ../..
    >>make install

7. Build bocca

  • Older instructions are found here while repository info can be found here.
  • Start by checking out the bocca source:
    >>svn co bocca
    >>cd bocca
  • Configure and build:
    >>./configure CPP="gcc -E" CC=mpixlc CXX=mpixlcxx FC=mpixlf2003 F77=mpixlf77 LDFLAGS="-G -qnostaticlink" \
      --host=powerpc-bgp-linux-gnu --target=powerpc64-ibm-bgp target_alias=powerpc64-ibm-bgp \
      --prefix=$CCA_INSTALL_DIR --with-python=/bgsys/drivers/ppcfloor/gnu-linux/bin/python \
      --with-ccafe-config=$CCA_INSTALL_DIR/bin/ccafe-config \
      --with-cca-spec-babel-config=$CCA_INSTALL_DIR/bin/cca-spec-babel-config \
    >>make ; make install

8. Testing the build

Please see boccaTestProj, which is also accessible from the previous page.