[Top][All Lists]

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

[Discuss-gnuradio] OOT Module Template Expansion Issues

From: Jacob Gilbert
Subject: [Discuss-gnuradio] OOT Module Template Expansion Issues
Date: Thu, 24 Mar 2016 12:25:43 -0600

I am attempting to add several templatized blocks to an OOT module and am having trouble with getting things to build correctly.

After using modtool to add the new block, adding the .t extensions to the impl.cc/imp.h/.h files, and adding test code, I added the following to ../lib/CMakeLists.txt:

GR_EXPAND_X_CC_H(testmod testblock_X_impl              c f i s b)


list(APPEND testmod_sources
    <other block sources...>

and the following to ../include/testmod/CMakeLists.txt:

GR_EXPAND_X_H(testmod testblock_X              c f i s b)

add_custom_target(testmod_generated_includes DEPENDS


    <other header files...>

These were borrowed from in-tree templates like fir_filter_XXX; I was unable to find an OOT module using templates. I also added appropriate #include, %include, and GR_SWIG_BLOCK_MAGIC2 to swig/testmod_swig.i for each of the generated blocks. However, when I attempt to build I get the following error:

  File "/home/jacob/gr-testmod/build/include/testmod/generate_helper.py", line 9, in <module>
    import build_utils
ImportError: No module named build_utils

This obviously does not happen to in-tree modules. I attempted to modify the gr-testmod/cmake/Modules/GrMiscUtils.cmake file where the GR_EXPAND_.X..() macros are defined to explicitly include the appropriate path, however it appears that by default the include statement I am using actually uses the GrMiscUtils.cmake installed with gnuradio (into /usr/local/lib/cmake/gnuradio/ in my case). If I modify the used GR_EXPAND_X... macros and manually add the correct path (sys.path.append('${CMAKE_CURRENT_SOURCE_DIR}/../python') or '../../python' in the case of the include macro), expansion works correctly, however this makes the code very un-portable. 

Given my elementary understand of CMake, I have no idea what I am doing incorrectly, or what changes if any should be made to modtool, but I was unable to find any other documents on how to go about doing this.


reply via email to

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