-
Notifications
You must be signed in to change notification settings - Fork 8
/
makefile.tacc
65 lines (55 loc) · 1.46 KB
/
makefile.tacc
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#SHELL=/bin/csh
CPP = mpicxx
CPPFLAGS = -O0 -g -DFFTW
CC = mpicc
FF = mpif90
#FFLAGS = -O3
AR = ar
ARFLAGS = -v -r -u
FFT_LIB = -L$(TACC_FFTW3_LIB) -lfftw3 -lfftw3f
LDFLAGS= $(FFT_LIB) -lm
# For FFTW use path to the installed FFTW library:
# -L/usr/local/apps/fftw301s/lib -lfftw3f
INCL = -I$(TACC_FFTW3_INC)
# For FFTW add include file location, for example:
# INCL = -I/usr/local/apps/fftw312s/include
DFLAGS = -DFFTW
P3DFFT_ROOT = .
P3DFFT_LIB = libp3dfft.3.a
# ----------------
FFT3DLIB = init.o plan.o exec.o templ.o wrap.o
all: lib samples
lib: $(FFT3DLIB)
$(AR) $(ARFLAGS) $(P3DFFT_LIB) $(FFT3DLIB)
samples: lib
cd C++; make
cd C; make
cd FORTRAN; make
test1D: $(FFT3DLIB) test1D.o
$(CPP) test1D.o -o test1D -L. -lp3dfft.3 $(LDFLAGS)
test2D: $(FFT3DLIB) test2D.o
$(CPP) test2D.o -o test2D -L. -lp3dfft.3 $(LDFLAGS)
install:
if(!(-e $(P3DFFT_ROOT))) mkdir $(P3DFFT_ROOT)
if (!(-e $(P3DFFT_ROOT)/lib)) mkdir $(P3DFFT_ROOT)/lib
cp $(P3DFFT_LIB) $(P3DFFT_ROOT)/lib
if (!(-e $(P3DFFT_ROOT)/include)) mkdir $(P3DFFT_ROOT)/include
cp p3dfft.mod $(P3DFFT_ROOT)/include
init.o: init.C p3dfft.h
plan.o: plan.C templ.C p3dfft.h
exec.o: exec.C p3dfft.h
templ.o: templ.C p3dfft.h
wrap.o: wrap.C p3dfft.h
.C.o:
$(CPP) -c $(CPPFLAGS) $(INCL) $<
.F90.o:
$(FF) $(DFLAGS) -c $(FFLAGS) $(INCL) $<
.F.o:
$(FF) $(DFLAGS) -c $(FFLAGS) $(INCL) $<
.f.o:
$(FF) -c $(FFLAGS) $(INCL) $<
clean:
/bin/rm $(FFT3DLIB)
cd C; make clean
cd C++; make clean
cd FORTRAN; make clean