78 lines
1.8 KiB
Makefile
78 lines
1.8 KiB
Makefile
SHELL=/bin/sh
|
|
|
|
# makefile for the LOESS module
|
|
#
|
|
# required libraries: libblas, liblapack, libf2c
|
|
# (you may have to set soft links so that linker finds them)
|
|
#
|
|
# see the top-level makefile for additional information.
|
|
|
|
.SUFFIXES:
|
|
.SUFFIXES: .c .cpp .cxx .exe .f .h .i .o .py .pyf .so .x
|
|
.PHONY: all loess test gas madeup ethanol air galaxy
|
|
|
|
HOST=$(shell hostname)
|
|
CFLAGS=-O
|
|
FFLAGS=-O
|
|
OBJ=loessc.o loess.o predict.o misc.o loessf.o dqrsl.o dsvdc.o fix_main.o
|
|
LIB=-lblas -lm -lf2c
|
|
LIBPATH=
|
|
CC=gcc
|
|
CCOPTS=
|
|
SWIG=swig
|
|
SWIGOPTS=
|
|
PYTHON=python
|
|
PYTHONOPTS=
|
|
ifneq (,$(filter merlin%,$(HOST)))
|
|
PYTHONINC=-I/usr/include/python2.7 -I/opt/python/python-2.7.5/include/python2.7/
|
|
else ifneq (,$(filter ra%,$(HOST)))
|
|
PYTHONINC=-I${PSI_PYTHON27_INCLUDE_DIR}/python2.7 -I${PSI_PYTHON27_LIBRARY_DIR}/python2.7/site-packages/numpy/core/include
|
|
else
|
|
PYTHONINC=-I/usr/include/python2.7
|
|
endif
|
|
|
|
all: loess
|
|
|
|
loess: _loess.so
|
|
|
|
loess_wrap.c: loess.c loess.i
|
|
$(SWIG) $(SWIGOPTS) -python loess.i
|
|
|
|
loess.py _loess.so: loess_wrap.c
|
|
# setuptools doesn't handle the fortran files correctly
|
|
# $(PYTHON) $(PYTHONOPTS) setup.py build_ext --inplace
|
|
$(CC) $(CFLAGS) -fpic -c loessc.c loess.c predict.c misc.c loessf.f dqrsl.f dsvdc.f fix_main.c
|
|
$(CC) $(CFLAGS) -fpic -c loess_wrap.c $(PYTHONINC)
|
|
$(CC) -shared $(OBJ) $(LIB) $(LIBPATH) loess_wrap.o -o _loess.so
|
|
|
|
examples: gas madeup ethanol air galaxy
|
|
|
|
gas: gas.x
|
|
|
|
gas.x: gas.o $(OBJ)
|
|
$(CC) -o gas.x gas.o $(OBJ) $(LIB)
|
|
|
|
madeup: madeup.x
|
|
|
|
madeup.x: madeup.o $(OBJ)
|
|
$(CC) -o madeup.x madeup.o $(OBJ) $(LIB)
|
|
|
|
ethanol: ethanol.x
|
|
|
|
ethanol.x: ethanol.o $(OBJ)
|
|
$(CC) -o ethanol.x ethanol.o $(OBJ) $(LIB)
|
|
|
|
air: air.x
|
|
|
|
air.x: air.o $(OBJ)
|
|
$(CC) -o air.x air.o $(OBJ) $(LIB)
|
|
|
|
galaxy: galaxy.x
|
|
|
|
galaxy.x: galaxy.o $(OBJ)
|
|
$(CC) -o galaxy.x galaxy.o $(OBJ) $(LIB)
|
|
|
|
clean:
|
|
rm -f *.o *.so *.x core *.pyc
|
|
rm -f loess.py loess_wrap.c
|