instructions are offered only as a guideline they provides a specific example of how the mixed-language
files were handled successfully on an IBM RISC System 6000 Unix workstation.
1. Create a single file with all of the JPL Fortran ephemeris access subroutines. Name it
jplsubs.f
.
2. Compile the Fortran file without invoking the linkage editor. This creates the object file
jplsubs.o.
The Fortran compiler/linker is
xlf
.
xlf -c jplsubs.f
3. Compile, again without invoking the linkage editor, the C files
novas.c
,
novascon.c
,
solsys2d.c
. This creates the object files
novas.o
,
novascon.o
,
solsys2d.o
:
xlc -c -lm novas.c novascon.c solsys2d.c
The C compiler/linker is
xlc
. The
-lm
option specifically searches the math library.
4. Finally, compile the main function and link it with the object files:
create executable named "app"
search the C math library
search the Fortran
libraries (xlf90)
main function
object files
search in this directory
for -l libraries
xlc -L/usr/lib -lm -lxlf90 -o app main.c novas.o novascon.o solsys2d.o jplsubs.o
In this example, the resulting executable file is named "app." Note especially the use of the
-l
option to force the C compiler/linker to search the Fortran libraries for unresolved references.
Important Note
It is strongly recommended that results obtained from your specific implementation of NOVAS-C
and solarsystem version 2D be checked by comparing to corresponding values published in the
Astronomical Almanac, or by comparing to results obtained from the Fortran version of NOVAS using
subroutine
SOLSYS
version 2-DA.