Skip to content

Commit

Permalink
filter: work on creating gr-filter top-level component.
Browse files Browse the repository at this point in the history
Builds but does not bring in libgnuradio-fft.so symbols.
  • Loading branch information
trondeau committed May 2, 2012
1 parent a7afbf2 commit f64b971
Show file tree
Hide file tree
Showing 21 changed files with 1,098 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -229,6 +229,7 @@ add_subdirectory(gnuradio-core)
add_subdirectory(grc)

add_subdirectory(gr-fft)
add_subdirectory(gr-filter)
add_subdirectory(gr-atsc)
add_subdirectory(gr-audio)
add_subdirectory(gr-comedi)
Expand Down
109 changes: 109 additions & 0 deletions gr-filter/CMakeLists.txt
@@ -0,0 +1,109 @@
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

########################################################################
# Setup dependencies
########################################################################
include(GrBoost)

########################################################################
# Register component
########################################################################
include(GrComponent)

GR_REGISTER_COMPONENT("gr-filter" ENABLE_GR_FILTER
ENABLE_GRUEL
ENABLE_VOLK
Boost_FOUND
ENABLE_GR_CORE
ENABLE_GR_FFT
)

GR_SET_GLOBAL(FILTER_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/lib
${CMAKE_CURRENT_SOURCE_DIR}/include
)

########################################################################
# Begin conditional configuration
########################################################################
if(ENABLE_GR_FILTER)

########################################################################
# Setup CPack components
########################################################################
include(GrPackage)
CPACK_SET(CPACK_COMPONENT_GROUP_FILTER_DESCRIPTION "GNU Radio Filter Blocks")

CPACK_COMPONENT("filter_runtime"
GROUP "Filter"
DISPLAY_NAME "Runtime"
DESCRIPTION "Runtime"
DEPENDS "core_runtime"
)

CPACK_COMPONENT("filter_devel"
GROUP "Filter"
DISPLAY_NAME "Development"
DESCRIPTION "C++ headers, package config, import libraries"
DEPENDS "core_devel"
)

CPACK_COMPONENT("filter_python"
GROUP "Filter"
DISPLAY_NAME "Python"
DESCRIPTION "Python modules for runtime; GRC xml files"
DEPENDS "core_python;filter_runtime"
)

CPACK_COMPONENT("filter_swig"
GROUP "Filter"
DISPLAY_NAME "SWIG"
DESCRIPTION "SWIG development .i files"
DEPENDS "core_swig;filter_python;filter_devel"
)

########################################################################
# Add subdirectories
########################################################################
add_subdirectory(include/filter)
add_subdirectory(lib)
if(ENABLE_PYTHON)
add_subdirectory(swig)
add_subdirectory(python)
add_subdirectory(grc)
endif(ENABLE_PYTHON)
#add_subdirectory(examples)
add_subdirectory(doc)

########################################################################
# Create Pkg Config File
########################################################################
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-filter.pc.in
${CMAKE_CURRENT_BINARY_DIR}/gnuradio-filter.pc
@ONLY)

install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-filter.pc
DESTINATION ${GR_LIBRARY_DIR}/pkgconfig
COMPONENT "filter_devel"
)

endif(ENABLE_GR_FILTER)
23 changes: 23 additions & 0 deletions gr-filter/doc/CMakeLists.txt
@@ -0,0 +1,23 @@
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

install(
FILES README.filter
DESTINATION ${GR_PKG_DOC_DIR}
)
13 changes: 13 additions & 0 deletions gr-filter/doc/README.filter
@@ -0,0 +1,13 @@
This is the gr-filter package. It contains signal processing blocks to
perform filtering operations.

The Python namespace is in gnuradio.filter, which would be normally
imported as:

from gnuradio import filter

See the Doxygen documentation for details about the blocks available
in this package. A quick listing of the details can be found in Python
after importing by using:

