Preliminaries: This package requires a Fortran compiler to compile. It works with g95, gfortran, g77 and even f2c. It also depends on but does not include the PGPLOT and FITSIO libraries. There are two ways to do get these: 1. You can download and install HEASOFT. Although HEASOFT includes qdp it is not the latest version and the included version of PGPLOT does not include /png and lextrct is not provided. If you install HEASOFT it is recommended that you disable the HEASOFT versions of files that are duplicated by first: cd $HEADAS/bin/ mv qdp qdp.headas mv cod cod.headas mv hlpdhf hlpdhf.headas mv dhfhlp dhfhlp.headas mv xhelp xhelp.headas NOTE: the binary version of HEASOFT is compiled with gfortran. If you use the g95 compiler, like I do, then you need to do a source build of HEASOFT. Alas, the HEASARC build scripts for PGPLOT do not respect the FC= build option (at least up to version 6.16). To fix this, you need to add the g95/gcc configure file to PGPLOT: cd $HEADAS/../tcltk/pgplot/sys_linux64 cp -p $XANTOP/doc/g95_gcc.conf ./ cd ../../BUILD_DIR/ Edit the configure script, find the line that defines PGPLOT_CONFIG and change it to read PGPLOT_CONFIG=g95_gcc Now you are ready for the main HEASOFT build: cd $HEADAS/../BUILD_DIR export FC=g95 ./configure make make install After typing the 'make install' don't forget to mv the HEASOFT versions or the software as shown above. 2. Download the pgplot source code directly from http://www.astro.caltech.edu/~tjp/pgplot/ This allows you to select what device handlers to use, and version 5.2.2 includes the very useful /png device. Note, qinitp looks for /usr/lib/libpng.so and it if finds it adds -lpng -lz to builds that use PGPLOT. If the /png device have not been included, this is harmless to the build. You will still need to get libcfitsio from HEASOFT. ************************************************************************ How to install lextrct. 1. The most recent source file can be obtained by: ftp xanth.msfc.nasa.gov (login as anonymous with any password) cd /pub/tennaaf bin get lexsrc.tgz quit 2. Create a directory where you want xanadu to be installed (say /usr/local/xanadu or ~/xanadu). 3. cd into the directory that you just created and expand the tar file. cd /usr/local/xanadu gtar xvf lexsrc.tgz 4. Edit your .bash_profile (if you use the bash shell) and add: # # XANADU stuff export EXT=lnx export XANTOP=/usr/local/xanadu . $XANTOP/tools/qinitu.sh . $XANTOP/tools/qinitp.sh Also use the above for other Bourne-like shells, by adding to the appropiate startup file. For csh/tcsh add the equivalent to the .login # # XANADU stuff setenv EXT lnx setenv XANTOP /usr/local/xanadu source $XANTOP/tools/qinitu.csh source $XANTOP/tools/qinitp.csh Note, EXT identifies the operating system. Use lnx on most GNU/Linux based systems. Use sol for Solaris and sun for very old SUN OS. Check qinitp.sh for others but note they have not been tested recently. For very old Macs EXT=mac. For newer Macs using GNU software (Snow Leopard/Lion) you should use EXT=lnx. Currently HEASOFT Mac binaries are compiled with 32 bit mode. To be compatible with HEASOFT, you need to use the gfortran compiler and add -m32 to the compile and link options, and "-arch i386" to gcc options. If qinitp senses that it is running on a Mac it should automatically add these options. It should work, but I don't have a Mac to test. It is also recommended that you define GTBUF_EDIT for interactive shells. Thus .bashrc would contain # XANADU stuff export GTBUF_EDIT=on or for csh add to .cshrc # XANADU stuff setenv GTBUF_EDIT on This allows command line editing to be used within XANADU software. You only add to interactive shells to avoid any possible problems with command line editing with batch jobs. On Linux qinitp.sh picks a Fortran compilier based on what is installed on your system. It first looks for g95 since that is what I currently use. If g95 is not installed it checks for gfortran, g77 and f77 (as used by f2c). If you don't want to use the default version, then you can define FCOMPL and FCOPTS in your bashrc file (see qinitp.sh for how these can be defined). 5. Now source your login script (or just login again). 6. Make the xanlib libraries with: cd $XANTOP/xanlib ./mkqlib.sh (This command and all following work identically for csh users.) Ignore any and all Warnings. 7. If you have HEASOFT installed then mkqlib.sh will create soft links to the HEASOFT versions of: libpgplot.a grfont.dat rgb.txt pgxwin_server libcfitsio.so If you don't have HEASOFT you will need to find and/or install these two packages and drop the files (or soft links) into $XANSYS/lib. 8. Install the xhelp software: cd $XANTOP/ia/doc xmake xmake install 9. Install extra help files: cd $XANTOP/doc hlpdhf gtbuf hlpdhf xhelp 10. Make and install qdp: cd $XANTOP/plot/qdp xmake xmake help xmake install 11. Make and install lextrct cd $XANTOP/ia/lextrct xmake xmake help xmake install 12. Test. (If you are using csh don't forget to rehash!) lextrct ... LEXTRCT> da m51.fit ... Map offset and compression ( 0 0 1): ... LEXTRCT> p Display min and max ( 357. , 1.741E+03): PLT> ima histo PLT> ima cct 3 PLT> p Histogram PLT> q LEXTRCT> help ... LEXTRCT> q ----------------------------------------------------------------------- Potential problems: If the builtin help doesn't work correctly, it is likely that the help files were built with the HEASOFT version of hlpdhf which means it was earlier in your path. You must 'hide' these files before building qdp. The best way to do this is: cd $HEADAS/bin/ mv qdp qdp.headas mv cod cod.headas mv hlpdhf hlpdhf.headas mv dhfhlp dhfhlp.headas mv xhelp xhelp.headas The HEASOFT versions of hlpdhf and dhfhlp are only needed if you rebuild the xspec help file (most xspec patches don't alter the help file). Also, HEASOFT uses an older version of qdp and cod, and so renaming them will ensure you can always access the newer features of these programs. Installing as root. Note the command 'sudo xmake install' will fail. This is because the root login script will not define the needed variables. If you want to install as root, you should use su -m (or su with no arguments) that preserves your current enviroment. I've had reports that if you run the HEASOFT setup before the qinit scripts, then HEASOFT defines FCOMPL and FLOPTS. If these are already defined then the qinit scripts do not change them. Alas, on Macs, the -m32 option may be missing and may cause 32/64 bit problems. If you get a message like: ld: skipping incompatible .../lnx/lib/libpgplot.a when searching for -lpgplot Then you have compiled pgplot (or if libpgplot.a is linked to a HEASOFT directory, HEASOFT) with a different different Fortran compiler or with a different architecture. You need to use the same compiler and the same number of bits (32/64) for both.