External modules include path / namespace

Hi,

From looking at what gr_modtool generate, you get

include: $prefix/include/module_name/
namespace: gr::module_name::
python: $prefix/lib/site-package/module_name/

Since the module are placed in the gr:: namespace, wouldn’t it make
sense to have :

include: $prefix/include/gnuradio/module_name/
namespace: gr::module_name::
python: $prefix/lib/site-package/gnuradio/module_name/

This would also make external modules that much closer to internal
ones and further reduce the difference between in-tree / out-of-tree

Cheers,

Sylvain

On Sun, Jun 02, 2013 at 12:18:49AM +0200, Sylvain M. wrote:

This would also make external modules that much closer to internal
ones and further reduce the difference between in-tree / out-of-tree

Just pointing out that oot-modules have always been a bit different,
e.g. import MODULE vs. from gnuradio import MODULE. Also, I don’t mind
having a dedicated folder for core gnuradio stuff.
I agree making the folder structures for in- and out-tree modules more
similar is good, though. So, just some thoughts here, perhaps we’ll talk
about this this week.

MB


Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

Hi Martin,

I agree making the folder structures for in- and out-tree modules more
similar is good, though. So, just some thoughts here, perhaps we’ll talk
about this this week.

I don’t mind having a namespace for core stuff either but then maybe
it should have like gnuradio.ext.module_name or something and make it
coherent between include/c++ namespace/python.

Else you end up having to include some “gnuradio marker” in the module
name to make sure it doesn’t clash with general python stuff or
general include stuff.

I actually only realized that oot were still not under some “gnuradio”
separate path when converting a module this weekend and since I guess
a lot of OOT module are going to get ported soon, now would be the
right time.

Cheers,

Sylvain

On Jun 2, 2013, at 9:58, “Martin B. (CEL)” [email protected]
wrote:

python: $prefix/lib/site-package/gnuradio/module_name/

This would also make external modules that much closer to internal
ones and further reduce the difference between in-tree / out-of-tree

Just pointing out that oot-modules have always been a bit different,
e.g. import MODULE vs. from gnuradio import MODULE. Also, I don’t mind
having a dedicated folder for core gnuradio stuff.
I agree making the folder structures for in- and out-tree modules more
similar is good, though. So, just some thoughts here, perhaps we’ll talk
about this this week.

The main reason OOT modules are ‘import foo’ and not ‘from gnuradio
import foo’ is that OOT modules typically install into
$PREFIX=/usr/local, and if GNU Radio is installed into $PREFIX=/usr,
the import would not work.

Johnathan