Version 1

    These instructions show how to build BlackTie on a Solaris 10 platform. They may work with other SunOS releases but have only been validated on Solaris 10 update 8. The instructions are sufficiently different from the generic build instructions that a separate page is warranted.

     

    Caveat: there are still some teething problems with running the tests and examples:- some of them fail intermittently and it currently takes multiple passes to get successful test run. You might want to track the issue via JIRA to see our progress.

     

    Firstly, obtain a copy of Solaris 10 update 8 - I got my copy as a virtual appliance from the Oracle download center. Note that the standard VM does not come with enough disk space or swap space to run BlackTie so I'll include instructions as if you are building from such an appliance.

     

    Add an extra disk using your virtualisation software, for example with VirtualBox use File->Virtual Media Manager to add an expandable disk of size 100 GB (that should be plenty though 10 - 20 may be enough too, but if the disk is expandable it will not matter). Boot Solaris and run format to see the device name of the new disk (format should report it as a VBOX disk of the size you chose, 100.00GB - the device name for my appliance is c0d1 because it is the second disk). Solaris comes with a nice tool for managing disks called zpool. Add the new disk to a new pool and give it a name such as data:

     

        zpool create data c0d1

     

    By default a zfs filesystem is created on the new disk (the mount point defaults to the pool name).

     

    Add more swap backed by space on the new disk. My virtual appliance came with 500 MB and a test build will definitely fail unless you add more. So, create a 1 GB swap mounted a /data/swap:

     

        zfs create -V 1gb data/swap

     

    and ask the OS to use it for swapping:

     

        swap -a /dev/zvol/dks/data/swap

     

    (if you want it to be permanent don't forget to add the entry to vfstab)

     

    Solaris comes with a set of useful utilities located in /usr/sfw/bin so put this early on in your PATH. Also the standard tar and patch do not work with GNU tools, use gtar and gpatch instead (use alias if you keep forgetting: alias tar="gtar"). /usr/ccs/bin must be in you path as well. My PATH looks like this:

     

        PATH=$HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:/usr/sbin:/usr/sfw/bin:/usr/local/bin:/usr/ucb:/usr/ccs/bin

     

    Much of the needed support software is not installed on Solaris so you'll need to get it from a third party such as sunfreeware.com which contains many pre-built SunOS packages for popular projects.

     

    Important note - when using sunfreeware it is polite to use local mirrors.

     

    I found it useful to install sudo (the sudoers file installs into /usr/local/etc):

     

    # install sudo (as root)

    # install sudo (as root)

     

       wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/sudo-1.7.4p4-sol10-x86-local.gz

       wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libintl-3.4.0-sol10-x86-local.gz

       wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libgcc-3.4.6-sol10-x86-local.gz

       wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libiconv-1.13.1-sol10-x86-local.gz

    # ACE requires GNU make
    # install all of the above packages:
       su
       gunzip *.gz
       for i in *local; do pkgadd -d $i; done
       echo "unixusername ALL=(ALL) ALL" >> /usr/local/etc/sudoers
    # the APR install puts some of its includes in locations not recognised by log4cxx. As a quick fix I just copied them over:
       sudo cp /usr/local/apr/include/*.h /usr/local/apr/include/apr-1
    Not all third party dependencies are available in SunOS package format so you will need to build these yourself. Use the disk you added above as a workspace:

     

    # create a work are for building dependencies
        sudo mkdir -p /data/blacktie/util
        sudo chown -R unixusername:staff /data/blacktie
        cd blacktie/util
    # log4cxx
        tar -zxf apache-log4cxx-0.10.0.tar.gz
        cd apache-log4cxx-0.10.0
        ./configure && make
    # ACE + TAO
        mkdir ACE+TAO-5.8.0
        tar -C ACE+TAO-5.8.0 -zxf ACE+TAO-5.8.0.tar.gz
        cd ACE+TAO-5.8.0/ACE_wrappers
        echo "#define ACE_INITIALIZE_MEMORY_BEFORE_USE 1
    #include "ace/config-sunos5.10.h" > ace/config.h
        echo "include $(ACE_ROOT)/include/makeinclude/platform_sunos5_g++.GNU" > include/makeinclude/platform_macros.GNU
        export ACE_ROOT=`pwd`
        export TAO_ROOT=`pwd`/TAO
        export LD_LIBRARY_PATH=`pwd`/lib
    # ACE requires GNU make:
        export PATH=/usr/local/bin:$PATH
        cd ace; make
        cd ..; make
        cd apps/gperf/src/; make
        cd ../../../ACEXML/; make
        cd /data/blacktie/util/ACE+TAO-5.8.0/ACE_wrappers/TAO/TAO_IDL/;
        make
        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/blacktie/util/ACE+TAO-5.8.0/ACE_wrappers/TAO/TAO_IDL
        cd ../tao/; make
        cd ../orbsvcs/ImplRepo_Service/; make
        cd ../orbsvcs; make
        cd ../../../../..
        unset LD_LIBRARY_PATH
    # xerces C - I had to compile this as root (don't know why)
        tar -zxf xerces-c-3.1.1.tar.gz
        cd xerces-c-3.1.1; ./configure && make
        sudo chown -R mmusgrov:staff .
        cd ..
    # cppunit get version 1.12.1 from sourceforge
    # but it needs patching. The patch is available from
        mv ~/Desktop/solarisfinite.patch .
        gpatch -p0 -i solarisfinite.patch
        cd cppunit-1.12.1; ./configure && make

     

    And finally you will need apache ant, maven and subversion in order to build the final dependency (stompconnect) and BlackTie itself:

     

    # as root
        cd /usr/local
        tar -zxf apache-maven-2.2.1-bin.tar.gz
        tar -zxf apache-ant-1.8.1-bin.tar.gz
        tar -zxf ant-contrib-1.0b3-bin.tar.gz ant-contrib/ant-contrib-1.0b3.jar
        mv ant-contrib/ant-contrib-1.0b3.jar apache-ant-1.8.1/lib/
        rm *.gz; rmdir ant-contrib
        chown -R bin:bin apache-maven-2.2.1 apache-ant-1.8.1
    # if the permissions get messed up fix them:
        find apache-maven-2.2.1 -type d -exec chmod 755 {} \;
        find apache-ant-1.8.1 -type d -exec chmod 755 {} \;
    # subversion has a number of dependencies
        gunzip *.gz
        for i in *local; do pkgadd -d $i; done
    # put apache maven and ant on the path
        ANT_HOME=/usr/local/apache-ant-1.8.1
        MAVEN_HOME=/usr/local/apache-maven-2.2.1
        JAVA_HOME=/usr/jdk/jdk1.6.0_22
        export PATH=$ANT_HOME/bin:$MAVEN_HOME/bin:$PATH
    Now get stompconnect and its patch:

     

    # stompconnect
        cd to the util dir
        cd stompconnect-1.0
        unzip stompconnect.patch.zip
        gpatch -p0 -i stompconnect.patch

     

    Use subversion to check out the BlackTie sources:

     

    # BlackTie
    # or get the sources from the project download page
    # The BlackTie build is maven based and it gets its third party dependencies via maven.
    # Therefore the these dependencies need to be turned into maven artifacts. Here's how to do that:
        cd trunk/blacktie-util/thirdparty
        cp build.properties.template build.properties
    # modify build.properties to reflect the locations where you built the various dependencies. Mine looks like this:

    bpa=sol10u8-x86 log4cxx.lib.dir=/data/blacktie/util/apache-log4cxx-0.10.0/src/main/cpp/.libs log4cxx.include.dir=/data/blacktie/util/apache-log4cxx-0.10.0/src/main/include/log4cxx log4cxx.version=902683 stompconnect.dir=/data/blacktie/util/stompconnect-1.0 apr-1.lib.dir=/usr/local/apr/lib apr-1.include.dir=/usr/local/apr/include/apr-1 apr-1.version=1.3.3 ace.lib.dir=/data/blacktie/util/ACE+TAO-5.8.0/ACE_wrappers/lib ace.include.dir=/data/blacktie/util/ACE+TAO-5.8.0/ACE_wrappers/ ace.version=5.8.0 tao.idl.compiler=/data/blacktie/util/ACE+TAO-5.8.0/ACE_wrappers/TAO/TAO_IDL/tao_idl ace.gperf=/data/blacktie/util/ACE+TAO-5.8.0/ACE_wrappers/bin/ace_gperf expat.lib.dir=/usr/local/lib expat.include.dir=/usr/local/include expat.version=2.0.1 cppunit.lib.dir=/data/blacktie/util/cppunit-1.12.1/src/cppunit/.libs cppunit.include.dir=/data/blacktie/util/cppunit-1.12.1/include/cppunit cppunit.version=1.12 xercesc.lib.dir=/data/blacktie/util/xerces-c-3.1.1/src/.libs xercesc.include.dir=/data/blacktie/util/xerces-c-3.1.1/src xercesc.version=3.0.1

    # The ant script in the same directory will package up these dependencies and install them in the local maven repository:
        ant -Dlinux=true -Dbpa=sol10u8-x86
    Build BlackTie:

     

    # build in the main module directory   
        cd ../../blacktie
    # don't forget to include the platform prefix (which the build uses to determine the correct artifacts for the current architecture):
        mvn clean -Dbpa=sol10u8-x86
        mvn install -DskipTests -Dbpa=sol10u8-x86

     

    Follow the standard instructions for installing jboss-5.1.0.GA except that on Solaris a small fix is required:

     

    # jboss-5.1.0.GA needs a small fix to run on Solaris which is described in this post: http://community.jboss.org/thread/2390
    # edit server/<name>/conf/bootstrap/profile.xml edit the AttachmentStore bean constructor.
    # Add a class attribute (with value java.io.File) to the constructor parameter. So it should look like this:
    #     <constructor><parameter class="java.io.File"> ...
    # from here you can safely follow the existing instructions for deploying and running BlackTie
    # except that SunOS does not support valgrind so it needs disabling by, for example, by adding a profile to your settings.xml (or use -Duse.valgrind=false on each mvn build):

    <profile>

     

          <id>blacktie</id>

          <activation> <activeByDefault>true</activeByDefault> </activation>

          <properties>

            <use.valgrind> false </use.valgrind>

          </properties>

        </profile>