2013-10-10 23:24:21 +02:00
|
|
|
##############################################################################
|
|
|
|
### compile time configuration options
|
|
|
|
FFTW3 = yes
|
|
|
|
MULTITHREADFFTW = yes
|
2013-10-24 11:29:56 +02:00
|
|
|
SINGLEPRECISION = no
|
2017-09-18 15:19:11 +02:00
|
|
|
HAVEHDF5 = yes
|
2013-10-10 23:24:21 +02:00
|
|
|
HAVEBOXLIB = no
|
|
|
|
BOXLIB_HOME = ${HOME}/nyx_tot_sterben/BoxLib
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
### compiler and path settings
|
2020-02-13 13:45:31 +01:00
|
|
|
CC = g++
|
2013-11-06 19:54:04 +01:00
|
|
|
OPT = -Wall -Wno-unknown-pragmas -O3 -g -mtune=native
|
2013-10-10 23:24:21 +02:00
|
|
|
CFLAGS =
|
|
|
|
LFLAGS = -lgsl -lgslcblas
|
2020-02-13 13:44:07 +01:00
|
|
|
CPATHS = -I./src -I$(HOME)/local/include -I/opt/local/include -I/usr/local/include
|
2013-10-24 11:29:56 +02:00
|
|
|
LPATHS = -L$(HOME)/local/lib -L/opt/local/lib -L/usr/local/lib
|
2013-10-10 23:24:21 +02:00
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# if you have FFTW 2.1.5 or 3.x with multi-thread support, you can enable the
|
|
|
|
# option MULTITHREADFFTW
|
|
|
|
ifeq ($(strip $(MULTITHREADFFTW)), yes)
|
|
|
|
ifeq ($(CC), mpiicpc)
|
|
|
|
CFLAGS += -openmp
|
|
|
|
LFLAGS += -openmp
|
|
|
|
else
|
|
|
|
CFLAGS += -fopenmp
|
|
|
|
LFLAGS += -fopenmp
|
|
|
|
endif
|
|
|
|
ifeq ($(strip $(FFTW3)),yes)
|
|
|
|
ifeq ($(strip $(SINGLEPRECISION)), yes)
|
|
|
|
LFLAGS += -lfftw3f_threads
|
|
|
|
else
|
|
|
|
LFLAGS += -lfftw3_threads
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
ifeq ($(strip $(SINGLEPRECISION)), yes)
|
|
|
|
LFLAGS += -lsrfftw_threads -lsfftw_threads
|
|
|
|
else
|
|
|
|
LFLAGS += -ldrfftw_threads -ldfftw_threads
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
CFLAGS += -DSINGLETHREAD_FFTW
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(FFTW3)),yes)
|
|
|
|
CFLAGS += -DFFTW3
|
|
|
|
endif
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# this section makes sure that the correct FFTW libraries are linked
|
|
|
|
ifeq ($(strip $(SINGLEPRECISION)), yes)
|
|
|
|
CFLAGS += -DSINGLE_PRECISION
|
|
|
|
ifeq ($(FFTW3),yes)
|
|
|
|
LFLAGS += -lfftw3f
|
|
|
|
else
|
|
|
|
LFLAGS += -lsrfftw -lsfftw
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
ifeq ($(strip $(FFTW3)),yes)
|
|
|
|
LFLAGS += -lfftw3
|
|
|
|
else
|
|
|
|
LFLAGS += -ldrfftw -ldfftw
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
#if you have HDF5 installed, you can also enable the following options
|
|
|
|
ifeq ($(strip $(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 constraints.o random.o\
|
|
|
|
convolution_kernel.o region_generator.o densities.o cosmology.o poisson.o\
|
|
|
|
densities.o cosmology.o poisson.o log.o main.o \
|
2020-02-13 13:44:07 +01:00
|
|
|
$(patsubst src/plugins/%.cc,src/plugins/%.o,$(wildcard src/plugins/*.cc))
|
2013-10-10 23:24:21 +02:00
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# stuff for BoxLib
|
|
|
|
BLOBJS = ""
|
|
|
|
ifeq ($(strip $(HAVEBOXLIB)), yes)
|
|
|
|
IN_MUSIC = YES
|
2020-02-13 13:44:07 +01:00
|
|
|
TOP = ${PWD}/src/plugins/nyx_plugin
|
2013-10-10 23:24:21 +02:00
|
|
|
CCbla := $(CC)
|
2020-02-13 13:44:07 +01:00
|
|
|
include src/plugins/nyx_plugin/Make.ic
|
2013-10-10 23:24:21 +02:00
|
|
|
CC := $(CCbla)
|
|
|
|
CPATHS += $(INCLUDE_LOCATIONS)
|
|
|
|
LPATHS += -L$(objEXETempDir)
|
2020-02-13 13:44:07 +01:00
|
|
|
BLOBJS = $(foreach obj,$(objForExecs),src/plugins/boxlib_stuff/$(obj))
|
2013-10-10 23:24:21 +02:00
|
|
|
#
|
|
|
|
endif
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
all: $(OBJS) $(TARGET) Makefile
|
|
|
|
# cd plugins/boxlib_stuff; make
|
|
|
|
|
|
|
|
bla:
|
|
|
|
echo $(BLOBJS)
|
|
|
|
|
2020-02-13 13:44:07 +01:00
|
|
|
blabla:
|
|
|
|
echo $(OBJS)
|
|
|
|
|
2013-10-10 23:24:21 +02:00
|
|
|
ifeq ($(strip $(HAVEBOXLIB)), yes)
|
2020-02-13 13:44:07 +01:00
|
|
|
$(TARGET): $(OBJS) src/plugins/nyx_plugin/*.cpp
|
|
|
|
cd src/plugins/nyx_plugin; make BOXLIB_HOME=$(BOXLIB_HOME) FFTW3=$(FFTW3) SINGLE=$(SINGLEPRECISION)
|
2013-10-10 23:24:21 +02:00
|
|
|
$(CC) $(LPATHS) -o $@ $^ $(LFLAGS) $(BLOBJS) -lifcore
|
|
|
|
else
|
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
$(CC) $(LPATHS) -o $@ $^ $(LFLAGS)
|
|
|
|
endif
|
|
|
|
|
2020-02-13 13:44:07 +01:00
|
|
|
%.o: src/%.cc src/*.hh Makefile
|
|
|
|
$(CC) $(CFLAGS) $(CPATHS) -c $< -o $@
|
|
|
|
|
|
|
|
src/plugins/%.o: src/plugins/%.cc src/*.hh Makefile
|
2013-10-10 23:24:21 +02:00
|
|
|
$(CC) $(CFLAGS) $(CPATHS) -c $< -o $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(OBJS)
|
|
|
|
ifeq ($(strip $(HAVEBOXLIB)), yes)
|
|
|
|
oldpath=`pwd`
|
2020-02-13 13:44:07 +01:00
|
|
|
cd src/plugins/nyx_plugin; make realclean BOXLIB_HOME=$(BOXLIB_HOME)
|
2013-10-10 23:24:21 +02:00
|
|
|
endif
|
|
|
|
cd $(oldpath)
|
|
|
|
|