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