-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (38 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
CXX=mpicxx
# for mkl
FFTINC= -DFFTW3_MKL -I$(MKLROOT)/include/fftw
FFTLIB= -lmkl_rt
# for FFTW3
#FFTINC= -I/path_to_fftw3.h
#FFTLIB= -L/path_to_libfftw3 -lfftw3_omp -lfftw3 # or -lfftw3_threads -lfftw3
# for icpc + mkl on linux
# CXXFLAGS= $(FFTINC) -std=c++11 -qopenmp -O3 -xcore-avx2 -axcore-avx512 -DNDEBUG
CXXFLAGS= $(FFTINC) -std=c++11 -fopenmp -O3 -march=native -DNDEBUG
LDLIBS= $(FFTLIB) $(CXXFLAGS)
RM = rm -f
MKDIRS = mkdir -p
BINDIR = ./bin
SRCDIR = ./test
OBJDIR = ./obj
INCDIR = ./include
INC = $(INCDIR)/SafeFFT.hpp
TARGET_BIN = \
$(BINDIR)/Demo1DForBack \
$(BINDIR)/TestForwardBackward \
$(BINDIR)/Test1DSmall \
$(BINDIR)/Test1DR2CSmall \
$(BINDIR)/Test1DLarge \
$(BINDIR)/Test2DSmall \
$(BINDIR)/Test2DLarge \
$(BINDIR)/Test3DSmall
all : $(TARGET_BIN)
$(BINDIR)/%: $(OBJDIR)/%.o
-@$(MKDIRS) $(dir $@)
$(CXX) $(CXXFLAGS) $^ $(LDLIBS) -o $@
# $(CXX) $^ $(LDLIBS) -o $@
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
-@$(MKDIRS) $(dir $@)
$(CXX) $(CXXFLAGS) -I$(INCDIR) -c $^ -o $@
clean:
$(RM) -r $(BINDIR)/* $(OBJDIR)/*
$(RM) *~ */*~