Note: This Question Category is currently disabled. You cannot post anything here.
1
While creating up counter block in python getting following erros at cmake

CMake Error: CMake can not determine linker language for target: gnuradio-Counters
CMake Error: Cannot determine link language for target "gnuradio-Counters".
CMake Error: CMake can not determine linker language for target: gnuradio-Counters
-- Generating done
-- Build files have been written to: /home/ashu/SandhiPro/gr-Counters/build
ashu@ashu-coep:~/SandhiPro/gr-Counters/build$ make
Scanning dependencies of target gnuradio-Counters
make[2]: *** No rule to make target `lib/CMakeFiles/gnuradio-Counters.dir/build'.  Stop.
make[1]: *** [lib/CMakeFiles/gnuradio-Counters.dir/all] Error 2
make: *** [all] Error 2
ashu@ashu-coep:~/SandhiPro/gr-Counters/build$




python code for the reference:
import numpy
from gnuradio import gr

class Up_counter(gr.sync_block):
    """
    docstring for block Up_counter
    """
    def __init__(self):
        gr.sync_block.__init__(self,
            name="Up_counter",
            in_sig=[numpy.float32,numpy.float32],
            out_sig=[numpy.float32,numpy.float32])
    self.i = 0

    global a
    a = 0
   

    def work(self, input_items, output_items):
        in0 = input_items[0]#PRESET
        in1 = input_items[1]#CLOCK
        out0 = output_items[0]#COUNT
        out0 = output_items[1]#STATUS

     if (self.i < in0[0]):

        if ((in1[0]) and (not(a))):
              self.i = self.i + 1
          out0[:] = [self.i] * len(out0)
          a = in1[0]
       # <+signal processing here+>
        else:
          a = in1[0]
          out1[:] = [0] * len(out1)
    else:
        out0[:] = [self.i] * len(out0)
        out0[:] = [in0[0]] * len(out0)
        out1[:] = [1] * len(out1)
        return len(output_items[0])



Sandhi 08-09-15, 12:31 p.m. Ashwini
0
You can directly copy the python file to "/usr/local/lib/python2.7/dist-packages/gnuradio" and copy the xml file to "/usr/local/share/gnuradio/grc/blocks"
20-01-16, 9:52 a.m. ambikeshwar