discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Re: Re: gr-howto-write-a-block


From: William Sherman
Subject: [Discuss-gnuradio] Re: Re: gr-howto-write-a-block
Date: Sat, 18 Apr 2009 03:12:12 +0200

George Nychis wrote:
> On Fri, Apr 17, 2009 at 1:09 AM, William Sherman 
> <address@hidden>wrote:
> 
>> Do I need to building gr-howto-write-a-block-3.1.3 from inside the
>> gnuradio directory instead of just some random directory where it is
>> currently located?
>>
> 
> The point of the standalone (random) tree is so that it doesn't need to 
> be
> inside the GNU Radio tree to work ;)
> 
>  Did you do a "sudo make install" also?
> 
> - George

I did a make install at the end. I do not have sudo privileges. Is sudo 
necessary?

The full sequence I am executing is,

>automake
>env LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib" CPPFLAGS="-I/usr/pkg/include" 
>./configure --prefix=/u/students/renyu/Masters/ren_static/installdir
>make
>make install

make install creates a lib and include folder in installdir with 
howtoren.pyo, pyc, py, so la (my new block is a howtoren module with the 
one block bin_statistics_mean_f.

I read on the howto write your own block tutorial that you need to get 
python to "see" where your new module is:

"The build tree is everything from topdir (the one containing 
configure.ac) down. The path to the install tree is 
prefix/lib/pythonversion/site-packages, where prefix is the --prefix 
argument to configure (default /usr/local) and version is the installed 
version of python. A typical value is 
/usr/local/lib/python2.3/site-packages.

We normally set our PYTHONPATH environment variable to point at the 
install tree, and do this in ~/.bash_profile or ~/.profile. This allows 
our python apps to access all the standard python libraries, plus our 
locally installed stuff like GNU Radio."

I created ~/.bash_profile and ~/.profile, with contents:

setenv PYTHONPATH 
/u/students/renyu/Masters/ren_static/installdir/lib/python2.5/site-packages/

However I still can't from gnuradio import howtoren.

Any advice?


This is my howtoren.py for verification:

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.31
#
# Don't modify this file, modify the SWIG interface instead.

import _howtoren
import new
new_instancemethod = new.instancemethod
try:
    _swig_property = property
except NameError:
    pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
    if (name == "thisown"): return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'PySwigObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name,None)
    if method: return method(self,value)
    if (not static) or hasattr(self,name):
        self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)

def _swig_setattr(self,class_type,name,value):
    return _swig_setattr_nondynamic(self,class_type,name,value,0)

def _swig_getattr(self,class_type,name):
    if (name == "thisown"): return self.this.own()
    method = class_type.__swig_getmethods__.get(name,None)
    if method: return method(self)
    raise AttributeError,name

def _swig_repr(self):
    try: strthis = "proxy of " + self.this.__repr__()
    except: strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, 
self.__class__.__name__, strthis,)

import types
try:
    _object = types.ObjectType
    _newclass = 1
except AttributeError:
    class _object : pass
    _newclass = 0
del types


def _swig_setattr_nondynamic_method(set):
    def set_attr(self,name,value):
        if (name == "thisown"): return self.this.own(value)
        if hasattr(self,name) or (name == "this"):
            set(self,name,value)
        else:
            raise AttributeError("You cannot add attributes to %s" % 
self)
    return set_attr


class howtoren_bin_statistics_mean_f_sptr(object):
    """Proxy of C++ howtoren_bin_statistics_mean_f_sptr class"""
    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: 
x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr
    def __init__(self, *args):
        """
        __init__(self) -> howtoren_bin_statistics_mean_f_sptr
        __init__(self,  p) -> howtoren_bin_statistics_mean_f_sptr
        """
        this = _howtoren.new_howtoren_bin_statistics_mean_f_sptr(*args)
        try: self.this.append(this)
        except: self.this = this
    def __deref__(*args):
        """__deref__(self)"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr___deref__(*args)

    __swig_destroy__ = 
_howtoren.delete_howtoren_bin_statistics_mean_f_sptr
    __del__ = lambda self : None;
    def history(*args):
        """history(self) -> unsigned int"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr_history(*args)

    def output_multiple(*args):
        """output_multiple(self) -> int"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr_output_multiple(*args)

    def relative_rate(*args):
        """relative_rate(self) -> double"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr_relative_rate(*args)

    def start(*args):
        """start(self) -> bool"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr_start(*args)

    def stop(*args):
        """stop(self) -> bool"""
        return _howtoren.howtoren_bin_statistics_mean_f_sptr_stop(*args)

    def detail(*args):
        """detail(self) -> gr_block_detail_sptr"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr_detail(*args)

    def set_detail(*args):
        """set_detail(self, gr_block_detail_sptr detail)"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr_set_detail(*args)

    def name(*args):
        """name(self) -> string"""
        return _howtoren.howtoren_bin_statistics_mean_f_sptr_name(*args)

    def input_signature(*args):
        """input_signature(self) -> gr_io_signature_sptr"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr_input_signature(*args)

    def output_signature(*args):
        """output_signature(self) -> gr_io_signature_sptr"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr_output_signature(*args)

    def unique_id(*args):
        """unique_id(self) -> long"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr_unique_id(*args)

    def basic_block(*args):
        """basic_block(self) -> gr_basic_block_sptr"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr_basic_block(*args)

    def check_topology(*args):
        """check_topology(self, int ninputs, int noutputs) -> bool"""
        return 
_howtoren.howtoren_bin_statistics_mean_f_sptr_check_topology(*args)

howtoren_bin_statistics_mean_f_sptr_swigregister = 
_howtoren.howtoren_bin_statistics_mean_f_sptr_swigregister
howtoren_bin_statistics_mean_f_sptr_swigregister(howtoren_bin_statistics_mean_f_sptr)


def howtoren_bin_statistics_mean_f_block(*args):
  """howtoren_bin_statistics_mean_f_block(howtoren_bin_statistics_mean_f_sptr 
r) -> gr_block_sptr"""
  return _howtoren.howtoren_bin_statistics_mean_f_block(*args)
howtoren_bin_statistics_mean_f_sptr.block = lambda self: 
howtoren_bin_statistics_mean_f_block (self)
howtoren_bin_statistics_mean_f_sptr.__repr__ = lambda self: "<gr_block 
%s (%d)>" % (self.name(), self.unique_id ())


def bin_statistics_mean_f(*args):
  """
    bin_statistics_mean_f(unsigned int vlen, gr_msg_queue_sptr msgq, 
gr_feval_dd tune,
        size_t tune_delay, size_t dwell_delay) -> 
howtoren_bin_statistics_mean_f_sptr
    """
  return _howtoren.bin_statistics_mean_f(*args)










-- 
Posted via http://www.ruby-forum.com/.




reply via email to

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