wiki:babelbgp

Version 19 (modified by norris, 14 years ago) (diff)

--

Installing Babel on BG/P (Surveyor at Argonne)

(Notes by Boyana Norris [[email protected]…])

I do not recommend that anyone tries this unless they want to spend a lot of time waiting for configure scripts to complete (e.g., on my laptop, babel configure takes 2.5 minutes, while on the BG/P it takes at least 20 minutes, depending on various options, and then you have to actually build).

  1. First of all, I started out with the goal of getting as many languages supported as possible, including python. This meant that I had to install NumPy first, which turned out to be nontrivial (see description). The second requirement was support for shared libraries since fully static builds are (1) less flexible; and (2) not quite fully automated for CCA components. There is also the additional danger of running out of memory because of bloated static executables.
  1. As expected, GNU Autotools-based packages cannot be simply built on BG/P. First, configure does not provide good cross-compilation support, at least not good enough for BG/P. I added these settings to the llnl_cross_compiling.m4 file (right after the case "$target" in line):
      powerpc64-ibm-bgp*)
        cross_compiling=yes
        llnl_cross_compiling_okay=yes
        enable_pure_static_runtime=no
        enable_shared=yes
        enable_static=no
        enable_java=no
        enable_python=/bgsys/drivers/ppcfloor/gnu-linux/bin/python
        llnl_cv_python_prefix=/bgsys/drivers/ppcfloor/gnu-linux
        llnl_cv_python_numpy=yes
        llnl_cv_python_library=$llnl_cv_python_prefix/lib
        llnl_cv_python_version=2.5
        llnl_cv_python_include=$llnl_cv_python_prefix/include/python$llnl_cv_python_version
        llnl_python_shared_library=$llnl_cv_python_library/libpython2.5.so
        llnl_python_shared_library_found=yes
        sidl_cv_f77_false=0
        sidl_cv_f77_true=1
        sidl_cv_f90_false=0
        sidl_cv_f90_true=1
        llnl_cv_F77_string_passing="far int32_t"
        llnl_cv_F90_string_passing="far int32_t"
        ac_cv_func_malloc_0_nonnull=yes
        ac_cv_func_realloc_0_nonnull=yes
        ac_cv_func_memcmp_working=yes
        with_sidlx=no
        ;;
    

Some additional hard-coded configure settings are discussed in this IBM Document.

While building prerequisites (see next item), I found that libtool did not support building and linking shared libraries using IBM's compilers. The perfect fix for this problem is to add BG/P support to libtool. The faster workaround was to first set an environment variable:

export LDFLAGS='-G -qnostaticlink'

then run configure. Next we introduce an extra step before running make by using this little script on all generated libtool scripts in the build directory of the package being built

#!/bin/sh

#File: libtool_fix.sh

if test "x$1" = "x" ; then prog=libtool;
else prog=$1; fi

sed -i1 -e 's|^export_dynamic_flag_spec=.*$|export_dynamic_flag_spec="-qnostaticlink"|' -e 's|^pic_flag=.*$|pic_flag=" -qpic"|' -e 's|^archive_cmds=.*$|archive_cmds="\\$CC -G \\$libobjs \\$deplibs \\$compiler_flags \\${wl} -o \\$lib"|' -e 's|^hardcode_libdir_flag_spec=.*$|hardcode_libdir_flag_spec="-R\\$libdir -L\\$libdir"|' $prog
  1. To successfully configure Babel, the following prerequisites were necessary: libxml2 and zlib. The former was required for Python support (so the fact that Babel includes libparsifal does not remove the dependence on libxml2 if you want Python). The latter was required by libxml2.
    1. zlib-1.2.3 was configured with:
      ./configure --prefix=/home/norris/cca
      
      and then I had to manually change the values of the CC and LDSHARED variables since zlib does not have a real configure. The values were CC=mpixlc and LDSHARED=mpixlc (I think you only really need CC).

    2. libxml2-2.7.3 was configured and built with
      ./configure --prefix=/home/norris/cca CC=mpixlc CXX=mpixlcxx F90=mpixlf2003 F77=mpixlf77 \
        CPP='gcc -E' --with-python=/bgsys/drivers/ppcfloor/gnu-linux/bin/python --with-zlib=/home/norris/cca \
        --enable-shared --disable-static
      libtool_fix.sh
      make
      make install