1
0
Fork 0
mirror of https://github.com/cosmo-sims/MUSIC.git synced 2024-09-19 17:03:46 +02:00
MUSIC/Makefile
Oliver Hahn c98e030c7c Updated MUSIC internal array access to 64bit compatibility.
Added support for FFTW3 (can be switched on in the Makefile), needed for
64bit compatible FFTs.
2010-10-26 11:37:31 -07:00

80 lines
2.2 KiB
Makefile

##############################################################################
### compile time configuration options
FFTW3 = yes
MULTITHREADFFTW = yes
SINGLEPRECISION = no
HAVEHDF5 = no
##############################################################################
### compiler and path settings
CC = g++
OPT = -Wall -O3 -msse2
CFLAGS = -fopenmp
LFLAGS = -fopenmp -lgsl -lgslcblas
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
##############################################################################
# if you have FFTW 2.1.5 or 3.x with multi-thread support, you can enable the
# option MULTITHREADFFTW
ifeq ($(MULTITHREADFFTW), yes)
ifeq ($(FFTW3),yes)
LFLAGS += -lfftw3_threads
else
ifeq ($(SINGLEPRECISION), yes)
LFLAGS += -lsrfftw_threads -lsfftw_threads
else
LFLAGS += -ldrfftw_threads -ldfftw_threads
endif
endif
else
CFLAGS += -DSINGLETHREAD_FFTW
endif
ifeq ($(FFTW3),yes)
CFLAGS += -DFFTW3
endif
##############################################################################
# this section makes sure that the correct FFTW libraries are linked
ifeq ($(SINGLEPRECISION), yes)
CFLAGS += -DSINGLE_PRECISION
ifeq ($(FFTW3),yes)
LFLAGS += -lfftw3
else
LFLAGS += -lsrfftw -lsfftw
endif
else
ifeq ($(FFTW3),yes)
LFLAGS += -lfftw3
else
LFLAGS += -ldrfftw -ldfftw
endif
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
OBJS = output.o transfer_function.o Numerics.o defaults.o\
convolution_kernel.o densities.o cosmology.o poisson.o log.o main.o \
$(patsubst plugins/%.cc,plugins/%.o,$(wildcard plugins/*.cc))
##############################################################################
all: $(OBJS) $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(LPATHS) -o $@ $^ $(LFLAGS)
%.o: %.cc *.hh Makefile
$(CC) $(CFLAGS) $(CPATHS) -c $< -o $@
clean:
rm -rf $(OBJS)