Collaborative Infrastructure Build Instructions =============================================== Author: Ron van Hoof (Ron.vanHoof@nasa.gov) Version: March 1, 2011 Introduction: ------------- This file contains instructions on how to obtain, build and install the CI components and examples. Examples: --------- The Collaborative Infrastructure offers examples of actors developed in both the Java and C++ languages. These examples are available from CVS. All code compiles and runs on both Linux (tested with G++ 4.1 on Fedora Core 8), Windows XP SP3/Vista SP1 (tested with Visual Studio 2008). The examples include for both Java and C++: 1. A Decision Support Agent actor that waits until the universal executive is alive and then starts publishing a plan to the universal executive (currently an empty plan) and registers for execution status from that executive. 2. A Universal Executive actor that processes a request to add a plan, returns a response as to whether it succeeded and that on success starts publishing execution status events using the data distribution service, which the DSA will receive and process. In Java only: 3. An example implementation of a translation service. It currently shows the PlanStructure-Plexil translation. Tab Spacing: ------------ The tab spacing used in all source files is: = 2 spaces Installation and Build Instructions: ------------------------------------ If you want to run a native (C++) actor start at step 1. If you want to run only a Java actor start at step 4b. 1. (C++ Actor only) Install ACE 5.6.9 and TAO 1.6.9 and compile it on your machine. On linux build: ace apps/gperf TAO/tao TAO_IDL TAO/orbsvcs On Windows build the following projects using VS 2008 (also known as VS 9): ACE TAO NT_Naming_Service This generates the minimum set of libraries required for the CI. 2. (C++ Actor only) Set the environment variables (directories can be different on your machine): Linux: ACE_ROOT=/opt/ACE_wrappers TAO_ROOT=$ACE_ROOT/TAO CI_CPP_ROOT=~/Workspace/CI/CPP/ciinterface_cpp CI_EXAMPLES_ROOT=~/Workspace/CI/CPP/ciexamples_cpp PATH=$ACE_ROOT/bin:$PATH LD_LIBRARY_PATH=$ACE_ROOT/ace:$ACE_ROOT/lib:/lib Windows: ACE_ROOT=C:\ACE_wrappers TAO_ROOT=%ACE_ROOT%\TAO CI_CPP_ROOT=C:\Workspace\CI\CPP\ciinterface_cpp CI_EXAMPLES_ROOT=C:\Workspace\CI\CPP\ciexamples_cpp PATH=%ACE_ROOT%\bin;%ACE_ROOT%\lib;%PATH% 3. (C++ Actor only) Retrieve and compile the CI Interface: CVS Repository: wow.arc.nasa.gov:/home/cvs/ISG-Repository CVS Module: ciinterface_cpp CVS Path: collaborativeinfrastructure/cpp/ciinterface CVS Branch: rel_1_12_7 > cd ~/Workspace/CI/CPP > cvs co ciinterface_cpp > cd ciinterface_cpp Linux: > make Windows: 1. Load the CIInterface.sln file into Visual Studio 2008 and Build the solution Note: If you compile against a newer release of ACE/TAO or have problems with make in general, try to regenerate the make files by running the following perl script located in CI_CPP_ROOT: GenerateWorkspace.pl 4a. (C++ Actor only) Retrieve and compile the CI Examples: CVS Repository: wow.arc.nasa.gov:/home/cvs/ISG-Repository CVS Module: ciexamples_cpp CVS Path: collaborativeinfrastructure/cpp/ciexamples CVS Branch: rel_1_12_7 > cd ~/Workspace/CI/CPP > cvs co ciexamples_cpp > cd ciexamples_cpp Linux: > make Windows: 1. Load the CIExamples.sln file into Visual Studio 2009 and Build the solution. Note: If you compile against a newer release of ACE/TAO or have problems with make in general, try to regenerate the make files by running the following perl script located in CI_EXAMPLES_ROOT: GenerateWorkspace.pl 4b. (Java Actor only) Retrieve and compile the CI Examples: CVS Repository: wow.arc.nasa.gov:/home/cvs/ISG-Repository CVS Module: ciexamples_java CVS Path: collaborativeinfrastructure/java/ciexamples CVS Branch: rel_1_12_7 Make sure to have installed Ant 1.7.0 (see the Build.txt file included in the docs directory if the ciexamples_java module for details). > cd ~/Workspace/CI/Java/ciexamples_java > cp docs/build.properties . Edit the ./build.properties file and set the dir.ci_java_root property to where you installed the ciinterface_java code or update the property and the jar entries to point to the folder and jar files in the CI Runtime (see step 5). Check the docs/Build.txt file for further build instructions on obtaining and building the ciinterface_java module. > ant 5. Download and install the CI Runtime: The CI Runtime is packaged as an installer and will install all components, scripts and configuration files in a CI directory of your choosing. An installer is available for Linux, Windows and Mac OS X. NOTE: Make sure to have the ACE_ROOT environment variable set prior to running the installer. Linux: > scp @wow.arc.nasa.gov:/home/rvhoof/a4oshare/ciruntime/V1.12/linux/setup.bin.gz . > gunzip setup.bin.gz > chmod +x setup.bin > ./setup.bin The setup wizard is started and will guide you through the installation. Default installation directory is: ~/CI (C++ Actor only) Install the native CI interface in the hosting environment > cp $CI_CPP_ROOT/lib/libCIInterface.so ~/CI/lib Windows: > scp @wow.arc.nasa.gov:/home/rvhoof/a4oshare/ciruntime/V1.12/windows/setup.exe . > ./setup The setup wizard is started and will guide you through the installation. Default installation directory is: C:\CI Mac OS X: > scp @wow.arc.nasa.gov:/home/rvhoof/a4oshare/ciruntime/V1.12/macosx/setup.zip . Double click the zip file to have OS X extract the installer. Double click the extracted installer. The setup wizard is started and will guide you through the installation. Default installation directory is: ~/CI After installation you can find a Readme.txt/README file in the docs directory of the CI Runtime. It describes what you need to do to deploy and run an actor. Actor Templates --------------- Both for Java and C++ I developed a set of code templates for actors. One for an actor that uses the CI state manager and one for an actor that does not use the state manager allowing the actor developer to implement his/her own state management. The Java templates are available as part of the CI Examples module CVS Repository: wow.arc.nasa.gov:/home/cvs/ISG-Repository CVS Module: ciexamples_java CVS Path: collaborativeinfrastructure/java/ciexamples CVS Branch: rel_1_12_7 The C++ templates are available in: CVS Repository: wow.arc.nasa.gov:/home/cvs/ISG-Repository CVS Module: citemplates_cpp CVS Path: collaborativeinfrastructure/cpp/citemplates CVS Branch: rel_1_12_7 The templates include an example actor descriptor file and include the templates for building an actor. For Java we use Ant to build code so the build file to edit is build.xml. For C++ we use the Make Project Creator so the file to edit is: templates/CITemplates.mpc Running GenerateWorkspace.pl will regenerate the makefiles for various platforms. CI Tutorial and API Documentation --------------------------------- An updated version of the CI Tutorial (C++ and Java) and the CI API Documentation can be found on NX at: https://nx.arc.nasa.gov/nx/dsweb/View/Collection-46735 The documents are named: A4O CI Tutorial C++ A4O CI Tutorial Java A4O CI Interface API Documentation The API documentation covers the IDL used as the basis for the CI Interface, the Java CI helper classes and the C++ CI helper classes. CI Code Modules --------------- All CI code is available in CVS: CVS Repository: wow.arc.nasa.gov:/home/cvs/ISG-Repository CVS Path: collaborativeinfrastructure CVS Branch: rel_1_12_7 The modules currently available are: 1. CI Interface (Java): The CI core module with the main IDL, service implementations (transport, directory, dds, etc) and helper classes. CVS Module: ciinterface_java CVS Path: collaborativeinfrastructure/java/ciinterface CVS Branch: rel_1_12_7 2. CI Hosting Environment (Java): The hosting environment used to load and run actors. CVS Module: cihostingenvironment CVS Path: collaborativeinfrastructure/java/cihostingenvironment CVS Branch: rel_1_12_7 3. CI Process Manager (Java): The process manager that is used with the CI Console to remotely start actor hosting environments. CVS Module: ciprocessmanager CVS Path: collaborativeinfrastructure/java/ciprocessmanager CVS Branch: rel_1_12_7 4. CI Console (Java): The CI Console that is used to remotely start, monitor and stop one or more CI applications each consisting of one or more hosting environments hosting one or more actors. CVS Module: ciconsole CVS Path: collaborativeinfrastructure/java/ciconsole CVS Branch: rel_1_12_7 5. CI Examples (Java): The CI Java examples with the DSA and Executive actors, translation service and actor templates. CVS Module: ciexamples_java CVS Path: collaborativeinfrastructure/java/ciexamples CVS Branch: rel_1_12_7 6. CI Installation (Java): The CI custom code actions used as part of the CI installer to generate scripts and update configuration files. CVS Module: ciinstallation CVS Path: collaborativeinfrastructure/java/ciinstallation CVS Branch: rel_1_12_7 7. CI Runtime (InstallAnywhere Enterprise 2008): The InstallAnywhere installer package. CVS Module: ciruntimeinstaller CVS Path: collaborativeinfrastructure/ia/ciruntime CVS Branch: rel_1_12_7 8. CI Interface (CPP): The native portion of the CI to run native actors and CI helper classes for developing native actors. CVS Module: ciinterface_cpp CVS Path: collaborativeinfrastructure/cpp/ciinterface CVS Branch: rel_1_12_7 9. CI Templates (CPP): The CI actor, actor descriptor and build templates for developing native actors. CVS Module: citemplates_cpp CVS Path: collaborativeinfrastructure/cpp/citemplates CVS Branch: rel_1_12_7 10. CI Examples (CPP): The CI actor examples with the DSA and Executive actors. CVS Module: ciexamples_cpp CVS Path: collaborativeinfrastructure/cpp/ciexamples CVS Branch: rel_1_12_7 11. CI PlanStructure-PLEXIL Translator (Java): The current official PlanStructure-PLEXIL translator. CVS Module: cipsplexiltranslator CVS Path: collaborativeinfrastructure/java/cipsplexiltranslator CVS Branch: rel_1_12_7 Build documentation for this code can be found with every CI module in the module's docs directory. Java code uses Ant 1.7.0 and the CPP code uses Make Project Creator (included with ACE/TAO). The CPP modules come with the makefiles generated by MPC for Visual Studio 7.1, 8, 9 (2008), Borland Make, GNU make and Automake. Ron ----------------------------------------------------------------------- Ron van Hoof Phone: (732) 632-9459 Software Engineer V Cell: (732) 710-8868 Dell Services Federal Government Fax: (732) 632-9607 NASA Ames Research Center E-mail: Ron.vanHoof@nasa.gov 9 Moraine Road E-mail: rvhoof@optonline.net (H) Edison, NJ 08820 WWW: http://www.dell.com/perotsystems USA WWW: http://www.agentisolutions.com WWW: http://Ron.vanHoof.name -----------------------------------------------------------------------