next up previous contents
Next: The Python API Up: The Fortran API Previous: The Fortran API   Contents

Compiling your program

Your Fortran program must be compiled and linked to the CLASS library in the GILDAS compilation environment, so that it can find the modules and entry points described above. Then it should be run in the GILDAS execution environment. Two options are available:

  1. you have write access to the Gildas compilation and installation directories, and it is acceptable that your program is installed together with the other Gildas programs1. If yes, you have to load the usual compilation environment:
      $ cd gildas/gildas-src-XXX/
      $ source admin/gildas-env.sh
    
    Then go where your program can be found and copy the Makefile from the Class main directory:
    $ cd /path/to/program/
    $ cp $gagsrcdir/packages/class/main/Makefile .
    
    Edit this Makefile and replace the targets by your own program on the line EXECUTABLES = . Then type
    $ make
    $ make install
    
    Your program is now visible and executable like any other programs from the execution environment.

  2. you have no write access to the Gildas compilation and installation directories, or you don't want your program to be visible by other users. If yes, you have to load usual compilation environment with the special option ``-u'' (use directory):
      $ cd gildas/gildas-src-XXX/
      $ source admin/gildas-env.sh -u $PWD/integ
    
    Then go where your program can be found and copy the Makefile from the Class main directory:
    $ cd /path/to/program/
    $ cp $gagsrcdir/packages/class/main/Makefile .
    
    Edit this Makefile and replace the targets by your own program on the line EXECUTABLES = . Then type
    $ export gagintdir=/path/to/program/exe  ! Define here a custom installation directory
    $ make
    
    The environment variable $gagintdir has be set to the desired installation directory (create the directory if needed). The Makefile creates a local installation tree under this target. Finally, don't forget to put the path to the executable in your $PATH:
    $ export PATH=/path/to/program/exe/$GAG_EXEC_SYSTEM/bin:$PATH
    


next up previous contents
Next: The Python API Up: The Fortran API Previous: The Fortran API   Contents
Gildas manager 2023-06-01