File tree Expand file tree Collapse file tree 5 files changed +59
-31
lines changed Expand file tree Collapse file tree 5 files changed +59
-31
lines changed Original file line number Diff line number Diff line change 33LIB = dfftpack
44
55FC = gfortran
6- FFLAGS = -O2
6+ FFLAGS = -O2 -fPIC
77
88export LIB
99export FC
1010export FFLAGS
1111
12- .PHONY : all clean test
12+ .PHONY : build clean test
1313
14- all :
14+ build :
1515 $(MAKE ) -f Makefile --directory=src
16- $(MAKE ) -f Makefile --directory=test
1716
18- test :
17+ test : build
1918 $(MAKE ) -f Makefile --directory=test
19+
20+ bench : build
21+ $(MAKE ) -f Makefile --directory=example
2022
2123clean :
2224 $(MAKE ) -f Makefile clean --directory=src
23- $(MAKE ) -f Makefile clean --directory=test
25+ $(MAKE ) -f Makefile clean --directory=test
26+ $(MAKE ) -f Makefile clean --directory=example
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ fftpack = { git="https://github.com/fortran-lang/fftpack.git" }
3131Alternatively, you can build using provided ` Makefile ` :
3232``` bash
3333make
34+ make test
3435```
3536
3637## Links
Original file line number Diff line number Diff line change 1+ SRCF90 = \
2+ bench1.f90
3+
4+ OBJ = $(SRCF90:%.f90=%.o )
5+
6+ build : bench1.x
7+
8+ bench : build
9+ ./bench1.x
10+
11+ bench1.x : $(OBJ )
12+ $(FC ) $(FFLAGS ) $(OBJ ) -L../src -l$(LIB ) -I../src -o $@
13+
14+ % .o : % .f90
15+ $(FC ) $(FFLAGS ) -I../src -c $<
16+
17+ clean :
18+ rm -f -r * .o * .x
Original file line number Diff line number Diff line change 1- SRCF = \
1+ SRCF90 = \
22 zfftb.f90\
33 cfftb1.f90\
44 zfftf.f90\
@@ -47,9 +47,7 @@ SRCF = \
4747 dsinqi.f90\
4848 dsint.f90\
4949 sint1.f90\
50- dsinti.f90
51-
52- SRCF90 = \
50+ dsinti.f90\
5351 fftpack.f90\
5452 fftpack_fft.f90\
5553 fftpack_ifft.f90\
@@ -59,16 +57,20 @@ SRCF90 = \
5957 fftpack_ifftshift.f90\
6058 fftpack_qct.f90\
6159 fftpack_iqct.f90\
62- fftpack_dct.f90\
60+ fftpack_dct.f90
61+
62+ SRCFPP = \
6363 rk.F90
6464
65- OBJF := $(SRCF:.f90=.o )
66- OBJF90 := $(SRCF90:.f90=.o )
65+ OBJ = $(SRCF90:.f90=.o )
66+ OBJ += $(SRCFPP:.F90=.o )
67+
68+ build : lib$(LIB ) .a lib$(LIB ) .so
6769
68- lib$(LIB ) .a : $(OBJF ) $( OBJF90 )
69- ar -rcs lib$(LIB ) .a $(OBJF ) $( OBJF90 )
70+ lib$(LIB ) .a : $(OBJ )
71+ ar -rcs lib$(LIB ) .a $(OBJ )
7072
71- shared : $(OBJ )
73+ lib $( LIB ) .so : $(OBJ )
7274 $(FC ) -shared -o lib$(LIB ) .so $(OBJ )
7375
7476clean :
Original file line number Diff line number Diff line change 11FETCH = curl -L
22
3- SRC = \
3+ SRCF90 = \
44 test_fftpack_fft.f90 \
55 test_fftpack_rfft.f90 \
6- test_fftpack_qct.f90 \
7- test_fftpack_dct.f90 \
86 test_fftpack_utils.f90 \
9- test_fftpack.f90 \
7+ test_fftpack.f90
8+
9+ SRCFPP = \
10+ test_fftpack_qct.F90 \
11+ test_fftpack_dct.F90 \
1012 testdrive.F90
11-
12- OBJ = $(SRC:.f90=.o )
13- OBJ := $(OBJ:.F90=.o )
1413
15- all : tstfft \
16- test_fftpack
14+ OBJ = $(SRCF90:%.f90=%.o )
15+ OBJ += $(SRCFPP:%.F90=%.o )
16+
17+ build : tstfft.x \
18+ test_fftpack.x
19+
20+ test : build
21+ ./tstfft.x
22+ ./test_fftpack.x
1723
1824# Orginal test
19- tstfft : tstfft.f
20- $(FC ) $(FFLAGS ) $< -L../src -l$(LIB ) -I../src -o $@ .x
21- time ./tstfft.x
25+ tstfft.x : tstfft.f
26+ $(FC ) $(FFLAGS ) $< -L../src -l$(LIB ) -I../src -o $@
2227
2328# `fftpack` fft routines
24- test_fftpack : $(OBJ )
25- $(FC ) $(FFLAGS ) $(OBJ ) -L../src -l$(LIB ) -I../src -o $@ .x
26- ./test_fftpack.x
29+ test_fftpack.x : $(OBJ )
30+ $(FC ) $(FFLAGS ) $(OBJ ) -L../src -l$(LIB ) -I../src -o $@
2731
2832testdrive.F90 :
2933 $(FETCH ) https://github.com/fortran-lang/test-drive/raw/v0.4.0/src/testdrive.F90 > $@
You can’t perform that action at this time.
0 commit comments