Appendix C. Building the Tutorial and Student Code Trees

$Revision: 1.10 $

$Date: 2005/11/11 22:24:59 $

The code for the tutorial itself comes in two forms, with pointers to both at http://www.cca-forum.org/tutorials/#sources. The file tutorial-src-version.tar.gz is the complete package, which has the full code for all of the components created in this Guide as well as a number of others. The file student-src-version.tar.gz is a stripped-down version of the tutorial code, from which we've removed all of the components created in working through this Guide.

[Note] Note

At the time this particular version of the Hands-On Guide was generated, the version was 0.4.1_rc1. If there's a more recent version available, you should probably use it, but you should also look for a more current version of this Guide to go with it. Both should have the same base version number (i.e. 0.4.1) with different release numbers. Take the highest available release number. Note too that because both the CCA tools and the tutorial code are evolving over time, you should make sure to use the version of the CCA tools distribution that is recommended for the particular tutorial version you're working with.

In order to give you a richer set of components to play with initially, we use the tutorial-src tree in Chapter 2, Assembling and Running a CCA Application, and the student-src tree for the remaining exercises. Throughout, the tutorial-src tree can be used as a reference, so see how things should look when you complete the exercises.

If you're participating in an organized tutorial, we will have built the tutorial-src tree for you in advance in a common location, whereas if you're working through these exercises on your own, you'll need to build it yourself. In both cases, you'll need to build your own copy of the student-src tree to work in. The procedure for both is nearly identical, and unless otherwise indicated, we will use tutorial-src to indicate either tutorial-src or student-src.

[Tip] Tip

Make sure you've setup your login environment per Section B.4, “Setting Up Your Login Environment”. To complete the procedures in this section, you will need to have Babel and Ccaffeine in your execution path, and your LD_LIBRARY_PATH.

  1. Download the file(s) you need from the location above. (If you're participating in an organized tutorial, the student-src-version.tar.gz tar file will already be on the system system, in the location indicated in your account information handout.)

  2. Untar the file in a convenient place with tar zxf tutorial-src-version.tar.gz. When it completes, change directories into the new code tree.

  3. The code tree includes components written in C, C++, F90, and Python. You may need to configure the code tree according to the languages you have available (dependent on how the CCA tools were built in Appendix B, Building the CCA Tools and TAU, and Setting Up Your Environment). Run ./configure --with-languages="f90 c cxx python" using the appropriate space-separated list of languages for your environment. The default is to include the languages for which Babel was configured when the CCA tools were installed (see Appendix B, Building the CCA Tools and TAU, and Setting Up Your Environment).

  4. Once the tree is configured, type make to build it. This step may take several minutes. At the end of the build output, you should see a list of components that were successfully built, such as:

    SUCCESS building arrayDrivers.CDriver
    

    and when it finally completes, you should see this message:

    ################ Finished building everything #################
    ####### You can run some simple tests with 'make check' #######
    

    If the build terminates with an error message instead, please ask for assistance.

  5. Once the build is complete, you can type make check to perform a basic check that the component have been built correctly. This is a convenience of the Makefile system we've put together for the tutorial that tries to instantiate each component within the Ccaffeine framework. This provides a basic check that the software you've built are “well-formed” CCA components. You should see a message like this, along with a couple of lines of output from make itself:

     
    #### Testing component instantiation.
    
    ====
    ==== Simple tests passed, all built components were successfully \
         instantiated.
    ====
    
    Test simple example involving a subset of the available languages: \
         c cxx f90 f77 python java
    
    #### Testing component connection and execution.
    
    ====
    ==== All simple run tests passed, go command executed successfully.
    ====
    

    Note that the second test (“Testing component connection and execution” is expected to fail at this stage when building the student-src tree because the component you're going to write in these exercises are missing. Both tests should succeed for the tutorial-src tree.