aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac27
-rw-r--r--src/Utils.cpp72
2 files changed, 42 insertions, 57 deletions
diff --git a/configure.ac b/configure.ac
index cd6f0ed..acefa90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,31 +161,22 @@ AC_COMPILE_IFELSE(
AC_LANG_POP([C++])
-# Check for SSE
-AC_MSG_CHECKING(for SSE in current arch/CFLAGS)
+# Check for march
+AC_MSG_CHECKING(if we can add -march=native to CFLAGS)
save_CXXFLAGS="$CXXFLAGS"
-CXXFLAGS="$CXXFLAGS -msse"
-AC_MSG_CHECKING([whether we need to add -msse])
+CXXFLAGS="$CXXFLAGS -march=native"
AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[
-#include <xmmintrin.h>
-__m128 testfunc(float *a, float *b) {
- return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b));
-}
+void testfunc(void) {}
]])],
-[has_sse=yes],
-[has_sse=no]
+[supports_march_native=yes],
+[supports_march_native=no]
)
-AC_MSG_RESULT($has_sse)
-if test x"$has_sse" = xno; then
+AC_MSG_RESULT($supports_march_native)
+if test x"$supports_march_native" = xno; then
CXXFLAGS="$save_CXXFLAGS"
fi
-
-AM_CONDITIONAL([HAVE_SSE], [test "x$has_sse" = "xyes"])
-
-# TODO: Check for NEON
-
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([bzero floor ftime gettimeofday memset sqrt strchr strerror strtol])
@@ -211,7 +202,7 @@ echo
echo
enabled=""
disabled=""
-for feat in with_debug_malloc has_sse enable_fast_math
+for feat in with_debug_malloc supports_march_native enable_fast_math
do
eval var=\$$feat
AS_IF([test "x$var" != "xno"],
diff --git a/src/Utils.cpp b/src/Utils.cpp
index 5bd93d9..cd116c7 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -30,18 +30,40 @@
#include <sys/prctl.h>
#include <pthread.h>
-void printUsage(const char* progName)
+static void printHeader()
{
- FILE* out = stderr;
-
- fprintf(out, "Welcome to %s %s, compiled at %s, %s\n\n",
- PACKAGE,
+ std::cerr << "ODR-DabMod version " <<
#if defined(GITVERSION)
- GITVERSION,
+ GITVERSION
#else
- VERSION,
+ VERSION
+#endif
+ ", compiled at " << __DATE__ << ", " << __TIME__ << std::endl;
+
+ std::cerr << "Compiled with features: " <<
+#if defined(HAVE_ZEROMQ)
+ "zeromq " <<
+#endif
+#if defined(HAVE_OUTPUT_UHD)
+ "output_uhd " <<
#endif
- __DATE__, __TIME__);
+#if defined(HAVE_SOAPYSDR)
+ "output_soapysdr " <<
+#endif
+#if defined(__FAST_MATH__)
+ "fast-math " <<
+#endif
+#if defined(__SSE__)
+ "SSE " <<
+#endif
+ "\n";
+}
+
+void printUsage(const char* progName)
+{
+ printHeader();
+
+ FILE* out = stderr;
fprintf(out, "Usage with configuration file:\n");
fprintf(out, "\t%s [-C] config_file.ini\n\n", progName);
@@ -87,16 +109,9 @@ void printUsage(const char* progName)
void printVersion(void)
{
- FILE *out = stderr;
+ printHeader();
- fprintf(out, "%s %s, compiled at %s, %s\n\n",
- PACKAGE,
-#if defined(GITVERSION)
- GITVERSION
-#else
- VERSION
-#endif
- ,__DATE__, __TIME__);
+ FILE *out = stderr;
fprintf(out,
" ODR-DabMod is copyright (C) Her Majesty the Queen in Right of Canada,\n"
" 2005 -- 2012 Communications Research Centre (CRC),\n"
@@ -123,28 +138,7 @@ void printVersion(void)
void printStartupInfo()
{
- std::cerr << "ODR-DabMod version " <<
-#if defined(GITVERSION)
- GITVERSION
-#else
- VERSION
-#endif
- << std::endl;
-
- std::cerr << "Compiled with features: " <<
-#if defined(HAVE_ZEROMQ)
- "zeromq " <<
-#endif
-#if defined(HAVE_OUTPUT_UHD)
- "output_uhd " <<
-#endif
-#if defined(HAVE_SOAPYSDR)
- "output_soapysdr " <<
-#endif
-#if defined(__FAST_MATH__)
- "fast-math" <<
-#endif
- "\n";
+ printHeader();
etiLog.level(info) << "Starting up version " <<
#if defined(GITVERSION)