Building Thirdparty Dependencies

    BlackTie depends upon several libraries provided by thirdparties. Moreover, these dependencies are then expected to be available in a Maven repository or your ~/.m2/repository folder.

    Currently, we provide in repository.jboss.org the dependencies for the following platforms:

    • CentOS 5.5 32 bit
    • CentOS 5.4 64 bit
    • Visual C++ 9 32 bit (Windows XP and Windows 2003 checked)
    1. DOWNLOAD TOOLS

      ALL PLATFORMS

      1. Download Sun Java SE Development Kit 1.6.0_20 or later and ensure the bin folder is in the path

          http://java.sun.com/javase/downloads/index.jsp

      2. Download Apache Maven 2.0.9 and ensure the bin folder is added to the path

          http://maven.apache.org/download.html

      3. Download Apache Ant 1.7.1 and put the bin folder in the path

          http://ant.apache.org/bindownload.cgi

      4. Download Ant-Contrib 1.0b3 for Ant and put it in the Ant lib folder

          http://sourceforge.net/project/showfiles.php?group_id=36177&package_id=28636&release_id=459052

      WINDOWS ONLY

      Install Visual V++ 2008 Express Edition (only used to provide the compiler and linker on Windows)

      The PATH environment variable will need the runtime DLLs in it

              C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\Debug_NonRedist\x86\Microsoft.VC90.DebugCRT

      The PATH environment variable will also need the VC++ tools in it
              C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat

      LINUX ONLY (optional)

      Install Valgrind as per the instructions at: http://community.jboss.org/wiki/MemoryLeaksCheckwithValgrind

      You will need to install the gcc-c++ packages: yum install gcc-c++

    2. DOWNLOAD INITIAL BLACKTIE DEPEDENCIES

      FEDORA ONLY
      You can use yum to install several of the required packages:
      for i in apr apr-util expat cppunit
      do
              yum install $i
              yum install $i-devel
      done

      WINDOWS ONLY
      Unfortunately, the binaries are not available for all of the dependencies and so we will need to build them.
      The source zips may be download from:
      EXPAT 2.0.1
          http://sourceforge.net/project/showfiles.php?group_id=10127&package_id=11277
      CPPUNIT 1.12.1
          http://sourceforge.net/project/showfiles.php?group_id=11795&package_id=11019
      APR 1.2.12/APR-UTIL 1.2.12
          http://www.mirrorservice.org/sites/ftp.apache.org/apr/
      BUILDING EXPAT AND CPPUNIT WINDOWS ONLY
          Extract the source zips into <BLACKTIE_UTILS_HOME>/Expat2.0.1 and <BLACKTIE_UTILS_HOME>/cppunit-1.12.1
          Build them (follow their own build instructions)

             For cppunit, you only need to build cppunit_dll
      EXTRACTING APR/APR-UTIL WINDOWS ONLY
          Extract apr-1.2.12 to <BLACKTIE_UTILS_HOME>/apr

          Extract apr-1.2.12 (again) to <BLACKTIE_UTILS_HOME>/apr-1.2.12/apr
          Extract apr-util-1.2.12 to <BLACKTIE_UTILS_HOME>/apr-util

          NOTE - You don't build "<BLACKTIE_UTILS_HOME>/apr" and "<BLACKTIE_UTILS_HOME>/apr-util" directly, they are required by Log4Cxx below, you will be building "<BLACKTIE_UTILS_HOME>/apr-1.2.12/apr" below.

    3. INSTALL LOG4CXX

      We have determined that the best way to ensure a consistent build of Log4CXX accross platforms is from a particular revision of log4cxx in Apache svn:
      Change directory to: <BLACKTIE_UTILS_HOME>
          svn co -r 902683 http://svn.apache.org/repos/asf/logging/log4cxx/trunk apache-log4cxx
      Change directory to the newly created apache-log4cxx
      64BIT MACHINES ONLY
      Edit build.properties and set the following properties
          with-apr=/usr/lib64/
          with-apr-util=/usr/lib64/
          apr.include.dir=/usr/include/apr-1
          apr-util.include.dir=/usr/include/apr-1
      ALL MACHINES
      mvn compile
    4. INSTALL TAO

      Download Full ACE+TAO 5.8.0 from http://download.dre.vanderbilt.edu/
          The following is only the way that we build TAO on our machines, the steps are adapted from:
          http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/TAO/TAO-INSTALL.html
      NOTE: We now provide a script in our respository to build ACE+TAO on Linux (just export ACE_VER before running it - but it will even wget it for you!):
         svn co https://anonsvn.jboss.org/repos/blacktie/trunk/blacktie-utils/thirdparty/build-ACE.sh
      Alternatively: Change directory into <BLACKTIE_UTILS_HOME>
          mkdir ACE+TAO-<ACE_VERSION>
          tar xfz ACE+TAO-<ACE_VERSION>.tar.gz -C ACE+TAO-<ACE_VERSION>
          Set the following environment variables:
              ACE_ROOT=<BLACKTIE_UTILS_HOME>/ACE+TAO-<ACE_VERSION>/ACE_wrappers
              TAO_ROOT=<ACE_ROOT>/TAO
              LINUX ONLY
              LD_LIBRARY_PATH=$ACE_ROOT/lib
      Create and edit <BLACKTIE_UTILS_HOME>/ACE+TAO-<ACE_VERSION>/ACE_wrappers/ace/config.h to insert the following:
          LINUX ONLY
              #define ACE_INITIALIZE_MEMORY_BEFORE_USE 1
              #include "ace/config-linux.h"
          WINDOWS ONLY
               #define ACE_INITIALIZE_MEMORY_BEFORE_USE 1
              #include "ace/config-win32.h"
      LINUX ONLY
      Create and edit <BLACKTIE_UTILS_HOME>/ACE+TAO-<ACE_VERSION>/ACE_wrappers/include/makeinclude/platform_macros.GNU to insert the following:
              include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
      LINUX ONLY
      cd <ACE_ROOT>/ace
              make
      cd <ACE_ROOT>/apps/gperf/src
              make
      cd <ACE_ROOT>/ACEXML
              make
      cd <TAO_ROOT>/TAO_IDL
              make
      cd <TAO_ROOT>/tao
              make
      cd <TAO_ROOT>/orbsvcs/orbsvcs
              make CosNaming_Serv
      WINDOWS ONLY
      cd <ACE_ROOT>/ace
              open ace sln and build
      cd <ACE_ROOT>/apps/gperf/src
              open gperf sln and build
      cd <ACE_ROOT>/ACEXML
               open sln and build
      cd <TAO_ROOT>/TAO_IDL
              open TAO_IDL sln and build
      cd <TAO_ROOT>/tao
              open tao sln and build
      cd <TAO_ROOT>/orbsvcs/ImplRepo_Service
              open sln and build
      cd <TAO_ROOT>/orbsvcs/orbsvcs
              open orbsvcs sln and build, we ignore the fails in CosNotification_Persist, RTKokyuEvent, HTIOP
    5. INSTALL APR-1 - WINDOWS ONLY

      ON WINDOWS

      To build apr:

      unzip apr to C:\blacktie\utils\apr-1.2.12\apr (to keep this separate from the apr used by log4cxx above)

      open C:\blacktie\utils\apr-1.2.12\apr\apr.dsw and allow VC to convert as neccessary

      Expand libapr\Source Files\network_io\

      Select multicast.c -> Exclude from project

      Select libapr -> Build

      Under C:\blacktie\utils\apr-1.2.12\apr\Debug there should be at least the files libapr-1.dll and libapr-1.lib

          Note: After building, you must comment out the following lines in C:\blacktie\utils\apr-1.2.12\apr\include\apr.h as APR and TAO have a conflicting variable space:

                typedef int gid_t;

                typedef int uid_t;

                References to the iovec struct

    6. INSTALL XERCES 3.0.1

      Download Xerces 3.0.1 src:
          http://xerces.apache.org/xerces-c/download.cgi
      Extract into <BLACKTIE_UTILS_HOME>

      ON LINUX

      1. cd <BLACKTIE_UTILS_HOME>/xerces-c-3.0.1
      2. ./configure --disable-network
      3. make

      ON WINDOWS

      Following the instructions from: http://xerces.apache.org/xerces-c/build-3.html#Windows open the file <BLACKTIE_UTILS_HOME>/xerces-3.0.1/projects/Win32/VC9/xerces-all/xerces-all.sln

      The only project in the solution you need to build is the one named XercesLib

    7. INSTALL ProtoBuf 2.4.1

      Download from http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
      Extract into <BLACKTIE_UTILS_HOME>

      ON LINUX

      1. tar xjvf protobuf-2.4.1.tar.bz2
      2. cd protobuf-2.4.1
      3. ./configure
      4. make && make install
      5. cd <BLACKTIE_SRC>
      6. ./build.sh -f <paht_to_protobuf-2.4.1>/java/pom.xml install

      ON WINDOWS

    8. INSTALL DEPENDENCIES AS MAVEN ARTIFACTS

    Change directory to a location where you would like to check out BlackTie:
    ANON SVN ACCESS

    svn co https://anonsvn.jboss.org/repos/blacktie/tags/<LATEST>/blacktie-utils/thirdparty <TAG_NAME>-thirdparty

    COMMITTER SVN ACCESS
    We suggest taking trunk for committers as upgrades are rapidly released:
    svn co https://svn.jboss.org/repos/blacktie/trunk product

    IMPORTANT NOTE: bpa

    The build uses a special user defined flag -Dbpa=<PLAT_ARCH>, the value of this parameter is intended to be a readily understandable representation of your platform and architecture. We currently use the following values: centos55x64 (CentOS 5.4. 64 bit), centos55x32 (CentOS 5.5 32 bit), vc9x32 (Windows XP 32 bit). You are free to use any value you like, but it must be used for all builds.

    STEPS FOR AN INITIAL BUILD (or a change to a dependency from above)

    Perform the following commands to install the libs from above (except JBoss AS which you currently do manually) into your Maven repo:

      1. cd <TAG_NAME>-thirdparty
      2. cp build.properties.template build.properties
      3. Edit build.properties as appropriate (NOTE: You MUST NOT change the version numbers in here as the build is configured to expect these version numbers) (NOTE: You must set bpa as suggested above)
      4. ant -Dlinux=true (or -Dwindows=true)
        1. At this point it is worth backing up the third party dependencies so that if you were to migrate build boxes you would not need to repeat steps 2 to 6 above: tar cfz btrepo-<PLAT_ARCH>.tgz apache-log4cxx expat cppunit apr-1 ace apache-xercesc

    NOTE: If you are not using a standard platform such as CentOS or Windows XP, you will need to define as profile as shown here.