wiki:ccafeBgpNew
Last modified 12 years ago Last modified on 05/16/11 05:29:41

<< back >>

Building the CCA Tool Chain on Surveyor (IBM)

  • NOTE - use the autotools supplied in /home/projects/ccatools/autotools, not the system versions (ie. /usr/bin...)
  • When running with ccafe-batch, with MPI there was a core dump due to code in xmlCreateURLParserCtxt of libxml. I recompiled libxml with -O0 and this seem to work. The modifications are rolled into the script above.

The notes below are left for debugging purposes. The script above has any recent modifications.

Please source this for correct paths before building:

export PATH=/bgsys/drivers/ppcfloor/comm/bin:$PATH
export PATH=/home/projects/ccatools/autotools:$PATH
export PATH=/home/projects/ccatools/cmake/bin:$PATH
export BABEL_INSTALL_IBM=/gpfs/home/projects/ccatools/install/IBM/babel
export LIBTOOL_LOC_IBM=/gpfs/home/projects/ccatools/install/IBM/libtool-2.4
export LIBTOOL_LOCATION_IBM=${LIBTOOL_LOC_IBM}
export LIBXML2_LOC_IBM=/gpfs/home/projects/ccatools/install/IBM/libxml-2.7.3
export CCA_INSTALL_DIR_IBM=/gpfs/home/projects/ccatools/install/IBM/ccatools

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
    >>wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.tar.gz
    >>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.
    >>wget http://nucleus.txcorp.com/~muszala/ccaEcloud/bgpPorting/libtool.m4.patch
    >>wget http://nucleus.txcorp.com/~muszala/ccaEcloud/bgpPorting/shl_load.c.patch
    
  • Patch the Libtool-2.4 source and run 'bootstrap', which rebuilds autotools:
    >>pwd
    /home/muszala/ccaToolChain/libtool-2.4
    >> 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
    >>./bootstrap
    
  • 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.
    >>./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_IBM \
    --host=powerpc-bgp-linux-gnu CFLAGS=-qpic
    >>make ; make install
    

b. Build Libtool from patched tar ball

  • You do not need to had patch this tar ball.
    >>wget http://nucleus.txcorp.com/~muszala/ccaEcloud/bgpPorting/libtool-2.4-bgpPatch.tgz
    >>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_IBM \
    --host=powerpc-bgp-linux-gnu CFLAGS=-qpic
    >>make ; make install
    

2. Build zlib-1.2.5

  • Download source and extract:
    >>wget http://zlib.net/zlib-1.2.5.tar.gz
    >>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/projects/ccatools/install/IBM/zlib-1.2.5
    
  • Before building remove this line from the Makefile.
    170a171
    >       cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)
    
  • Now finish the build:
    >> make ; make install
    

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:
    >>wget http://xmlsoft.org/sources/libxml2-2.7.3.tar.gz
    >>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.
    >>aclocal --verbose -I /gpfs/home/projects/ccatools/install/IBM/libtool-2.4/share/aclocal
    >>autoconf
    >>automake
    

  • Important step. Since libxml was released with an older version of libtool, you also need to update ltmain.sh.
    >>cp /gpfs/home/projects/ccatools/install/IBM/libtool-2.4/share/libtool/config/ltmain.sh .
    
  • Also please note the sed script to change the python include path for the python bindings only.
  • configure, then build and install.
    >> ./configure --prefix=$LIBXML2_LOC_IBM CC=mpixlc_r CPP="gcc -E" \
    --with-python=/bgsys/drivers/ppcfloor/gnu-linux/bin/python \
    --with-zlib=/gpfs/home/projects/ccatools/install/IBM/zlib-1.2.5 --enable-shared \
    --disable-static LDFLAGS=-qnostaticlink ; \
    find . -name Makefile -exec \
        sed -i1 -e 's|PYTHON_INCLUDES =.*$|PYTHON_INCLUDES=\/bgsys\/drivers\/ppcfloor\/gnu-linux\/include\/python2.6|g' \
        {} \; -print
    >>make ; make install
    
  • "make install" ends with the following error, but it does not seem to effect anything down the line:
    test -z "/gpfs/home/projects/ccatools/install/IBM/libxml-2.7.3/share/doc/libxml2-python-2.7.3" || /bin/mkdir -p "/gpfs/home/projects/ccatools/install/IBM/libxml-2.7.3/share/doc/libxml2-python-2.7.3"
     /usr/bin/install -c -m 644 TODO '/gpfs/home/projects/ccatools/install/IBM/libxml-2.7.3/share/doc/libxml2-python-2.7.3'
    test -z "/bgsys/drivers/ppcfloor/gnu-linux/lib/python2.6/site-packages" || /bin/mkdir -p "/bgsys/drivers/ppcfloor/gnu-linux/lib/python2.6/site-packages"
     /usr/bin/install -c -m 644 drv_libxml2.py '/bgsys/drivers/ppcfloor/gnu-linux/lib/python2.6/site-packages'
    /usr/bin/install: cannot create regular file `/bgsys/drivers/ppcfloor/gnu-linux/lib/python2.6/site-packages/drv_libxml2.py': Permission denied
    make[3]: *** [install-dist_pythonDATA] Error 1
    make[3]: Leaving directory `/gpfs/home/projects/ccatools/build/IBM/libxml2-2.7.3/python'
    make[2]: *** [install-am] Error 2
    make[2]: Leaving directory `/gpfs/home/projects/ccatools/build/IBM/libxml2-2.7.3/python'
    make[1]: *** [install-recursive] Error 1
    make[1]: Leaving directory `/gpfs/home/projects/ccatools/build/IBM/libxml2-2.7.3/python'
    make: *** [install-recursive] Error 1
    

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

