The HEASARC welcomes your participation in a brief survey to capture how users access and utilize HEASARC data, software, and services. The outcome(s) of this survey will be used to guide, prioritize, and plan our activities and development in the coming years. It contains 18 questions, generally takes just a few minutes to complete, and your answers will remain totally anonymous. We thank you in advance for your valuable feedback.
Fermi Gamma-ray Space Telescope

Installation Instructions for the GBM Response Generator

NOTE: GRB trigger data from GBM already have a standard set of response functions delivered to the data archive, so there is generally no need to redo them.

1. Install the prerequisite programs:


The script will run the system perl (/usr/bin/perl) by default. If you want to use a different version of perl (e.g. from macports) or if your perl is installed in a different location then be sure to specify the correct perl location as instructed in step 4 below.

Also make sure you install the Astro::FITS::CFITSIO module using the same perl interpreter that will be used to execute the scripts. If you installed Astro::FITS::CFITSIO module but the script gives an error that it can't be found, then it means that you may have (as in the case of macports perl) installed it for a different perl interpreter than is being called.

You can double check the perl interpreter with:

$ which perl

and then specify the path returned in step 4 below.

Install instructions (using homebrew):

$ brew install cmake
$ brew install gcc
$ brew install cfitsio

Install instructions (using macports):

(remove the sudo from the command line if not needed)

$ sudo port install cmake
$ sudo port install gcc6
Note: You can install a different gcc. It will work with gcc version 4.4.7 and above

$ sudo port install cfitsio +gcc6
Note: Make sure the variant matches the gcc version you installed.
(e.g. $ port install cfitsio +gcc46 if you installed gcc version 4.4.7)

Astro::FITS::CFITSIO Installation

You will need to install Astro::FITS::CFITSIO **after** you install the CFITSIO library. It can be installed from CPAN:

$ sudo cpan install Astro::FITS::CFITSIO

NOTE: If your CFTISIO library isn't located at /usr/local then you may need to specify its location with:

$ sudo CFITSIO=(base directory of library) cpan install Astro::FITS::CFITSIO
(e.g. $ sudo CFITSIO=/opt/local cpan install Astro::FITS::CFITSIO)

2. Untar the attached GBM RSP

$ tar xvjf gbmrsp-2.0.10.tar.bz2

3. Create the build directory in the base directory of the project

$ cd gbmrsp-2.0
$ mkdir build

You should have the following directory tree:

|— build
|— data
..|— GBMDRMdb002
....|— BGO_00
....|— BGO_01
....|— NAI_00
....|— NAI_01
....|— NAI_02
....|— NAI_03
....|— NAI_04
....|— NAI_05
....|— NAI_06
....|— NAI_07
....|— NAI_08
....|— NAI_09
....|— NAI_10
....|— NAI_11
..|— inputs
|— src
..|— fortran
..|— perl

4. Create the build files (by default this will install in /usr/local)

$ cd build

By default the software will install in /usr/local if this is what you want:
$ cmake ../src

Or to install to a different directory:
$ cmake -DCMAKE_INSTALL_PREFIX=your-target-directory ../src
(e.g. $ cmake -DCMAKE_INSTALL_PREFIX=/home/jdoe/gbmrsp ../src)

If you would like or need to specify the compiler to be used:
$ cmake -DCMAKE_Fortran_COMPILER=(full path name of your compiler) ../src
(e.g. $ cmake -DCMAKE_Fortran_COMPILER=/opt/local/bin/gfortran ../src)

To specify which perl executable should be used:
$ cmake -DPERL_EXEC=(full path name of perl) ../src
(e.g. $ cmake -DPERL_EXEC=/usr/local/bin/perl ../src )

You can use multiple defines with the cmake command, for example:
$ cmake -DCMAKE_INSTALL_PREFIX=/home/jdoe/gbmrsp \
-DCMAKE_Fortran_COMPILER=/opt/local/bin/gfortran \
-DPERL_EXEC=/usr/local/bin/perl ../src

Note: If the name of the compiler executable is something other than "gfortran" or "f95", or is not in the PATH you will have to specify it using
-DCMAKE_Fortan_COMPILER as shown above.

5. Compile and install the programs (remove sudo if not necessary)

$ make
$ sudo make install


To uninstall the programs, using Finder (for Macs):

  1. Goto to the /usr/local directory with SHIFT-COMMAND-G.
  2. Move the gbmrsp folder to the trash.
  3. Open the bin directory by double clicking the folder.
  4. Move the gbmrsp.exe and to the trash.