How to install CFITSIO
   $ ./configure --prefix=/home/jmlarsen/BUILD/cfitsio/ && make shared && make install


How to build:

   $ ./bootstrap
   $ ./configure --prefix=/home/jmlarsen/BUILD/uves --enable-maintainer-mode CFLAGS='-W -Wall -std=c99 -pedantic -fno-common -Wundef -Wuninitialized -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wsign-compare -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wnested-externs -Wdisabled-optimization -Wformat-y2k -Wmissing-noreturn -Wredundant-decls -Wvariadic-macros -Wold-style-definition -Wdeclaration-after-statement -Winit-self -Wmissing-include-dirs -Wvolatile-register-var -fgnu89-inline'
   $ make
   $ make install


After installation

   $ make check

to check that the installation is complete

   $ make html

builds the doxygen documentation


How to clean:

   $ make uninstall
   $ make clean
or
   $ make maintainer-clean



How to check for memory leaks:
   $ ./configure --enable-debug  (to turn on file + linenumber)
   $  LD_PRELOAD=/home/jmlarsen/BUILD/uves/lib/uves/plugins/uves-0.8.3/uves_response.so valgrind --leak-check=yes --show-reachable=yes --num-callers=50 esorex  uves_response  data/sof/blue/uves_response.sof




How to profile unit tests:
  > make clean 
  > ./configure --enable-static CFLAGS='-ftest-coverage -fprofile-arcs -g -pg' 
  > make
  > make LDFLAGS='-static' check
  > find `pwd` -type d | perl -nle 'chdir $_; system("gcov *.c");'

To profile [module]-test:
  > cd tests
  > [module]-test
  > gprof [module]-test

Coverage info:
  Study [module].c.gcov residing in the same directory as [module].c







How to profile a recipe:
    $ profile_build -j=3 -builddir=~/BUILD_PROF -esorexsrc=~/esorex-3.6.1 -iiinstrumentsrc=~/uvesp -cplsrc=~/cpl-3.1 -qfitssrc=~/qfits-6.2.0 -cfitsiosrc=~/cfitsio/ -iiinstrumentlib=flames,uves,cfitsio uves_mbias
    $ ~/BUILD_PROF/bin/esorex uves_mbias uves_mbias.sof
    $ gprof ~/BUILD_PROF/bin/esorex






Libraries are connected in this way:

 UVES-plugins  ---dyn.--->  libuves ---stat.---> IRPLIB
                                   
                              /\
                               |
                               |
                              dyn.
                               |
                               |

FLAMES-plugins  ---dyn.--->  libflames

(i.e. FLAMES knows about UVES but not the other way around). For each
dynamic link it is verified at runtime (i.e. linktime) that the
version numbers match.
