Getting Started with CTT: Setting Up Your UNIX Account

The document IMSL Computational Technology Toolkit contains an overview of CTT and information on its use that should be read prior to reading this document.

The CTT package from VNI Inc. is installed in the directory /opt/vni/ on Strauss only. The installation directory will be referred to as CTT_DIR throughout this docuement and others. The configuration changes to your UNIX account suggested in this document will only affect your computing environment when you are on Strauss.

You must define a series of environment variables (including the CTT installation directory CTT_DIR) to use CTT. You must also source (i.e., execute the commands in) the file $CTT_DIR/ctt/bin/cttsetup.csh. Rather than repeatedly issuing these and other commands to enable you to program using CTT, this document suggests a series of changes to your configuration files that accomplish the same objective.

This documentation assumes that your UNIX account's configuration ("dot") files match, or are based upon, the User Services recommended configuration files: .cshrc, .login, .localalias, and .localenv. These files are found in the /opt/proto directory. Typing the UNIX command

  ~consult/proto/setup
will cause your current configuration files to be renamed (for backup purposes) and replaced with the standard configuration files. The system will display the names of the renamed and replacement files.

Choose the correct CTT location and load libraries

There are several CTT versions in the /opt/vni directory. There are three things to consider before you begin using CTT.

  1. Choose the newest version which works with the compiler you are going to use for your project.
  2. Name your programs following conventional suffix rules.
  3. Choose a version of the load libraries to use for all of your programs.
Here is a table with the most recent versions which work with the Sun Studio 9 compilers.

Language CTT Directory Suffix Load libraries
Fortran 90/95 /opt/vni/CTT6.1 .f90 $LINK_F90_SMP
Fortran 77 /opt/vni/CTT6.1 .f $LINK_FNL_SMP
C /opt/vni/CTT5.0 .c $LINK_CNL_PERF

Configuration changes to identify the CTT package location

Choose the correct CTT directory from the table above. For Fortran 90, add the following lines to your ~/.localenv file:
# IMSL Computational Technology Toolkit installation directory
setenv CTT_DIR /opt/vni/CTT6.1
if ! -d $CTT_DIR  unsetenv CTT_DIR

This example illustrates choosing the directory for Fortran 90.

These commands cause the CTT_DIR environment variable to be set properly each time you start a session on Strauss. Whenever a new version of CTT is installed, you will need to update the setenv CTT_DIR line in this file.

Configuration changes to define the UNIX environment for the CTT package

Creating some aliases (user-defined commands) in your ~/.localalias file will reduce the future typing needed to use CTT. Choose the appropriate load library, and add the following lines to start a shell on Strauss with the relevant environment variables set.
if $?CTT_DIR then
  alias cttshell "(setenv NEED_CTT; newgrp \!*)"
else
  alias cttshell echo "CTT not available on `uname -n`"
endif
if $?NEED_CTT then
  source $CTT_DIR/ctt/bin/cttsetup.csh
# CTT load library for Fortran 90
  setenv LDLIBS "$LINK_F90_SMP"
endif

This example illustrates choosing the load libraries for Fortran 90.

These commands will cause two commands to run at the beginning of any shell with NEED_CTT set. If for any reason, you want to change the load libraries, you may explicitly type a different setenv LDLIBS shell command, or update the setenv LDLIBS line in this file.

Using the cttshell command

The next time you log onto Strauss, you will be able to start a CTT-configured shell with the command
  cttshell 
To associate the new shell with a different group project id (e.g., a UNIX group assigned to a class), type the following command instead:
  cttshell project
where project is your 4-digit group project number.

Since you have named your program with the .f90 suffix, and put the correct setenv LDLIBS command in your setup files, you can compile and run with two commands:

make program 
./program

This example illustrates compiling and running a program with basename program. The "basename" is the file name without the suffix.

Configuration changes for used with X Windows servers

A work environment having multiple windows provides a more efficient and productive setting for programming with CTT. Use of any workstation functioning as an X Windows server will allow you to open several windows at once - a documentation window, an editor window and a compile/run window - to do your program development. This could be done on

Effective use of any of these X Windows servers requires you to further modify your UNIX configuration files. These changes are described in the document X Windows configuration setup for using CTT.

[Back to CTT home page]

Last modified: May 19, 2005
This page maintained by Dean Nairn
Copyright © University of Delaware, 2005.