forked from andresv/homebrew-gnuradio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gnuradio.rb
120 lines (104 loc) · 3.85 KB
/
gnuradio.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
require 'formula'
class Gnuradio < Formula
homepage 'http://gnuradio.org'
url 'http://gnuradio.org/releases/gnuradio/gnuradio-3.7.5.1.tar.gz'
sha1 'ccb66c462aff098bcdace60e52aad64439177b48'
head 'https://github.com/gnuradio/gnuradio.git'
option 'with-qt', 'Build with Qt 4 or 5 support'
option 'with-wx', 'Build with WX gui toolkit support'
option 'with-zeromq', 'Build with zeromq support'
option 'with-docs', 'Build programming documentation(in API documentation) and html man page'
depends_on 'cmake' => :build
depends_on 'Cheetah' => :python
depends_on 'lxml' => :python
depends_on 'numpy' => :python
depends_on 'scipy' => :python
depends_on 'matplotlib' => :python
depends_on 'python'
depends_on 'boost'
depends_on 'gsl'
depends_on 'fftw'
depends_on 'swig' => :build
depends_on 'pygtk'
depends_on 'sdl'
depends_on 'libusb'
depends_on 'orc'
depends_on 'pyqt' if build.with? 'qt'
depends_on 'pyqwt' if build.with? 'qt'
depends_on 'wxpython' if build.with? 'wx'
depends_on 'cppzmq' if build.with? 'zeromq'
depends_on 'doxygen' if build.with? 'docs'
fails_with :clang do
build 421
cause "Fails to compile .S files."
end
def patches
DATA
end
def install
mkdir 'build' do
args = ["-DCMAKE_PREFIX_PATH=#{prefix}", "-DQWT_INCLUDE_DIRS=#{HOMEBREW_PREFIX}/lib/qwt.framework/Headers"] + std_cmake_args
args << '-DENABLE_GR_QTGUI=OFF' if build.without? 'qt'
args << '-DENABLE_DOXYGEN=OFF' if build.without? 'docs'
args << '-DCMAKE_CXX_FLAGS=-std=c++11 -stdlib=libc++ -Wno-narrowing -Wno-static-float-init'
args << '-DCMAKE_CXX_LINK_FLAGS=-stdlib=libc++'
# From opencv.rb
python_prefix = `python-config --prefix`.strip
# Python is actually a library. The libpythonX.Y.dylib points to this lib, too.
if File.exist? "#{python_prefix}/Python"
# Python was compiled with --framework:
args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'"
if !MacOS::CLT.installed? and python_prefix.start_with? '/System/Library'
# For Xcode-only systems, the headers of system's python are inside of Xcode
args << "-DPYTHON_INCLUDE_DIR='#{MacOS.sdk_path}/System/Library/Frameworks/Python.framework/Versions/2.7/Headers'"
else
args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/Headers'"
end
else
python_lib = "#{python_prefix}/lib/lib#{which_python}"
if File.exists? "#{python_lib}.a"
args << "-DPYTHON_LIBRARY='#{python_lib}.a'"
else
args << "-DPYTHON_LIBRARY='#{python_lib}.dylib'"
end
args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/include/#{which_python}'"
end
args << "-DPYTHON_PACKAGES_PATH='#{lib}/#{which_python}/site-packages'"
system 'cmake', '..', *args
system 'make'
system 'make install'
end
end
def python_path
python = Formula['python']
kegs = python.rack.children.reject { |p| p.basename.to_s == '.DS_Store' }
kegs.find { |p| Keg.new(p).linked? } || kegs.last
end
def caveats
<<-EOS.undent
If you want to use custom blocks, create this file:
~/.gnuradio/config.conf
[grc]
local_blocks_path=/usr/local/share/gnuradio/grc/blocks
EOS
end
def which_python
"python" + `python -c 'import sys;print(sys.version[:3])'`.strip
end
end
__END__
diff --git a/gr-fec/lib/cc_decoder_impl.cc b/gr-fec/lib/cc_decoder_impl.cc
index 20587a2..f0d8cfd 100644
--- a/gr-fec/lib/cc_decoder_impl.cc
+++ b/gr-fec/lib/cc_decoder_impl.cc
@@ -147,8 +147,11 @@ namespace gr {
d_SUBSHIFT = 0;
}
+#if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
+ yp_kernel = {{"k=7r=2", volk_8u_x4_conv_k7_r2_8u}};
+#else
yp_kernel = boost::assign::map_list_of("k=7r=2", volk_8u_x4_conv_k7_r2_8u);
-
+#endif
std::string k_ = "k=";
std::string r_ = "r=";