c@174: c@174: WARNINGS=-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return \ c@174: -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast \ c@174: -Wwrite-strings c@174: c@174: CFLAGS=-O3 -I.. -I../tools $(WARNINGS) c@174: CFLAGS+=-ffast-math -fomit-frame-pointer c@174: #CFLAGS+=-funroll-loops c@174: #CFLAGS+=-march=prescott c@174: #CFLAGS+= -mtune=native c@174: # TIP: try adding -openmp or -fopenmp to enable OPENMP directives and use of multiple cores c@174: #CFLAGS+=-fopenmp c@174: CFLAGS+= $(CFLAGADD) c@174: c@174: c@174: ifeq "$(NFFT)" "" c@174: NFFT=1800 c@174: endif c@174: ifeq "$(NUMFFTS)" "" c@174: NUMFFTS=10000 c@174: endif c@174: c@174: ifeq "$(DATATYPE)" "" c@174: DATATYPE=float c@174: endif c@174: c@174: BENCHKISS=bm_kiss_$(DATATYPE) c@174: BENCHFFTW=bm_fftw_$(DATATYPE) c@174: SELFTEST=st_$(DATATYPE) c@174: TESTREAL=tr_$(DATATYPE) c@174: TESTKFC=tkfc_$(DATATYPE) c@174: FASTFILTREAL=ffr_$(DATATYPE) c@174: SELFTESTSRC=twotonetest.c c@174: c@174: c@174: TYPEFLAGS=-Dkiss_fft_scalar=$(DATATYPE) c@174: c@174: ifeq "$(DATATYPE)" "int16_t" c@174: TYPEFLAGS=-DFIXED_POINT=16 c@174: endif c@174: c@174: ifeq "$(DATATYPE)" "int32_t" c@174: TYPEFLAGS=-DFIXED_POINT=32 c@174: endif c@174: c@174: ifeq "$(DATATYPE)" "simd" c@174: TYPEFLAGS=-DUSE_SIMD=1 -msse c@174: endif c@174: c@174: c@174: ifeq "$(DATATYPE)" "float" c@174: # fftw needs to be built with --enable-float to build this lib c@174: FFTWLIB=-lfftw3f c@174: else c@174: FFTWLIB=-lfftw3 c@174: endif c@174: c@174: FFTWLIBDIR=-L/usr/local/lib/ c@174: c@174: SRCFILES=../kiss_fft.c ../tools/kiss_fftnd.c ../tools/kiss_fftr.c pstats.c ../tools/kfc.c ../tools/kiss_fftndr.c c@174: c@174: all: tools $(BENCHKISS) $(SELFTEST) $(BENCHFFTW) $(TESTREAL) $(TESTKFC) c@174: c@174: tools: c@174: cd ../tools && make all c@174: c@174: c@174: $(SELFTEST): $(SELFTESTSRC) $(SRCFILES) c@174: $(CC) -o $@ $(CFLAGS) $(TYPEFLAGS) $+ -lm c@174: c@174: $(TESTKFC): $(SRCFILES) c@174: $(CC) -o $@ $(CFLAGS) -DKFC_TEST $(TYPEFLAGS) $+ -lm c@174: c@174: $(TESTREAL): test_real.c $(SRCFILES) c@174: $(CC) -o $@ $(CFLAGS) $(TYPEFLAGS) $+ -lm c@174: c@174: $(BENCHKISS): benchkiss.c $(SRCFILES) c@174: $(CC) -o $@ $(CFLAGS) $(TYPEFLAGS) $+ -lm c@174: c@174: $(BENCHFFTW): benchfftw.c pstats.c c@174: @echo "======attempting to build FFTW benchmark" c@174: @$(CC) -o $@ $(CFLAGS) -DDATATYPE$(DATATYPE) $+ $(FFTWLIB) $(FFTWLIBDIR) -lm || echo "FFTW not available for comparison" c@174: c@174: test: all c@174: @./$(TESTKFC) c@174: @echo "======1d & 2-d complex fft self test (type= $(DATATYPE) )" c@174: @./$(SELFTEST) c@174: @echo "======real FFT (type= $(DATATYPE) )" c@174: @./$(TESTREAL) c@174: @echo "======timing test (type=$(DATATYPE))" c@174: @./$(BENCHKISS) -x $(NUMFFTS) -n $(NFFT) c@174: @[ -x ./$(BENCHFFTW) ] && ./$(BENCHFFTW) -x $(NUMFFTS) -n $(NFFT) ||true c@174: @echo "======higher dimensions type=$(DATATYPE))" c@174: @./testkiss.py c@174: c@174: selftest.c: c@174: ./mk_test.py 10 12 14 > selftest.c c@174: selftest_short.c: c@174: ./mk_test.py -s 10 12 14 > selftest_short.c c@174: c@174: c@174: CXXFLAGS=-O3 -ffast-math -fomit-frame-pointer -I.. -I../tools -W -Wall c@174: testcpp: testcpp.cc ../kissfft.hh c@174: $(CXX) -o $@ $(CXXFLAGS) testcpp.cc -lm c@174: c@174: c@174: clean: c@174: rm -f *~ bm_* st_* tr_* kf_* tkfc_* ff_* ffr_* *.pyc *.pyo *.dat testcpp