Tim,
On 2004 Jul 7 , at 22.42, Tim Jenness wrote:
> I'm just looking at the tests for MERS and I'm having a bit of trouble
> with err_test.c (which I've renamed err_ctest.c). It seems that if
> alink finds it is compiling a C routine it does something special
> during
> the link.
Nothing particularly special. If the first file argument to alink is
wibble.c, then alink creates a new file dtask_wrap.c containing
#include "f77.h"
void wibble(int *status);
F77_SUBROUTINE(dtask_wrap)(INTEGER(fstatus)) {
int status;
F77_IMPORT_INTEGER(*fstatus,status);
wibble(&status);
F77_EXPORT_INTEGER(status,*fstatus);
return;
}
...and it is subroutine dtask_wrap which is invoked by the generated
(Fortran) main function. Looking at current err_test.c, it looks to
have the expected form.
Now, alink expects to compile its first argument as well -- it's
err_test.c, not err_test.o, that it's given as argument. Is the right
rule being used to build err_test?
Norman
--
----------------------------------------------------------------------
Norman Gray / http://www.astro.gla.ac.uk/users/norman/
Physics & Astronomy, Glasgow University, UK /
http://www.starlink.ac.uk
|