| 1 |
|
| 2 |
Via the makefile the different ftoc_xyz.h files are copied to ftoc_test.h |
| 3 |
(in $MIDASHOME/$MIDVERS/incl) and for each ftoc_xyz.h the module ftoc_test.c |
| 4 |
(generated from ftoc_test.fc) is compiled again with this new include file, |
| 5 |
and a new ftoc_xyz.exe (which is the for_test.exe with the include file |
| 6 |
ftoc_xyz.h) is built. |
| 7 |
|
| 8 |
Then the shell script ftoc_params (in ../exec) is executed which checks |
| 9 |
each of the ftoc_xyz.exe and, if all is o.k., it returns the corresponding |
| 10 |
ftoc_xyz.h file |
| 11 |
which is then copied for good to ftoc.h for the Midas installation. |
| 12 |
A message indicating which include file matched is displayed as well. |
| 13 |
|
| 14 |
If there's no success, a warning message is displayed and one has to try |
| 15 |
manually to find the mechanism how Fortran parameters are passed to the |
| 16 |
C-stack by the compiler. |
| 17 |
|
| 18 |
------------------------------------------------------------------------ |
| 19 |
|
| 20 |
For testing an unknown Fortran / C parameter passing mechanism there |
| 21 |
are two more executables available: |
| 22 |
ftoc_test.exe, ftoc_stack.exe |
| 23 |
which are compiled and linked via the "maketest" makefile: |
| 24 |
$ make -f maketest |
| 25 |
|
| 26 |
but it's better to compile it non-optimized: |
| 27 |
$ make DEBUG=-g STRIP=echo C_OPT= -f maketest |
| 28 |
|
| 29 |
ftoc_stack.fc (as well as ftoc_test.fc) includes file ftoc_test.h, |
| 30 |
so one should copy the most likely ftoc_xyz.h file to ftoc_test.h by hand. |
| 31 |
OJO: ftoc_test.h was set to the last trial ftoc_xyz.h in the general make - |
| 32 |
so it usually has to be reset manually. |
| 33 |
To display the parametrer stack common code for the different subroutines, |
| 34 |
which is stored in stack_dump.h is used within ftoc_stack.fc (all include (.h) |
| 35 |
files are in /midas/version/incl). |
| 36 |
As Fortran front-end the module for_try.for contains the calls to |
| 37 |
various subroutines of ftoc_test.fc with different calling sequences and |
| 38 |
parameters. |
| 39 |
|
| 40 |
ftoc_test.fc also includes file ftoc_test.h (in /midas/version/incl) and |
| 41 |
calls 3 different C routines (SSP1, SSP2, SSP3) checking the parameters |
| 42 |
in the routines with the values passed in for_test.for. If all is o.k., a |
| 43 |
status of 0 is returned. |
| 44 |
|
| 45 |
To compile and link these modules, do: |
| 46 |
|
| 47 |
$ make -f maketest basic |
| 48 |
which creates ftoc_test.exe |
| 49 |
|
| 50 |
$ make -f maketest stack |
| 51 |
which creates ftoc_stack.exe |
| 52 |
|
| 53 |
$ ../exec/ftoc_stack.exe |
| 54 |
|
| 55 |
should show the layout of the stack somewhat better for different subroutine |
| 56 |
calls. |
| 57 |
|
| 58 |
Testing a new compiler setup involves then modifying the ftoc_test.h file |
| 59 |
and also stack_dump.h. |
| 60 |
The changes to ftoc_stack.fc would be mainly to toggle the flags (nogo) for |
| 61 |
the different stack entries to avoid SEG faults through invalid pointers. |
| 62 |
Then do the makes as indicated above, and keep trying ... |
| 63 |
|
| 64 |
For more details, read ./doc/modules.txt. |
| 65 |
|
| 66 |
------------------------------------------------------------------------ |
| 67 |
|
| 68 |
on Solaris: |
| 69 |
kbanse@dmdsol8b$ ../exec/ftoc_names.exe |
| 70 |
-fl_ |
| 71 |
Note: Nonstandard floating-point mode enabled |
| 72 |
See the Numerical Computation Guide, ieee_sun(3M) |
| 73 |
|
| 74 |
on Linux: |
| 75 |
somidas@pc004351> ../exec/ftoc_names.exe |
| 76 |
-fl_ |
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
060228 KB |
| 83 |
|