Installation and configuration of the FPIPE
Installation and configuration of the FPIPE
Checkout and installation
In the following, we assume that the [library] has been installed and configured correctly as this condition is mandatory for a successful installation of the FPIPE.
The FPIPE can be obtained via [[1]] with the following command:
git clone git://git.tokkee.org/fpipe.git
NOTE: this URL is due to change in the future.
The repository will then be checked out into your current directory (for some useful commands for GIT you can look at the Short introduction to GIT).
As soon as the checkout process is completed, you will find a new directory named fpipe in your current directory. For the next steps, we change to the directory fpipe/software, which contains installation scripts, configuration files etc.
cd fpipe/software
In order to create the configure file which we need for doing system checks and preparing the library for installation, we invoke
./bootstrap.sh
Having done that, a script named configure should have been created in the current directory, which we will start now. In order to enable debugging messages which are very useful for developing software with the FPIPE, we use the parameter enable-debug. Moreover we want the script to install the compiled library in fpipe/target instead of the default system path as we probably wouldn't have the appropriate permission to do so.
./configure --prefix=PATH_TO_YOUR_FPIPE_DIR/fpipe/target --enable-debug=10
Of course, you have to replace PATH_TO_YOUR_FPIPE_DIR by the appropriate path which will in most cases be the path to your home directory or just $HOME.
Once the configure script is finished without errors, we run a simple
make
followed by a
make install
In case you didn't specify a prefix when invoking the configure script and don't have write permissions to the system directories you will most probably encounter errors in this step. However, you can easily correct this by going back to the configure step and running it again with an appropriate prefix.
Once having completed all steps without encountering any errors, the FPIPE is installed correctly. If you have any further questions or run into problems, there exist much more sophisticated documentations than this one in fpipe/software/README and fpipe/software/INSTALL.
Configuration
Basically there is no need to do any changes to the configuration if you just want to play around with the existing tools. However, as soon as you write your own program which makes use of fpipe libraries and which should be built with and integrated in the fpipe later on you have to modify a few things.
Let's assume that you've written the program fpBooFoo whose source files reside in
FPIPEDIR/software/pipeline_ftools/fpboofoo
This is the standard directory for all fpipe tools, so most of the time you will be working there (again, replace FPIPEDIR with the corresponding path where the fpipe main directory can be found, e.g. /home/myuser/fpipe).
First of all you have to modify
FPIPEDIR/software/configure.ac
so grab an editor of your choice and open it. Then look for something that looks like the following code block:
AC_FTOOL([fpapplygain], [yes])
AC_FTOOL([fpcalcgain], [yes])
AC_FTOOL([fpcalcnoise], [yes])
AC_FTOOL([fpcalcoffset], [yes])
AC_FTOOL([fpcalcresidualoffset], [yes])
AC_FTOOL([fpcmsimulator], [no])
AC_FTOOL([fpcommonmode], [yes])
AC_FTOOL([fpcopycontrol], [yes])
AC_FTOOL([fpeventfeeder], [yes])
AC_FTOOL([fpfindevents], [yes])
AC_FTOOL([fpfitseventfeeder], [yes])
AC_FTOOL([fpcopyfitseventfeeder], [yes])
AC_FTOOL([fpframes2fits], [yes])
AC_FTOOL([fpraw2fits], [yes])
AC_FTOOL([fpimage], [yes])
AC_FTOOL([fpipeservercmd], [yes])
AC_FTOOL([fpintensity], [yes])
AC_FTOOL([fpixoacm2fits], [no])
AC_FTOOL([fpixosvm2fits], [no])
AC_FTOOL([fplightcurve], [yes])
AC_FTOOL([fpmakebadpixel], [yes])
AC_FTOOL([fpplot2], [yes])
AC_FTOOL([fpspectrum], [yes])
AC_FTOOL([fptests], [yes])
AC_FTOOL([fptemplate], [no])
AC_FTOOL([fputils], [yes])
These lines tell the compiler which programs to build. The yes/no-tags additionally tell whether the program should be built when doing a 'final build'. First of all you want the compiler to include your program at least in the experimental builds, so you append the line
AC_FTOOL([fpboofoo], [no])
Having done that, watch out for the following rather longish block of code:
AC_CONFIG_FILES([Makefile
fpipelib/Makefile
utils/Makefile
pipeline_driver/Makefile
pipeline_ftools/Makefile
pipeline_ftools/fpspectrum/Makefile
pipeline_ftools/fplightcurve/Makefile
pipeline_ftools/fpcopycontrol/Makefile
pipeline_ftools/fpintensity/Makefile
pipeline_ftools/fpplot2/Makefile
pipeline_ftools/fpplot2/gtk_fp_spec_plot/Makefile
pipeline_ftools/fpeventfeeder/Makefile
pipeline_ftools/fpfitseventfeeder/Makefile
pipeline_ftools/fpcopyfitseventfeeder/Makefile
pipeline_ftools/fpframes2fits/Makefile
pipeline_ftools/fpframes2fits/tests/Makefile
pipeline_ftools/fpraw2fits/Makefile
pipeline_ftools/fpixosvm2fits/Makefile
pipeline_ftools/fpixoacm2fits/Makefile
pipeline_ftools/fpcommonmode/Makefile
pipeline_ftools/fpcalcoffset/Makefile
pipeline_ftools/fpcalcnoise/Makefile
pipeline_ftools/fpfindevents/Makefile
pipeline_ftools/fpcalcgain/Makefile
pipeline_ftools/fptests/Makefile
pipeline_ftools/fputils/Makefile
pipeline_ftools/fpapplygain/Makefile
pipeline_ftools/fpcalcresidualoffset/Makefile
pipeline_ftools/fpmakebadpixel/Makefile
pipeline_ftools/fpcmsimulator/Makefile
pipeline_ftools/fptemplate/Makefile
pipeline_ftools/fpfindbadpixel/Makefile
pipeline_ftools/fpfindcoldpixel/Makefile
pipeline_ftools/fpimage/Makefile
pipeline_ftools/fpipeservercmd/Makefile ])
Here we define the locations of all makefiles which are needed in order to get the compilation and building process running. As your programm will get its own makefile too (this will be done automatically as soon as we have done all the configuration stuff) we need to insert somewhere in the middle (or append at the end - but watch out for the brackets!) the following line:
pipeline_ftools/fpboofoo/Makefile
The third (and - for this file - the last) bunch of code you have to look for is this:
fpapplygain: $enable_fpapplygain
fpcalcgain: $enable_fpcalcgain
fpcalcnoise: $enable_fpcalcnoise
fpcalcoffset: $enable_fpcalcoffset
fpcalcresidualoffset: $enable_fpcalcresidualoffset
fpcmsimulator: $enable_fpcmsimulator
fpcommonmode: $enable_fpcommonmode
fpcopycontrol: $enable_fpcopycontrol
fpcopyfitseventfeeder:$enable_fpcopyfitseventfeeder
fpeventfeeder: $enable_fpeventfeeder
fpfindevents: $enable_fpfindevents
fpfitseventfeeder: $enable_fpfitseventfeeder
fpframes2fits: $enable_fpframes2fits
fpimage: $enable_fpimage
fpipeservercmd: $enable_fpipeservercmd
fpintensity: $enable_fpintensity
fpixoacm2fits: $enable_fpixoacm2fits
fpixosvm2fits: $enable_fpixosvm2fits
fplightcurve: $enable_fplightcurve
fpmakebadpixel: $enable_fpmakebadpixel
fpraw2fits: $enable_fpraw2fits
fpplot2: $enable_fpplot2
fpspectrum: $enable_fpspectrum
fptemplate: $enable_fptemplate
fptests: $enable_fptests
fputils: $enable_fputils
fpfindbadpixel: $enable_fpfindbadpixel
fpfindcoldpixel: $enable_fpfindcoldpixel
EOF
Actually it is not necessary to do any modifications here as this will just generate a nice output when invoking the configure-script but won't have any effect on the building process. But as we don't want to work sleazily we insert **before the EOF** the following line:
fpboofoo: $enable_fpboofoo
For the next step you have to switch to the directory fpipe/software/pipeline_ftools, so most probably you now want to do a
cd pipeline_ftools
Open the file
Makefile.am
with the editor of your choice and append the following lines to the end of the file:
if ENABLE_FTOOL_fpboofoo
SUBDIRS += fpboofoo
endif
These lines are used by make in order to set its variables correctly which are needed in the build process.
Having saved the modified Makefile.am there is just one last thing to do. In order to tell the program make what to do with our source code we need another Makefile.am (with different contents than the one we just saw) in the directory of our program. Instead of writing it by ourselves we can just copy it from one of the other fpipe tools and modify it to fit our needs. So for example do a
cd fplightcurve
cp Makefile.am ../fpboofoo/
cd ../fpboofoo
and open the freshly copied Makefile.am with an editor.
You will see something like
AM_CFLAGS = -Wall -Werror
AM_CPPFLAGS = -I${HEADAS}/include -I@top_srcdir@/fpipelib
bin_PROGRAMS = FPLightcurve
FPLightcurve_SOURCES = FPLightcurve.c FPLightcurve.h
FPLightcurve_LDFLAGS = @lib_cfitsio@
FPLightcurve_LDADD = @top_builddir@/fpipelib/libfpipe.la @top_builddir@/fpipelib/libfpRWlock.la
pfilesdir = @PFILESDIR@
dist_pfiles_DATA = FPLightcurve.par
Replace all occurrences of FPLightcurve with FPBooFoo such that the final Makefile.am looks like this:
AM_CFLAGS = -Wall -Werror
AM_CPPFLAGS = -I${HEADAS}/include -I@top_srcdir@/fpipelib
bin_PROGRAMS = FPBooFoo
FPBooFoo_SOURCES = FPBooFoo.c FPBooFoo.h
FPBooFoo_LDFLAGS = @lib_cfitsio@
FPBooFoo_LDADD = @top_builddir@/fpipelib/libfpipe.la @top_builddir@/fpipelib/libfpRWlock.la
pfilesdir = @PFILESDIR@
dist_pfiles_DATA = FPBooFoo.par
Of course you have to leave the respective entries away if you don't have these files (e.g. you wouldn't write FPBooFoo.h if you had no corresponding header-file).
Finally, switch back to the main directory and re-build everything, i.e.:
cd ../.. ./bootstrap.sh ./configure --prefix=PATH_TO_YOUR_FPIPE_DIR/fpipe/target --enable-debug=10 make make install
Given that no errors occurred you have integrated your program successfully into the fpipe. For each and every new tool you will have to repeat this process.
Additional important configuration information for Mac Users
Requirements for the fpipe:
- cfitsio library installed** (Headas) - follow the description [| here] \\
(get gktimageview from http://trac.bjourne.webfactional.com/chrome/common/releases/ configure and install gtkimageview (default configuration))
How to install
You most likely have to change the configure.ac in the software directory of the fpipe \\ Replace the search for .so files in a search for .dylib - you have to do that for cfitsio and xpalib\\ Replace the %5lu in /Path/to/fpipe/software/pipeline_ftools/fpplot2/test.c in all lines with %p or blockcomment the //printf// functions. This is due to the fact that in some environments (e.g. some versions of HPUX, Mac OS X) //pthread_t// is defined as a structure, not an integer. \\ In /Path/to/fpipe/software/configure.ac **turn off** the fpfitseventfeeder tool and fpimage.\\ In /Path/to/fpipe/software/get-revision.sh delete the -n of echo "-n\"$rev\"" \\ As already shown in the general configuration chapter, run the following commands:
/Path/to/fpipe/software/bootstrap.sh /Path/to/fpipe/software/configure (PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
(only when you did the default installation like shown in requirements - otherwise you have to adopt) + e.g --prefix or --enable-debug
make make install
If you want to run that in eclipse you have to compile it the first time in terminal, then it should work.\\ If you want to use the binaries from inside eclipse you have to use the apple development tools /Developer/Applications/Utilities/ and start the Property List Editor and create a .plist file with the child(key) DYLD_LIBRARY_PATH /path/to/headas/platform/lib. The reason for that is that environment variables are not set in applications started via finder on Mac OS X. \\ Alternative: Start Eclipse via terminal (/Applications/Eclipse/Eclipse.app/Contents/MacOS/eclipse). The environment variables should now be found by eclipse.