I successfully built the how-to-write-a-block example outside of
gnuradio-core. Now, I would like to implement my own version of
gr_file_source, and I was hoping to do it outside of gnuradio-core.  

As a first step, I copied gr_file_source.* from core into a directory
structure similar to that used in the howto, and then changed all
occurrences of gr_file* to rad_file* and made the appropriate (?)
changes to configure.ac and all the Makefile.am.

However, on make, SWIG reports that it doesn't know anything about
gr_sync_block, which is inherited from rad_file_source. Here's what make
says:

make  all-recursive
make[1]: Entering directory `/home/pattonlk/grrad/radar'
Making all in config
make[2]: Entering directory `/home/pattonlk/grrad/radar/config'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/pattonlk/grrad/radar/config'
Making all in src
make[2]: Entering directory `/home/pattonlk/grrad/radar/src'
Making all in lib
make[3]: Entering directory `/home/pattonlk/grrad/radar/src/lib'
/gnuradio/gr/bin/swig -c++ -fvirtual -python -modern -
I/gnuradio/gr/include/gnuradio/swig -I/gnuradio/gr/include/gnuradio -
module rad -o rad.cc rad.i
rad.i:31: Error: Syntax error in input(1).
rad.i:35: Warning(401): Nothing known about base class 'gr_sync_block'.
Ignored.
make[3]: *** [rad.cc] Error 1
make[3]: Leaving directory `/home/pattonlk/grrad/radar/src/lib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/pattonlk/grrad/radar/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pattonlk/grrad/radar'
make: *** [all] Error 2


gr_sync_block.h is in /gnuradio/gr/include/gnuradio, which is in the
include path. Do I need a -L or something? Does anyone have any idea
what bone-headed thing I'm doing wrong?  I've attached logs of configure
and make, along with my swig file.

Thanks,
 - Lee

checking build system type... i686-redhat-linux-gnu
checking host system type... i686-redhat-linux-gnu
checking target system type... i686-redhat-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking whether C++ has bool... yes
checking whether C++ has buggy scoping in for-loops... no
checking whether user wants assertions... yes
checking whether C++ has std::isnan... no
checking whether user wants warnings... yes
checking whether g++ accepts -Wall... yes
checking whether g++ accepts -Woverloaded-virtual... yes
checking whether user wants gprof... no
checking whether user wants prof... no
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g77... g77
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether g77 accepts -g... yes
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for g77 option to produce PIC... -fPIC
checking if g77 PIC flag -fPIC works... yes
checking if g77 supports -c -o file.o... yes
checking whether the g77 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for python... /usr/bin/python
checking for python version... 2.3
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.3/site-packages
checking for python extension module directory... 
${exec_prefix}/lib/python2.3/site-packages
checking for Python include path... /usr/include/python2.3
checking Python.h usability... yes
checking Python.h presence... yes
checking for Python.h... yes
checking for swig... /gnuradio/gr/bin/swig
checking for SWIG version... 1.3.26
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for cc_r... gcc
checking for library containing clock_gettime... -lrt
checking for clock_gettime... yes
checking for gettimeofday... yes
checking for nanosleep... yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for strings.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/types.h... (cached) yes
checking for fcntl.h... (cached) yes
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking for winioctl.h... no
checking for winbase.h... no
checking for getopt... yes
checking for usleep... yes
checking for gettimeofday... (cached) yes
checking for nanosleep... (cached) yes
checking for rand... yes
checking for srand... yes
checking for random... yes
checking for srandom... yes
checking for sleep... yes
checking for sigaction... yes
checking for struct timezone... yes
checking for struct timespec... yes
checking for ssize_t... yes
checking for getopt... (cached) yes
checking for usleep... (cached) yes
checking for gettimeofday... (cached) yes
checking for Sleep... no
checking whether mkdir accepts only one arg... no
checking for pkg-config... /usr/bin/pkg-config
checking for gnuradio-core >= 2... yes
checking GNURADIO_CORE_CFLAGS... -pthread -I/gnuradio/gr/include/gnuradio  
checking GNURADIO_CORE_LIBS... -L/gnuradio/gr/lib -lgnuradio-core -lfftw3f -lm  
checking GNURADIO_CORE_INCLUDEDIR... /gnuradio/gr/include/gnuradio
gr_boost_include_dir = 
checking boost/shared_ptr.hpp usability... yes
checking boost/shared_ptr.hpp presence... yes
checking for boost/shared_ptr.hpp... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config/Makefile
config.status: creating src/Makefile
config.status: creating src/lib/Makefile
config.status: creating src/python/Makefile
config.status: creating src/python/run_tests
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing run_tests commands
make  all-recursive
make[1]: Entering directory `/home/pattonlk/grrad/radar'
Making all in config
make[2]: Entering directory `/home/pattonlk/grrad/radar/config'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/pattonlk/grrad/radar/config'
Making all in src
make[2]: Entering directory `/home/pattonlk/grrad/radar/src'
Making all in lib
make[3]: Entering directory `/home/pattonlk/grrad/radar/src/lib'
/gnuradio/gr/bin/swig -c++ -fvirtual -python -modern 
-I/gnuradio/gr/include/gnuradio/swig -I/gnuradio/gr/include/gnuradio -module 
rad -o rad.cc rad.i
make[3]: Leaving directory `/home/pattonlk/grrad/radar/src/lib'
make[2]: Leaving directory `/home/pattonlk/grrad/radar/src'
make[1]: Leaving directory `/home/pattonlk/grrad/radar'
/* -*- c++ -*- */
/*
 * Copyright 2004 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 2, 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., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */


%constant int SEEK_SET = 0;     /* Seek from beginning of file. */
%constant int SEEK_CUR = 1;     /* Seek from current position.  */
%constant int SEEK_END = 2;     /* Seek from end of file.       */


GR_SWIG_BLOCK_MAGIC(rad,file_source)

rad_file_source_sptr 
rad_make_file_source (size_t itemsize, const char *filename, bool repeat=false);

class rad_file_source : public gr_sync_block
{
 protected:
  rad_file_source (size_t itemsize, const char *filename, bool repeat);

 public:
  ~rad_file_source ();

  bool seek (long seek_point, int whence);
};
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to