help(filter)
27 changes: 27 additions & 0 deletions gr-filter/doc/filter.dox
@@ -0,0 +1,27 @@
/*! \page page_filter filter Signal Processing Blocks

\section Introduction

This is the gr-filter package. It contains signal processing blocks to
perform filtering operations.

The Python namespace is in gnuradio.filter, which would be normally
imported as:

\code
from gnuradio import filter
\endcode

See the Doxygen documentation for details about the blocks available
in this package. A quick listing of the details can be found in Python
after importing by using:

\code
help(filter)
\endcode

\section Dependencies

The filter blocks depend on \ref page_fft.

*/
11 changes: 11 additions & 0 deletions gr-filter/gnuradio-filter.pc.in
@@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: gnuradio-filter
Description: GNU Radio's filter signal processing blocks
Requires: gnuradio-core gnuradio-fft
Version: @LIBVER@
Libs: -L${libdir} -lgnuradio-filter
Cflags: -I${includedir}
24 changes: 24 additions & 0 deletions gr-filter/grc/CMakeLists.txt
@@ -0,0 +1,24 @@
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

install(FILES
filter_block_tree.xml
DESTINATION ${GRC_BLOCKS_DIR}
COMPONENT "filter_python"
)
34 changes: 34 additions & 0 deletions gr-filter/grc/filter_block_tree.xml
@@ -0,0 +1,34 @@
<?xml version="1.0"?>

<!--
Copyright 2012 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Radio is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Radio; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street,
Boston, MA 02110-1301, USA.
-->

<!--
###################################################
##Block Tree for GR Filter blocks.
###################################################
-->
<cat>
<name></name> <!-- Blank for Root Name -->
<cat>
<name>Filters</name>
</cat>
</cat>
82 changes: 82 additions & 0 deletions gr-filter/include/filter/CMakeLists.txt
@@ -0,0 +1,82 @@
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

########################################################################
# generate helper scripts to expand templated files
########################################################################
include(GrPython)

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
#!${PYTHON_EXECUTABLE}
import sys, os, re
sys.path.append('${GR_CORE_PYTHONPATH}')
os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
if __name__ == '__main__':
import build_utils
root, inp = sys.argv[1:3]
for sig in sys.argv[3:]:
name = re.sub ('X+', sig, root)
d = build_utils.standard_dict2(name, sig, 'filter')
build_utils.expand_template(d, inp)
")

macro(expand_h root)
#make a list of all the generated files
unset(expanded_files_h)
foreach(sig ${ARGN})
string(REGEX REPLACE "X+" ${sig} name ${root})
list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
endforeach(sig)

#create a command to generate the files
add_custom_command(
OUTPUT ${expanded_files_h}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
${root} ${root}.h.t ${ARGN}
)

#install rules for the generated h files
list(APPEND generated_includes ${expanded_files_h})
endmacro(expand_h)

########################################################################
# Invoke macro to generate various sources
#######################################################################
#expand_h(fir_filter_XXX fff ccc ccf fcc fsf scc)

#add_custom_target(filter_generated_includes DEPENDS
# ${generated_includes}
#)

########################################################################
# Install header files
########################################################################
install(FILES
api.h
fir_filter_fff.h
DESTINATION ${GR_INCLUDE_DIR}/gnuradio/fft
COMPONENT "fft_devel"
)

33 changes: 33 additions & 0 deletions gr-filter/include/filter/api.h
@@ -0,0 +1,33 @@
/*
* Copyright 2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/

#ifndef INCLUDED_FILTER_API_H
#define INCLUDED_FILTER_API_H

#include <gruel/attributes.h>

#ifdef gnuradio_filter_EXPORTS
# define FILTER_API __GR_ATTR_EXPORT
#else
# define FILTER_API __GR_ATTR_IMPORT
#endif

#endif /* INCLUDED_FILTER_API_H */

0 comments on commit f64b971

Please sign in to comment.