next up previous FTOOLS Home
Next: Sub-package Development Up: Developer's Guide Previous: Host Task Integration

General Task Development

It is possible for any user on the system to develop tasks that use the FTOOLS package libraries without having access to the ftools account as is required in the previous sections. Assuming that a users wishes to develop the same fdummyftool task as in the earlier example, a subdirectory named fdummyftool should be made under the users home directory:

>mkdir ~/fdummyftool

This directory should contain the same fdummyftool.f, hfdummyftool.c and fdummyftool.par outlined in section 4.3. However, the Makefile and mkpkg files will not be the same. In addition a very small spp main routine must be written:

xfdummyftool.x

task fdummyftool

The Makefile to be used for building the Host version of fdummyftool in the users account is:

Makefile

  # this is site dependent, uncomment for your site!!!
  # For Suns with SC1.0 FORTRAN (assumed)
  F77LIBS = -L/usr/lang/SC1.0 -lF77 -lm
  # For Suns with SC0.0 FORTRAN
  #F77LIBS = -L/usr/lang/SC0.0 -lF77 -lm
  # For DECstations with MIPS FORTRAN
  #F77LIBS = -L/usr/lib/cmplrs/f77 -lI77 -lF77 -lm
  # For DECstations with DEC FORTRAN
  #F77LIBS = -L/usr/lib -lUfor -lfor -lutil -li -lots -lm
  # For Alphas running OSF
  #F77LIBS = -L/usr/lib -ldnet_stub -lUfor -lfor -lFutil -lm -lots -lc
  CFLAGS = -I./
  LIBF = -L/path to/ftools/ftools/host -lftools -lfitsio -lhost
  LIBS = $(LIBF) $(F77LIBS)
  all: fdummyftool
  fdummyftool: hfdummyftool.o fdummyftool.o
        cc -o fdummyftool $(CFLAGS) hfdummyftool.o fdummyftool.o $(LIBS)
  FFLAGS = -c
  fdummyftool.o: fdummyftool.f
        $(FC) $(FFLAGS) $<

The mkpkg to be used for building the IRAF version of fdummyftool in the users account is:

mkpkg

  $set XFLAGS = "-c"
  $set LFLAGS = "-p ftools"
  $checkout libftools.a /path to/ftools/bin/
  $checkout libfitsio.a /path to/ftools/bin/
  $set LIBS = "-lftools -lfitsio"
  $omake xfdummyftool.x
  $omake fdummyftool.f
  $link xfdummyftool.o fdummyftool.o $(LIBS) -o fdummyftool.e
  $delete fdummyftool.o xfdummyftool.o
  $checkin libftools.a /path to/ftools/bin/
  $checkin libfitsio.a /path to/ftools/bin/
  $exit
In these two files the path to is system dependent. Check with your system administrator if you have questions about the path to the ftools account.

In the make.com file, comment out the line moving the executable and parameter file.

To build the Host version of fdummyftool simply execute make from within the subdirectory containing the Makefile. Copy the fdummyftool.par file to the directories defined by the environment variable LOCPFILES described in the User's Guide and you are ready to use the task fdummyftool.

To Build the IRAF version of fdummyftool requires one more step to define the IRAFARCH environment variable:

>setenv IRAFARCH `machine type'

Where the `machine type' in the last line is:

sparc for Sun 4.1 systems

ssun for Sun Solaris systems

Now from the within the subdirectory containing the mkpkg file simple execute mkpkg from the Unix shell prompt. This builds the executable fdummyftool.e. To assign an IRAF task to fdummyftool.e start up IRAF and form the cl> prompt give the command:

cl>task fdummyftool = ~/fdummyftool/fdummyftool.e

The users will now be able to use fdummyftool during this IRAF session by executing fdummyftool from the IRAF cl> prompt.


next up previous FTOOLS Home
Next: Sub-package Development Up: Developer's Guide Previous: Host Task Integration

Web Page Maintained by: Dr. Lawrence E. Brown elwin@redshift.gsfc.nasa.gov