>>pwd
/home/projects/ccatools/build/IBM/libxml2-2.7.3
>>cd .libs
>>qsub -A cca-tools -t 5 -n 1 -O testapi --env LD_LIBRARY_PATH=$LIBXML2_LOC_IBM/lib ./testapi
>>qsub -A cca-tools -t 5 -n 1 -O runtest --env LD_LIBRARY_PATH=$LIBXML2_LOC_IBM/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://example.com/a 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 https://cca-forum.svn.sourceforge.net/svnroot/cca-forum/cca-spec/trunk 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.
    >>./configure CPP="gcc -E" CC=mpixlc_r CXX=mpixlcxx_r FC=mpixlf2003_r F77=mpixlf77_r \
      --with-babel-config=$BABEL_INSTALL_IBM/bin/powerpc64-ibm-bgp-babel-config \
      --with-libxml2=$LIBXML2_LOC_IBM --with-babel-python \
      --host=powerpc-bgp-linux-gnu --target=powerpc64-ibm-bgp \
      target_alias=powerpc64-ibm-bgp --prefix=$CCA_INSTALL_DIR_IBM
    
  • 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 genSCLCCA.sh:
    >>cd $CCA_INSTALL_DIR_IBM/share
    >>find . -name '*Vars*' -exec sed -i1 \
      -e "s|^CCASPEC_GENSCLCCA_SH=.*|CCASPEC_GENSCLCCA_SH='$CCA_INSTALL_DIR/bin/genSCLCCA.sh'|g" {} \; -print
    

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 https://cca-forum.svn.sourceforge.net/svnroot/cca-forum/ccafe/trunk/ccaffeine
    >>cd ccaffeine
    
  • Configure and build:
    >>chmod +x bgpfix.sh
    >>./bgpfix.sh
    >>./configure CPP="gcc -E" CC=mpixlc_r CXX=mpixlcxx_r FC=mpixlf2003_r F77=mpixlf77_r \
      --with-csb-config=$CCA_INSTALL_DIR_IBM/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_IBM \
      --with-boost=/home/projects/ccatools/boost-1.40/include \
      --with-xml2-config=$LIBXML2_LOC_IBM/bin/xml2-config \
      --with-xml2-includes=-I/$LIBXML2_LOC_IBM/include/libxml2 \
      --with-xml2-libs=-L$LIBXML2_LOC_IBM/lib \
      --with-babel-libtool=$LIBTOOL_LOC_IBM/bin/libtool
    >>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 https://cca-forum.svn.sourceforge.net/svnroot/bocca/trunk bocca
    >>cd bocca
    
  • Configure and build (modified on Feb. 16 2011--bocca is used on the FEN and should be built with a FEN python):
    >>./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_IBM --with-python=/usr/bin/python \
      --with-ccafe-config=$CCA_INSTALL_DIR_IBM/bin/ccafe-config \
      --with-cca-spec-babel-config=$CCA_INSTALL_DIR_IBM/bin/cca-spec-babel-config \
      --with-babel-config=$BABEL_INSTALL_IBM/bin/powerpc64-ibm-bgp-babel-config
    >>make ; make install
    

8. Testing the build

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