using FITSIO in Octave-FITS under Cygwin

Install FITS for GNU Octave

  1. Install Cygwin prereqs from Windows Command Prompt
    setup-x86_64 -P libcfitsio-devel make pkg-config gcc-g++ libgfortran3 libGraphicsMagick3 octave octave-devel texinfo
    
  2. From Cygwin, in Octave, type
    pkg install -verbose -forge fits
    

    This should install FITS without errors.

Load .fits

pkg load fits

enable FITS read/write functions. Note, the command is NOT fitsread(), in Octave the FITS reading command is read_fits_image().

Tested with Octave 4.2, FITS 1.0.7

Reference: Manual cfitsio compile

This is not necessary, just for reference.

wget http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio_latest.tar.gz

tar -xf cfitsio*.tar.gz

cd cfitsio
./configure --enable-reentrant --enable-ssse3

make && make install

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Fix Errors

If you get an error message upon ./configure

gcc/g++ can’t be found

to fix, in Cygwin type

unset CC

then retry your ./configure command

Leave a Comment