IUBio Biosequences .. Software .. Molbio soft .. Network News .. FTP

Writing GCG code in C

Peter Rice pmr at unst.sanger.ac.uk
Thu Mar 2 05:31:14 EST 1995


Some questions for those who write or modify GCG source code.

As part of the EGCG 8.0 development, we have now an extensive
EGenLib procedure library which is used throughout all the main
programs.

EGenLib is implemented almost completely in Fortran, though some had
to be in C for practical reasons. The main programs are also in
Fortran. We saw no need to rewrite everything in C, and the Unix
porting has gone reasonably smoothly.

Now we have a decision to make.

New GCG main programs appear to be in C. If we start developing in C,
or if we extend any GCG C programs, we need to be able to call our
EGenLib procedure library.

So, the proposal is: 

How should we implement the interface between C main programs and
the existing Fortran routines?

We can do the following:

1. Force the C programmers to do all the work, which will ruin the
   readability of the C code by having to convert all calls to be
   by reference (and make headaches for VMS conversion). We don't
   want to take this approach, of course.

2. Implement a front end set of stub routines for every routine in
   EGenLib, rather as GCG do for calls from Fortran to C, which will
   take a major effort.

3. Some compromise to save us coding, where only string handling
   goes through stub routines (so we can convert them on VMS
   systems within the procedure library) and we provide a standard
   calling mechanism which excludes call-by-value. We would provide
   a conversion from constant values to references somehow, unless
   anyone knows a better way.

4. We can implement a single header file for all C main programs

5. We can split the header files into many separate classes. GCG 8.0
   has 122 of them, and the program usually crashes at run time if
   you leave an include of a ".h" file out.

We need to pick a strategy soon, because once we start using C code the
method of calling will become fixed.

Any method that requires a large effort in development and/or maintenance
will obviously slow down new developments.

Actually, I had always assumed this *would* be a major effort, but yesterday
I implemented a change to a C main program that worked rather easily
and realised we could implement an interface without too much effort
so long as other users would be happy with a few compromises.

For more information on EGCG 8.0, the URL is:

ftp://ftp.sanger.ac.uk/pub/pmr/egcg8/release.notes

or see my home Web page:

URL: http://www.sanger.ac.uk/~pmr

------------------------------------------------------------------------
Peter Rice                           | Informatics Division
E-mail: pmr at sanger.ac.uk             | The Sanger Centre
Tel: (44) 1223 494967                | Hinxton Hall, Hinxton,
Fax: (44) 1223 494919                | Cambs, CB10 1RQ
URL: http://www.sanger.ac.uk/~pmr    | England
--
------------------------------------------------------------------------
Peter Rice                           | Informatics Division
E-mail: pmr at sanger.ac.uk             | The Sanger Centre
Tel: (44) 1223 494967                | Hinxton Hall, Hinxton,
Fax: (44) 1223 494919                | Cambs, CB10 1RQ
URL: http://www.sanger.ac.uk/~pmr    | England



More information about the Info-gcg mailing list

Send comments to us at biosci-help [At] net.bio.net