diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-10-27 20:08:04 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-10-27 20:08:04 +0100 |
commit | a44fd411b55c773f6b251c54b96a8f8d9de4fc75 (patch) | |
tree | dff89d1487a31855ea412cb58a9057e7c19a7d3e | |
parent | dbff069499ba0832b780eabd1271902569f4e27b (diff) | |
download | dabmod-a44fd411b55c773f6b251c54b96a8f8d9de4fc75.tar.gz dabmod-a44fd411b55c773f6b251c54b96a8f8d9de4fc75.tar.bz2 dabmod-a44fd411b55c773f6b251c54b96a8f8d9de4fc75.zip |
Refactor autoconf, make FFTW default
-rw-r--r-- | INSTALL | 25 | ||||
-rw-r--r-- | configure.ac | 68 | ||||
-rw-r--r-- | src/Makefile.am | 113 |
3 files changed, 113 insertions, 93 deletions
@@ -4,15 +4,14 @@ Required dependencies: * Boost 1.41 or later * Optional ZeroMQ http://www.zeromq.org Use --disable-input-zeromq if you don't have it - * Optional FFTW 3.x (KISS FFT is default) - Enable with --enable-fftw + * Optional FFTW 3.x (included KISS FFT is used as fallback) Simple install procedure: ========================= % tar xjf odr-dabmod-X.Y.Z.tar.bz2 # Unpack the source % cd odr-dabmod-X.Y.Z # Change to the source directory - % ./configure --disable-debug --with-debug-malloc=yes --enable-fft-simd + % ./configure --disable-debug --with-debug-malloc=yes # Run the configure script % make # Build ODR-DabMod [ as root ] @@ -26,16 +25,16 @@ The configure script can be launch with a variety of options: --enable-output-uhd Includes the binding to the UHD driver for USRPs You have the choice between two FFT libraries: KISS FFT and FFTW. KISS FFT is a -proven library, but it's performance is worse than with the new FFTW. With the -default KISS FFT, you have the choice between using the normal version, or the -SIMD accelerated version, which is a bit faster. The corresponding options are: +proven library, but it's performance is worse than with the new FFTW. With KISS +FFT, you have the choice between using the normal version, or the SIMD +accelerated version, which is a bit faster. The corresponding options are: - --enable-fftw Use FFTW3 instead of KISS FFT (experimental, better performance) + --enable-kiss-fft Prefer KISS FFT over FFTW --enable-fft-simd Enable SIMD instructions for KISS FFT -Debugging options: You should disable debug to improve ODR-DabMod performance. -By default, debug is enabled. - --disable-debug Do not compile with debugging, and enable optimisations +Debugging options: You should not enable debug if you need good performance. +By default, debug is disabled. + --enable-debug Do not compile with debugging, and enable optimisations --enable-trace Create debugging files for each DSP block for data analysis For more information, call: @@ -45,13 +44,11 @@ For more information, call: Nearly as simple install procedure using repository: ==================================================== - * Download and install fec as above + * Download and install dependencies as above * Clone the git repository * Bootstrap autotools: % ./bootstrap.sh - In case this fails, try one of the following: + In case this fails, try: % aclocal && automake --gnu --add-missing && autoconf - or - % autoreconf * Then use ./configure as above diff --git a/configure.ac b/configure.ac index 9a1816a..9826a91 100644 --- a/configure.ac +++ b/configure.ac @@ -48,56 +48,74 @@ AC_PROG_MKDIR_P EXTRA="" AC_ARG_ENABLE([debug], - [AS_HELP_STRING([--disable-debug], [Disable debugger symbols])], - [], [enable_debug=yes]) + [AS_HELP_STRING([--enable-debug], [Enable debugger symbols])], + [], [enable_debug=no]) AC_ARG_ENABLE([prof], [AS_HELP_STRING([--enable-prof], [Enable profiling])], [], [enable_prof=no]) AC_ARG_WITH([debug-malloc], - [AS_HELP_STRING([--with-debug-malloc[=yes|no|duma|efence|...]], + [AS_HELP_STRING([--with-debug-malloc[=no|yes|duma|efence|...]], [Add malloc debugger support])], - [], [with_debug_malloc=yes]) + [], [with_debug_malloc=no]) AC_ARG_ENABLE([trace], [AS_HELP_STRING([--enable-trace], [Enable trace output])], [], [enable_trace=no]) + +# Which FFT library to use AC_ARG_ENABLE([fft_simd], - [AS_HELP_STRING([--enable-fft-simd], [Enable SIMD instructions for kiss-fft (unstable)])], + [AS_HELP_STRING([--enable-fft-simd], + [Enable SIMD instructions for kiss-fft (unstable)])], [], [enable_fft_simd=no]) -AC_ARG_ENABLE([fftw], - [AS_HELP_STRING([--enable-fftw], [Use FFTW3 instead of Kiss FFT])], - [], [enable_fftw=no]) +AC_ARG_ENABLE([kiss_fft], + [AS_HELP_STRING([--enable-kiss-fft], [Prefer KISS FFT over FFTW3])], + [], [enable_kiss=no]) + # ZeroMQ message queue input AC_ARG_ENABLE([input_zeromq], AS_HELP_STRING([--enable-input-zeromq], [Enable ZeroMQ input])) + # UHD support control AC_ARG_ENABLE([output_uhd], [AS_HELP_STRING([--enable-output-uhd], [Enable UHD output])], [], [enable_output_uhd=yes]) +AS_IF([test "x$enable_kiss" = "xno"], + [PKG_CHECK_MODULES([FFTW], [fftw3f], enable_fftw=yes, enable_fftw=no)], + [enable_fftw=no]) + +AS_IF([test "x$enable_fftw" = "xyes"], + AC_MSG_NOTICE([Found FFTW3]), + AC_MSG_NOTICE([Using Kiss FFT]) ) + +echo "Checking input zeromq" + AS_IF([test "x$enable_input_zeromq" = "xyes"], [AC_DEFINE(HAVE_INPUT_ZEROMQ, [1], [Define if ZeroMQ input is enabled]) , AC_CHECK_LIB(zmq, zmq_init, ,[AC_MSG_ERROR([ZeroMQ libzmq is required])])]) AS_IF([test "x$enable_debug" = "xno"], [OPTIM="-O2" DEBUG="" EXTRA="$EXTRA -DNDEBUG"], - [OPTIM="-O0" DEBUG="-ggdb" EXTRA="$EXTRA -Wall"]) + [OPTIM="-O0" DEBUG="-ggdb" EXTRA="$EXTRA"]) AS_IF([test "x$enable_prof" != "xno"], [EXTRA="$EXTRA -pg"]) -AS_IF([test "x$enable_trace" != "xno"], - [EXTRA="$EXTRA -DDEBUG"]) -AS_IF([test "x$enable_fft_simd" != "xno"], - [EXTRA="$EXTRA -DUSE_SIMD"]) -AS_IF([test "x$enable_fftw" != "xno"], - [EXTRA="$EXTRA -DUSE_FFTW"]) +# Define conditionals for Makefile.am AM_CONDITIONAL([USE_KISS_FFT], [test "x$enable_fftw" = "xno"]) - +AM_CONDITIONAL([DEBUG], [test "x$enable_trace" = "xyes"]) AM_CONDITIONAL([HAVE_INPUT_ZEROMQ_TEST], [test "x$enable_input_zeromq" = "xyes"]) +AM_CONDITIONAL([IS_GIT_REPO], [test -d '.git']) +# Defines for config.h +AS_IF([test "x$enable_fft_simd" = "xyes"], + [AC_DEFINE(USE_SIMD, [1], [Define to enable KISS FFT SIMD])]) +AS_IF([test "x$enable_fftw" = "xno"], + [AC_DEFINE(USE_KISS_FFT, [1], [Define to enable KISS])]) +AS_IF([test "x$enable_fftw" = "xyes"], + [AC_DEFINE(USE_FFTW, [1], [Define to enable FFTW])]) -AC_SUBST([CFLAGS], ["$OPTIM $DEBUG $EXTRA"]) -AC_SUBST([CXXFLAGS], ["$OPTIM $DEBUG $EXTRA"]) +AC_SUBST([CFLAGS], ["$OPTIM $DEBUG $EXTRA $FFTW_CFLAGS"]) +AC_SUBST([CXXFLAGS], ["$OPTIM $DEBUG $EXTRA $FFTW_LIBS"]) -# Checks for libraries. +# Checks for UHD. AS_IF([test "x$enable_output_uhd" = "xyes"], [AC_DEFINE(HAVE_OUTPUT_UHD, [1], [Define if UHD output is enabled]) , AC_CHECK_LIB([uhd], [main], [], [AC_MSG_ERROR([library uhd is missing])])]) @@ -110,11 +128,8 @@ AC_CHECK_LIB([boost_thread], [main], [], [AC_MSG_ERROR([library boost_thread is AC_CHECK_LIB([rt], [clock_gettime], [], [AC_MSG_ERROR([library rt is missing])]) -AS_IF([test "x$enable_fftw" != "xno"], - [AC_CHECK_LIB([fftw3f], [fftw_execute], - AC_MSG_NOTICE([Found FFTW3]), - AC_MSG_NOTICE([Failed to find FFTW3]) )] ) - +# Tests for different memory allocation debuggers. +# Valgrind doesn't need any. AS_IF([test "x$enable_debug" != "xno"], [AS_IF([test "x$with_debug_malloc" != "xno"], [AS_IF([test "x$with_debug_malloc" = "xyes"], @@ -145,6 +160,7 @@ AC_COMPILE_IFELSE( [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_DEFINE([M_PIl], [M_PI], [Replacing define])]) AC_LANG_POP([C++]) + # Check for SSE AC_MSG_CHECKING(for SSE in current arch/CFLAGS) AC_LINK_IFELSE([ @@ -165,7 +181,7 @@ AC_MSG_RESULT($has_sse) AM_CONDITIONAL([HAVE_SSE], [test "x$has_sse" = "xyes"]) -AM_CONDITIONAL([IS_GIT_REPO], [test -d '.git']) +# TODO: Check for NEON AC_TYPE_SIGNAL AC_CHECK_FUNCS([bzero floor ftime gettimeofday memset sqrt strchr strerror strtol]) @@ -197,7 +213,7 @@ disabled="" for feat in with_debug_malloc has_sse do eval var=\$$feat - AS_IF([test "x$var" = "xyes"], + AS_IF([test "x$var" != "xno"], [enabled="$enabled $feat"], [disabled="$disabled $feat"]) done diff --git a/src/Makefile.am b/src/Makefile.am index 3d1eefc..6c83cb1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,13 +23,13 @@ GITVERSION_FLAGS = endif if HAVE_INPUT_ZEROMQ_TEST -ZMQ_LIBS =-lzmq +ZMQ_LIBS = -lzmq else ZMQ_LIBS = endif if HAVE_OUTPUT_UHD_TEST -UHD_SOURCES =OutputUHD.cpp OutputUHD.h +UHD_SOURCES = OutputUHD.cpp OutputUHD.h else UHD_SOURCES = endif @@ -40,88 +40,95 @@ else SIMD_CFLAGS = endif -bin_PROGRAMS = odr-dabmod +bin_PROGRAMS = odr-dabmod if USE_KISS_FFT FFT_DIR=$(top_builddir)/lib/kiss_fft129 FFT_INC=-I$(FFT_DIR) -I$(FFT_DIR)/tools -FFT_SRC=$(FFT_DIR)/kiss_fft.c $(FFT_DIR)/kiss_fft.h $(FFT_DIR)/tools/kiss_fftr.c $(FFT_DIR)/tools/kiss_fftr.h kiss_fftsimd.c kiss_fftsimd.h +FFT_SRC=$(FFT_DIR)/kiss_fft.c \ + $(FFT_DIR)/kiss_fft.h \ + $(FFT_DIR)/tools/kiss_fftr.c \ + $(FFT_DIR)/tools/kiss_fftr.h \ + kiss_fftsimd.c \ + kiss_fftsimd.h FFT_FLG=-ffast-math .PHONY: kiss_fft129 reed-solomon-4.0 -DabModulator.cpp: $(FFT_DIR) +DabModulator.cpp: $(FFT_DIR) -BUILT_SOURCES: $(FFT_DIR) +BUILT_SOURCES: $(FFT_DIR) FFT_LDADD= + +$(FFT_DIR): + if [ ! -e $(FFT_DIR) ]; then \ + tar xzf $(top_srcdir)/lib/kiss_fft129.tar.gz -C $(top_builddir)/lib; \ + fi + else -FFT_LDADD=-lfftw3f -lm +FFT_LDADD= FFT_DIR= FFT_INC= FFT_SRC= FFT_FLG= endif -$(FFT_DIR): - if [ ! -e $(FFT_DIR) ]; then \ - tar xzf $(top_srcdir)/lib/kiss_fft129.tar.gz -C $(top_builddir)/lib; \ - fi - -odr_dabmod_CPPFLAGS = -Wall $(FFT_INC) $(FFT_FLG) $(SIMD_CFLAGS) $(GITVERSION_FLAGS) +odr_dabmod_CPPFLAGS = -Wall \ + $(FFT_INC) $(FFT_FLG) $(SIMD_CFLAGS) $(GITVERSION_FLAGS) odr_dabmod_LDADD = $(ZMQ_LIBS) $(FFT_LDADD) odr_dabmod_SOURCES = DabMod.cpp \ - PcDebug.h \ - porting.c porting.h \ - DabModulator.cpp DabModulator.h \ - Buffer.cpp Buffer.h \ - ModCodec.cpp ModCodec.h \ - ModPlugin.cpp ModPlugin.h \ - ModFormat.cpp ModFormat.h \ - EtiReader.cpp EtiReader.h \ - Eti.cpp Eti.h \ - FicSource.cpp FicSource.h \ + PcDebug.h \ + porting.c porting.h \ + DabModulator.cpp DabModulator.h \ + Buffer.cpp Buffer.h \ + ModCodec.cpp ModCodec.h \ + ModPlugin.cpp ModPlugin.h \ + ModFormat.cpp ModFormat.h \ + EtiReader.cpp EtiReader.h \ + Eti.cpp Eti.h \ + FicSource.cpp FicSource.h \ FIRFilter.cpp FIRFilter.h \ - ModInput.cpp ModInput.h \ - PuncturingRule.cpp PuncturingRule.h \ - PuncturingEncoder.cpp PuncturingEncoder.h \ - SubchannelSource.cpp SubchannelSource.h \ - Flowgraph.cpp Flowgraph.h \ - GainControl.cpp GainControl.h \ - OutputMemory.cpp OutputMemory.h \ + ModInput.cpp ModInput.h \ + PuncturingRule.cpp PuncturingRule.h \ + PuncturingEncoder.cpp PuncturingEncoder.h \ + SubchannelSource.cpp SubchannelSource.h \ + Flowgraph.cpp Flowgraph.h \ + GainControl.cpp GainControl.h \ + OutputMemory.cpp OutputMemory.h \ TimestampDecoder.h TimestampDecoder.cpp \ - $(UHD_SOURCES) \ - ModOutput.cpp ModOutput.h \ - InputMemory.cpp InputMemory.h \ + $(UHD_SOURCES) \ + ModOutput.cpp ModOutput.h \ + InputMemory.cpp InputMemory.h \ InputFileReader.cpp InputZeroMQReader.cpp InputReader.h \ - OutputFile.cpp OutputFile.h \ - FrameMultiplexer.cpp FrameMultiplexer.h \ - ModMux.cpp ModMux.h \ - PrbsGenerator.cpp PrbsGenerator.h \ - BlockPartitioner.cpp BlockPartitioner.h \ - QpskSymbolMapper.cpp QpskSymbolMapper.h \ - FrequencyInterleaver.cpp FrequencyInterleaver.h \ - PhaseReference.cpp PhaseReference.h \ - DifferentialModulator.cpp DifferentialModulator.h \ - NullSymbol.cpp NullSymbol.h \ - SignalMultiplexer.cpp SignalMultiplexer.h \ - CicEqualizer.cpp CicEqualizer.h \ - OfdmGenerator.cpp OfdmGenerator.h \ - GuardIntervalInserter.cpp GuardIntervalInserter.h \ - Resampler.cpp Resampler.h \ - ConvEncoder.cpp ConvEncoder.h \ - TimeInterleaver.cpp TimeInterleaver.h \ + OutputFile.cpp OutputFile.h \ + FrameMultiplexer.cpp FrameMultiplexer.h \ + ModMux.cpp ModMux.h \ + PrbsGenerator.cpp PrbsGenerator.h \ + BlockPartitioner.cpp BlockPartitioner.h \ + QpskSymbolMapper.cpp QpskSymbolMapper.h \ + FrequencyInterleaver.cpp FrequencyInterleaver.h \ + PhaseReference.cpp PhaseReference.h \ + DifferentialModulator.cpp DifferentialModulator.h \ + NullSymbol.cpp NullSymbol.h \ + SignalMultiplexer.cpp SignalMultiplexer.h \ + CicEqualizer.cpp CicEqualizer.h \ + OfdmGenerator.cpp OfdmGenerator.h \ + GuardIntervalInserter.cpp GuardIntervalInserter.h \ + Resampler.cpp Resampler.h \ + ConvEncoder.cpp ConvEncoder.h \ + TimeInterleaver.cpp TimeInterleaver.h \ ThreadsafeQueue.h \ Log.cpp Log.h \ RemoteControl.cpp RemoteControl.h \ zmq.hpp -nodist_odr_dabmod_SOURCES =$(FFT_SRC) +nodist_odr_dabmod_SOURCES = $(FFT_SRC) -dist_bin_SCRIPTS =crc-dwap.py +dist_bin_SCRIPTS = crc-dwap.py if USE_KISS_FFT -EXTRA_DIST =kiss_fftsimd.c kiss_fftsimd.h +EXTRA_DIST = kiss_fftsimd.c kiss_fftsimd.h clean-local: rm -rf $(FFT_DIR) |