Skip to content

Instantly share code, notes, and snippets.

@apiemont
Last active November 7, 2017 18:45
Show Gist options
  • Save apiemont/edf3978f7011ca014589a58dee17462f to your computer and use it in GitHub Desktop.
Save apiemont/edf3978f7011ca014589a58dee17462f to your computer and use it in GitHub Desktop.
Daophot Makefile
As modified to compile it under Ubuntu 14.04 (LTS) and Ubuntu 16.04 (LTS)
$ cat Makefile
F77 = gfortran
FFLAGS = -c -O2 -mcmodel=medium -fd-lines-as-comments
LFLAGS = -O2 -Wall -Wsurprising -defsym,mem_=0 -fbounds-check
HOSTLIBS = -lm
IMFORT = $(HOME)/opt/iraf-2.16.1-gfortran-linux64/unix/bin.linux64/libf2c.a $(HOME)/opt/iraf-2.16.1-gfortran-linux64/bin.linux64/libimfort.a $(HOME)/opt/iraf-2.16.1-gfortran-linux64/bin.linux64/libsys.a $(HOME)/opt/iraf-2.16.1-gfortran-linux64/bin.linux64/libvops.a $(HOME)/opt/iraf-2.16.1-gfortran-linux64/unix/bin.linux64/libos.a
FITLIB = -lcfitsio
INSTALL_TO = $(HOME)/bin
EXECUTABLES = daophot allstar daomaster daomatch montage2 allframe daogrow #daospec
# RULES:
.SUFFIXES: .o .f
.f.o:
$(F77) $(FFLAGS) $<
all: $(EXECUTABLES)
install: all
cp $(EXECUTABLES) $(INSTALL_TO)
.PHONY : clean
clean:
rm -f $(EXECUTABLES)
rm -f *.o
daophot: daophot.o pckpsf.o find.o fotometry.o \
psf.o peak.o nstar.o fudge.o addstar.o substar.o \
group.o sort.o lnxsubs.o fitsubs.o iosubs.o mathsubs.o
$(F77) $(LFLAGS) -o daophot daophot.o pckpsf.o find.o fotometry.o \
psf.o peak.o nstar.o fudge.o addstar.o substar.o \
group.o sort.o lnxsubs.o fitsubs.o \
iosubs.o mathsubs.o \
$(IMFORT) $(HOSTLIBS) $(FITLIB)
allstar: allstar.o allstsubs.o lnxsubs.o \
iosubs.o mathsubs.o fitsubs.o
$(F77) $(LFLAGS) -o allstar allstar.o allstsubs.o \
lnxsubs.o iosubs.o mathsubs.o fitsubs.o \
$(IMFORT) $(HOSTLIBS) $(FITLIB)
daomaster: daomaster.o iosubs.o mathsubs.o lnxsubs.o dummysm.o
$(F77) $(LFLAGS) -o daomaster daomaster.o iosubs.o mathsubs.o lnxsubs.o dummysm.o
daomatch: daomatch.o iosubs.o mathsubs.o lnxsubs.o
$(F77) $(LFLAGS) -o daomatch daomatch.o iosubs.o mathsubs.o lnxsubs.o
montage2: montage2.o mathsubs.o iosubs.o lnxsubs.o fitsubs.o
$(F77) $(LFLAGS) -o montage2 montage2.o mathsubs.o iosubs.o lnxsubs.o fitsubs.o \
$(HOSTLIBS) $(IMFORT) $(FITLIB)
allframe: allframe.o fitsubs.o lnxsubs.o iosubs.o mathsubs.o
$(F77) $(LFLAGS) -o allframe allframe.o fitsubs.o \
lnxsubs.o iosubs.o mathsubs.o \
$(IMFORT) $(HOSTLIBS) $(FITLIB)
# to compile tdaogrow, added mcmodel on FFLAGS, see https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
daogrow: daogrow.o iosubs.o mathsubs.o lnxsubs.o
$(F77) $(LFLAGS) -o daogrow daogrow.o iosubs.o mathsubs.o lnxsubs.o
# daospec source file(s) missing, commented out ...
#daospec: daospec.o lnxsubs.o iosubs.o mathsubs.o fitsubs.o
# $(F77) $(LFLAGS) -o daospec daospec.o lnxsubs.o iosubs.o mathsubs.o fitsubs.o \
$(IMFORT) $(HOSTLIBS) $(FITLIB) -Bstatic -L/usr/local/lib -lplotsub -ldevices -lutils -Bdynamic /usr/X11R6/lib/libX11.a
@apiemont
Copy link
Author

apiemont commented Nov 29, 2016

Pre-requisites are

  1. Install gfortran
    $ sudo apt install gfortran
  2. Install libcfitsio static libraries
    $ apt install libcfitsio3 libcfitsio3-dev
  3. Deploy Iraf libraries compiled for 64 bit with gfortran (place them in suitable location, example below uses ~/opt to match Makefile):
    $ wget ftp://iraf.noao.edu/pub/fitz/iraf2161-gfortran-linux64.tar.gz
    $ cd ~/opt; mkdir iraf-2.16.1-gfortran-linux6; tar -C iraf-2.16.1-gfortran-linux64 -xvzf iraf2161-gfortran-linux64.tar.gz

Then issue this to build all binaries

$ cd /path/to/daophot_source; make clean; make all

and install them in ~/bin (configurable in the Makefile)

$ make install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment