2010-07-02 20:49:30 +02:00
|
|
|
##############################################################################
|
|
|
|
### compile time configuration options
|
2012-07-28 05:17:12 +02:00
|
|
|
FFTW3 = yes
|
2010-09-08 10:06:18 +02:00
|
|
|
MULTITHREADFFTW = yes
|
2011-07-21 19:43:00 +02:00
|
|
|
SINGLEPRECISION = no
|
2011-02-22 23:17:34 +01:00
|
|
|
HAVEHDF5 = yes
|
2010-07-02 20:49:30 +02:00
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
### compiler and path settings
|
2011-06-01 20:01:24 +02:00
|
|
|
CC = g++
|
2012-12-11 02:11:04 +01:00
|
|
|
OPT = -Wall -Wno-unknown-pragmas -O0 -g -msse2
|
2012-03-28 21:38:31 +02:00
|
|
|
CFLAGS =
|
|
|
|
LFLAGS = -lgsl -lgslcblas
|
2012-09-05 05:28:22 +02:00
|
|
|
CPATHS = -I. -I$(HOME)/local/include -I/opt/local/include -I/usr/local/include
|
|
|
|
LPATHS = -L$(HOME)/local/lib -L/opt/local/lib -L/usr/local/lib
|
2010-07-02 20:49:30 +02:00
|
|
|
|
|
|
|
##############################################################################
|
2010-10-26 20:37:31 +02:00
|
|
|
# if you have FFTW 2.1.5 or 3.x with multi-thread support, you can enable the
|
|
|
|
# option MULTITHREADFFTW
|
2010-07-02 20:49:30 +02:00
|
|
|
ifeq ($(MULTITHREADFFTW), yes)
|
2012-03-28 21:38:31 +02:00
|
|
|
CFLAGS += -fopenmp
|
|
|
|
LFLAGS += -fopenmp
|
2010-10-26 20:37:31 +02:00
|
|
|
ifeq ($(FFTW3),yes)
|
2011-06-01 20:01:24 +02:00
|
|
|
ifeq ($(SINGLEPRECISION), yes)
|
|
|
|
LFLAGS += -lfftw3f_threads
|
|
|
|
else
|
|
|
|
LFLAGS += -lfftw3_threads
|
|
|
|
endif
|
2010-07-02 20:49:30 +02:00
|
|
|
else
|
2010-10-26 20:37:31 +02:00
|
|
|
ifeq ($(SINGLEPRECISION), yes)
|
|
|
|
LFLAGS += -lsrfftw_threads -lsfftw_threads
|
|
|
|
else
|
|
|
|
LFLAGS += -ldrfftw_threads -ldfftw_threads
|
|
|
|
endif
|
2010-07-02 20:49:30 +02:00
|
|
|
endif
|
|
|
|
else
|
|
|
|
CFLAGS += -DSINGLETHREAD_FFTW
|
|
|
|
endif
|
|
|
|
|
2010-10-26 20:37:31 +02:00
|
|
|
ifeq ($(FFTW3),yes)
|
|
|
|
CFLAGS += -DFFTW3
|
|
|
|
endif
|
|
|
|
|
2010-07-02 20:49:30 +02:00
|
|
|
##############################################################################
|
|
|
|
# this section makes sure that the correct FFTW libraries are linked
|
|
|
|
ifeq ($(SINGLEPRECISION), yes)
|
|
|
|
CFLAGS += -DSINGLE_PRECISION
|
2010-10-26 20:37:31 +02:00
|
|
|
ifeq ($(FFTW3),yes)
|
2011-06-01 20:01:24 +02:00
|
|
|
LFLAGS += -lfftw3f
|
2010-10-26 20:37:31 +02:00
|
|
|
else
|
|
|
|
LFLAGS += -lsrfftw -lsfftw
|
|
|
|
endif
|
2010-07-02 20:49:30 +02:00
|
|
|
else
|
2010-10-26 20:37:31 +02:00
|
|
|
ifeq ($(FFTW3),yes)
|
|
|
|
LFLAGS += -lfftw3
|
|
|
|
else
|
|
|
|
LFLAGS += -ldrfftw -ldfftw
|
|
|
|
endif
|
2010-07-02 20:49:30 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
#if you have HDF5 installed, you can also enable the following options
|
|
|
|
ifeq ($(HAVEHDF5), yes)
|
|
|
|
OPT += -DH5_USE_16_API -DHAVE_HDF5
|
|
|
|
LFLAGS += -lhdf5
|
|
|
|
endif
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
CFLAGS += $(OPT)
|
|
|
|
TARGET = MUSIC
|
2010-11-13 00:05:45 +01:00
|
|
|
OBJS = output.o transfer_function.o Numerics.o defaults.o constraints.o random.o\
|
2012-12-09 16:42:47 +01:00
|
|
|
convolution_kernel.o region_generator.o densities.o cosmology.o poisson.o\
|
|
|
|
log.o main.o \
|
2010-07-02 20:49:30 +02:00
|
|
|
$(patsubst plugins/%.cc,plugins/%.o,$(wildcard plugins/*.cc))
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
all: $(OBJS) $(TARGET)
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
$(CC) $(LPATHS) -o $@ $^ $(LFLAGS)
|
2010-09-08 10:06:18 +02:00
|
|
|
|
2010-07-02 20:49:30 +02:00
|
|
|
%.o: %.cc *.hh Makefile
|
|
|
|
$(CC) $(CFLAGS) $(CPATHS) -c $< -o $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(OBJS)
|
|
|
|
|