Setting Up the CRIS/SIS Data Retrieval Libraries

Last Modified Tuesday, 13-Jan-1998 13:20:48 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

Only the details relevant to setting up a data archive and the retrieval libraries will be covered here. 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:

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 get libraries require as:
setenv L1_CRIS_DATA_BASE_DIRECTORY ${BASE_DIR}/data/cris
setenv L1_SIS_DATA_BASE_DIRECTORY ${BASE_DIR}/data/sis
No more will be said here on the subject of data archiving.

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 crisGetData crisSisGetUtilities sisGetData utilities
	[Enter new version ID]
	[Enter] getDataLibs
	[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 (getDataLibs) and the include files (crisSisDataHeaders) from the distribution directory. Note that the crisSisDataHeaders files are the same as those used by the data archival libraries as well.

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 getDataLibs-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 getDataLibs-1.00.tar.gz 
tar xvf getDataLibs-1.00.tar 
gzip getDataLibs-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 crisSisGetUtilities before those in crisGetData or sisGetData, as object files are created in crisSisGetUtilities and moved into crisGetData and sisGetData for incorporation into their respective libraries.

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

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

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

cd ${BASE_DIR}/src/lib/sisGetData
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:
libCrisGetData.a   libSisGetData.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:

crisGetData.h crisSisGetUtilities.h sisGetData.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