Setting Up the CRIS/SIS Data Archival Libraries

Last Modified Tuesday, 13-Jan-1998 13:15:04 PST.

These are notes both for the person doing the packing of the routines for transfer and for the person doing the unpacking on the other side.

Much of this could be a bit more automated, but to keep the setup process as clear as possible, it has not been automated...

The Directory Structure

The directory structure used for the data archival libraries is essentially the same format as is used for the data retrieval libraries. The data archive directory(s) will be the same, because obviously you want to read from the same location that the files were written. The lib directory is exactly the same, as it is just the storage location for all libraries (all libraries used in the CRIS/SIS data archival/retrieval scheme that is.) Finally, the src directory is the same base, but of course, we will be using different directories to contain the archival library source than those used for the retrieval libraries.

SRL's current root directory of its data system is

setenv BASE_DIR /home/idunn1/rgr/prototype/
"root" for the data system is an arbitrary choice. This directory will be referred to as ${BASE_DIR}.

These three sub directories should be created (if they have not already been created for the data retrieval package):

mkdir ${BASE_DIR}/data
mkdir ${BASE_DIR}/lib
mkdir ${BASE_DIR}/src

The ${BASE_DIR}/data Directory

Inside the ${BASE_DIR}/data directory, create two directories:
mkdir ${BASE_DIR}/data/cris
mkdir ${BASE_DIR}/data/sis
These are good locations in which the data can be archived. If you place your archive data files here, you will be defining the environment variables which the put and get libraries require as:
setenv L1_CRIS_DATA_BASE_DIRECTORY ${BASE_DIR}/data/cris
setenv L1_SIS_DATA_BASE_DIRECTORY ${BASE_DIR}/data/sis

The ${BASE_DIR}/lib Directory

This is the storage location of the libraries, once they are created. In fact, the Makefiles will automatically move the libraries from where they are built to this location.

The ${BASE_DIR}/src Directory

This is the the directory which will contain all the source and header files from which the libraries will be built, as well as Makefiles which will automate most of the build process.

Create these directories:

mkdir ${BASE_DIR}/src/include
mkdir ${BASE_DIR}/src/lib
Or, in all,
setenv BASE_DIR /home/idunn1/rgr/prototype/
mkdir ${BASE_DIR}/data
mkdir ${BASE_DIR}/lib
mkdir ${BASE_DIR}/src
mkdir ${BASE_DIR}/data/cris
mkdir ${BASE_DIR}/data/sis
mkdir ${BASE_DIR}/src/include
mkdir ${BASE_DIR}/src/lib

At SRL: Creating the Files for Distribution

Create the tar and zip files at SRL:
setenv BASE_DIR /home/idunn1/rgr/prototype

cd ${BASE_DIR}/src/lib
makeSrcArchives.pl crisPutData crisSisPutUtilities sisPutData utilities
	[Enter new version ID]
	[Enter] putDataLibs
	[follow ftp instructions to place files on web server]

cd ${BASE_DIR}/src/include
makeSrcArchives.pl cris sis prototype FileTypes.h PrimaryHeader.h cris.h sis.h hdfi.h
	[Enter new version ID]
	[Enter] crisSisDataHeaders
	[follow ftp instructions to place files on web server]

Remote: Installing the Libraries

Getting the files:

The Unix versions have been tarred and gzipped (.tar.gz) and the PC versions have been zipped (.zip). Get the latest versions of the libraries (putDataLibs) and the include files (crisSisDataHeaders) from the distribution directory. Note that the files in the crisSisDataHeaders package are the same as those used by the data retrieval libraries. If you already have the latest version installed on your system, you do not need to install it again for the data archival libraries.

After setting up the directory structure as directed above, move the library distribution into ${BASE_DIR}/src/lib and move the includes distribution into ${BASE_DIR}/src/include and then unpack them (something like the following:)

setenv BASE_DIR /home/darkalf/bruce/test

mv crisSisDataHeaders-1.00.tar.gz ${BASE_DIR}/src/include
mv putDataLibs-1.00.tar.gz ${BASE_DIR}/src/lib

cd ${BASE_DIR}/src/include
gunzip crisSisDataHeaders-1.00.tar.gz
tar xvf crisSisDataHeaders-1.00.tar
gzip crisSisDataHeaders-1.00.tar

cd ${BASE_DIR}/src/lib
gunzip putDataLibs-1.00.tar.gz 
tar xvf putDataLibs-1.00.tar 
gzip putDataLibs-1.00.tar
There will be a similar set of commands for installing the source and header files on a PC. But you will be dealing with the .zip files and using unzip instead of gunzip and tar.A

If you are curious about what the whole directory structure should look like at this point, here is my recursive listing.

Remote: Unix Port

Editing the Makefiles

There are 4 Makefiles involved which you will need to do slight editing on. Use your favorite editor (vi, of course) to edit, following directions in the Makefiles:

IMPORTANT NOTE: Always run make in crisSisPutUtilities before those in crisPutData or sisPutData, as object files are created in crisSisPutUtilities and moved into crisPutData and sisPutData for incorporation into their respective libraries.

cd ${BASE_DIR}/src/lib/utilities
vi Makefile
make

cd ${BASE_DIR}/src/lib/crisSisPutUtilities
vi Makefile
make

cd ${BASE_DIR}/src/lib/crisPutData
vi Makefile
make

cd ${BASE_DIR}/src/lib/sisPutData
vi Makefile
make
If the 4 makes worked, then your libraries should be ready to go. Look in the lib directory: ${BASE_DIR}/lib and you should see:
libCrisPutData.a   libSisPutData.a    libUtilities.a
Use these libraries as you would any other c library. See the sample Makefile.

The include files corresponding to the library contents will be in ${BASE_DIR}/src/include:

crisPutData.h crisSisPutUtilities.h sisPutData.h utilities.h

Remote: PC Port

The port to PC will be more work, most of which I don't know about. I assume there is the equivalent of the program make for PCs, but I don't know if it will be a DOS or a Windows program. A problem that DOS may have (perhaps not on a Win '95 machine?) is that the file names we use are much more descriptive than allowed in the 8 character names DOS uses.

Also, some of the routines may need to be rewritten, dependent on how good a POSIX compiler can be found. If there is a GNU C compiler for PCs, I highly recommend it's use here.

Another note is that the header file hdfi.h which is a part of the distribution of HDF is required to be in the directory ${BASE_DIR}/src/include. The version of hdfi.h that is included with this distribution is probably unix specific.

bruce