Obtain your individual username, password, and assignment of which node on the Thor cluster you will use from the tutorial staff.
Use an ssh client to login to the appropriate system.
If you're working on a Linux or other unix-based system, you will probably use a command like ssh -l username thorN.cs.indiana.edu. You will be prompted for your password.
There are a variety of ssh clients for Windows. In PuTTY, for example, you would enter the thorN.cs.indiana.edu in the -> field of PuTTY Configuration window. Make sure the is set to , as well. On the page, set the field to the username you were given. Finally, return to the page, give these settings a name, such as cca-tutorial in the field and click the button. This will allow you to quickly load these settings when you have to log back in later.
If you have trouble getting your ssh client to connect to the Thor cluster, please ask for assistance.
We have written this guide so that all exercises can be performed simply using the command line tools, so it is not necessary for you to have an X11 server on your local system. If you do have an X11 server available, you may wish to try to use the GUI front-end for Ccaffeine in some of these exercises, and you may prefer to use the graphical version of your favorite text editor or other tools. However if the network performance between here and Indiana is poor, or systems on either end are too heavily loaded, the X11 option may be too slow for your taste. For these reasons, and depending on the defaults on your ssh client, you may need to enable or disable tunneling of the X11 protocol through the ssh session.
On unix/Linux clients, the command line switches -x and -X disable and enable X11 forwarding.
On PuTTY, there is a checkbox toon the -> -> configuration page.
Since the CCA tools are not installed on this system in the “usual” locations (i.e. /usr/bin or /usr/local/bin), you must setup your login environment to the appropriate directories to your PATH and LD_LIBRARY_PATH. To speed things along, we've created a short script that you can just include in your login files.
Type echo $SHELL to determine which shell you're running. If it is a C-shell variant (i.e. /bin/tcsh or /bin/csh) then perform Step 3.a. If it is a Bourne shell variant (i.e. /bin/bash or /bin/sh) then perform Step 3.b.
Edit ~/.cshrc and at the end of the file, add the line
Edit ~/.profile and at the end of the file, add the line
Note that you cannot use $CCA/share/cca.cshrc.thor (or $CCA/share/cca.profile.thor) in this case because this is the file that defines the $CCA environment variable !
You may wish to take a moment to read through this file to understand what it is doing to your environment. Each section is commented.
In order for these changes to affect your environment, you need to log out and log back in again. After you've done this, check that you're getting the new settings. If you type echo $CCA, you should get /san/shared/cca/tutorial. If you type which ccafe-single. you should get /san/shared/cca/tutorial/bin/ccafe-single. If you don't get these results, please ask for assistance.
In order to get a private copy of the tutorial source tree that you can work on, make sure you're in your home directory and enter tar xf $CCA/share/student-src.tar. This should give you a directory tree named student-src. This tree is the same as the pre-built on in $CCA/src except that we have removed all of the files that you'll be creating and "unmodified" the ones you'll be modifying as you work through the exercises.
The layout of the tutorial source code tree was designed to make it easy to introduce new components and ports and have everything built with make with minimal configuration. The tree is laid out so that much of the information the build system needs comes directly from the file and directory names. If you cd into student-src, you should see a number of subdirectories. Of primary interest are:
The source code for the various components lives in this tree. The general structure is student-src/components/component_name/implementation_language. Exceptions are the student-src/components/sidl and student-src/components/examples directories, which contain the SIDL definitions for the components and example scripts, respectively.
This is where the legacy libraries that you will componentize in Chapter 4, Creating a Component from an Existing Library reside.
student-src/ports/sidl contains the SIDL files for the ports (SIDL interfaces) needed for the tutorial. The code generated by Babel for these interfaces will be put into directories like student-src/ports/SIDL_package_name/language and compiled into libraries. Both the user and provider of a port need to link against the port's library.
The next step is to build the tree. Although it is incomplete with respect to the code you're going to add in these exercises, everything that is there should build correctly.
Change directories to student-src and type make. This command will take several minutes to complete, and you may want to use this time to read ahead a bit. When it 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.
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 (you'll understand this better after the next chapter). 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. ==== #### Testing component connection and execution. **** **** Some run tests did NOT succeed, go command failed (see \ examples/ex1_rc.log). ****
Note that the test of component connection and execution is expected to fail at the moment, because it expects to have all of the components available, whereas at the moment, the ones you're going to write in these hands-on exercises are missing. The main thing to look for at this moment was that all components that are present could be instantiated (the first test).
Now you should be ready for the first exercise.
If you move your student-src tree to another location (for example, rearranging your directory structure, or moving a copy of your thor directory tree to your home system to continue these exercises on your own), you will need to do a make clean rebuild the tree (starting with Building the tutorial source tree, above). Otherwise many of the generated files (rc files and the like) will contain the incorrect path.