discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] log2() missing in MSVC v16


From: Gisle Vanem
Subject: [Discuss-gnuradio] log2() missing in MSVC v16
Date: Wed, 22 Oct 2014 15:16:49 +0200

Hi again.

I finally was able to build most of GR using CMake and
the generated "Visual Studio 2010" gnuradio.sln file. Since I'm
not sure if this platform is supported or not, it may be a futile attempt.

I patched cmake/msvc/config.h since I figured that was the active one. IMHO it's confusing that 'volk\cmake\msvc\config.h' seems to include almost the same stuff.

Well, volk now uses the log2() function which my MSVC v16
doesn't have. And multiply_matrix_ff_impl.cc etc. uses these ISO-646 "keywords" like 'not', 'and' etc. I solved these errors by patching cmake/msvc/config.h like so:

@@ -29,6 +29,16 @@
static inline double rint(double x){return (x > 0.0)? floor(x + 0.5) : ceil(x - 
0.5);}
static inline float rintf(float x){return (x > 0.0f)? floorf(x + 0.5f) : 
ceilf(x - 0.5f);}

+static inline double log2 (double x)
+{
+  return log ((double)x) / log (2.0F);
+}
+
+// Use of ISO-646 keyword ('not', 'and' etc. needs this header.
+#ifdef __cplusplus
+#include <ciso646>
+#endif
+

(the cast in log2() was need to resolve any C++ ambiguty).
Not sure if this hurts if VC 2012+ already have log2() in it's <math.h>.

BTW.

Here is how I used VC 2010 Express to build:
 cmake -G "Visual Studio 10 2010"
msbuild -nologo -p:Configuration=Release -fileLogger -fileLoggerParameter:Summary;Verbosity=minimal;LogFile=gnuradio-build.log gnuradio.sln

Anybody else having success with VC 2010? Or are you Windows users
(Ettus?) using VS 2012 only? Seems like Win-XP is unsupported since I get
a call to the non-existant GetThreadId(). It's in kernel32.dll, but on Vista+ 
only.

--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]