On Wed, Dec 31, 2008 at 10:59:22AM -0500, Chris Noyes wrote:
> I'm trying to do an out of tree build using gcell on a PS3 with Fedora 8. Is
> anybody else working on this? Any pointers?
> I copied the 'gr-howto-write-a-block' folder out of the tree and followed
> the documentation to create my own block. I then copied
> 'Makefile.common.spu' and used the 'gr-gcell' fft example as a guide to edit
> my program. I was successful in getting a 'hello world from spe', but not
> without manually hacking the Makefiles to include/exclude certain includes
> and libraries. I'm hoping there's an easier way.
>
> Thanks,
> Chris
Hi Chris,
Yes, there's an easier way. The main thing you want to do is to copy
config/gr_standalone.m4, config/gr_gcell.m4, and config/pkg.m4 out of the
trunk and add them to your out-of-tree config directory. Invoke
GR_GCELL in your configure.ac and most of what you need will be set
up. See the attached files below.
I generally use a directory structure that looks like this:
mymodule/config # m4 macros
mymodule/include/mymodule # includes that will be installed in
PREFIX/include/mymodule
mymodule/include/mymodule/spu # SPU specific includes that will be installed
mymodule/lib # generic code
mymodule/lib/gcell # code that uses gcell
mymodule/lib/gcell/spu # SPU code used by code in lib/gcell
mymodule/python
mymodule/apps
lib/gcell is only built if the AM_CONDITIONAL HAVE_GCELL is true.
There's also a HAVE_GCELL value in config.h
If I get some time, I'll work up a revised out-of-tree skeleton that
includes conditionally built code that uses gcell. In the meantime,
I'm working on a "gcell-ized" version of FFTW :-)
Eric
dnl
dnl Copyright 2004,2005,2007,2008 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Radio
dnl
dnl GNU Radio is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl GNU Radio is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with GNU Radio; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
dnl This is kind of non-standard, but it sure shortens up this file :-)
m4_include([config/gr_standalone.m4])
GR_STANDALONE(mymodule,0.1.svn)
dnl Check for any libraries you need
dnl AC_CHECK_LIBRARY
dnl Check for header files you need
dnl AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/ioctl.h sys/time.h unistd.h)
dnl AC_CHECK_HEADERS(sys/mman.h)
dnl Checks for library functions.
dnl AC_CHECK_FUNCS([])
dnl We pick up the boost cppflags, cxxflags and thread lib via GNURADIO_CORE
dnl
dnl If you need additional boost libraries, you'll need to
dnl uncomment AX_BOOST_BASE, plus some of the following:
dnl
dnl calls AC_SUBST(BOOST_CPPFLAGS), AC_SUBST(BOOST_LDFLAGS) and defines
HAVE_BOOST
dnl AX_BOOST_BASE([1.35])
dnl
dnl All the rest of these call AC_SUBST(BOOST_<foo>_LIB) and define
HAVE_BOOST_<foo>
dnl
dnl AX_BOOST_DATE_TIME
dnl AX_BOOST_FILESYSTEM
dnl AX_BOOST_IOSTREAMS
dnl AX_BOOST_PROGRAM_OPTIONS
dnl AX_BOOST_REGEX
dnl AX_BOOST_SERIALIZATION
dnl AX_BOOST_SIGNALS
dnl AX_BOOST_SYSTEM
dnl AX_BOOST_TEST_EXEC_MONITOR
dnl AX_BOOST_UNIT_TEST_FRAMEWORK
dnl AX_BOOST_WSERIALIZATION
GR_GCELL
LIBS="$LIBS $GNURADIO_CORE_LIBS"
AC_CONFIG_FILES([\
Makefile \
apps/Makefile \
config/Makefile \
data/Makefile \
doc/Makefile \
include/Makefile \
include/mymodule/Makefile \
include/mymodule/spu/Makefile \
lib/Makefile \
lib/gcell/Makefile \
lib/gcell/spu/Makefile \
python/Makefile \
python/run_tests \
])
dnl run_tests is created from run_tests.in. Make it executable.
AC_CONFIG_COMMANDS([run_tests], [chmod +x python/run_tests])
AC_OUTPUT
#
# Copyright 2004,2008 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.
#
ACLOCAL_AMFLAGS = -I config
include $(top_srcdir)/Makefile.common
EXTRA_DIST = bootstrap configure config.h.in
SUBDIRS = config include lib apps doc
if USE_PYTHON
SUBDIRS += python
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
# -*- Makefile -*-
#
# Copyright 2004,2006,2008 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.
#
ourincludedir = $(includedir)/mymodule
# swig includes
ourswigincludedir = $(ourincludedir)/swig
# Install this stuff in the appropriate subdirectory
# This usually ends up at:
# ${prefix}/lib/python${python_version}/site-packages/mymodule
ourpythondir = $(pythondir)/mymodule
ourpyexecdir = $(pyexecdir)/mymodule
# spu stuff
ourspuincludedir = $(ourincludedir)/spu
libspudir = $(libdir)spu
gcell_embedspu_libto...@gcell_embedspu_libtool@
# swig flags
SWIGPYTHONFLAGS = -fvirtual -python -modern
SWIGGRFLAGS = -I$(GNURADIO_CORE_INCLUDEDIR)/swig -I$(GNURADIO_CORE_INCLUDEDIR)
$(GNURADIO_CORE_CPPFLAGS)
# standard defins and includes
STD_DEFINES_AND_INCLUDES=$(GNURADIO_CORE_CPPFLAGS) -I$(top_srcdir)/include
-I$(top_srcdir)/lib
# Don't assume that make predefines $(RM), because BSD make does
# not. We define it now in configure.ac using AM_PATH_PROG, but now
# here have to add a -f to be like GNU make.
RM=$(RM_PROG) -f
# -*- Makefile -*-
#
# Copyright 2007,2008 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
include $(top_srcdir)/Makefile.common
# We're abusing automake, getting it to generate code for two
# architectures under the same tree. If you've got a better way to do
# this, please let us know
AR=spu-ar
RANLIB=spu-ranlib
CC=spu-gcc
CCAS = spu-gcc
LD=spu-ld
C_WARNINGS = \
-Wall -Wextra -Wstrict-prototypes -Werror-implicit-function-declaration
# Need to override user stuff even though it gives a warning.
# (Otherwise these contain PPE related info.)
CPPFLAGS=
LDFLAGS=
CFLAGS=
LIBS=
AM_CFLAGS = -O3 -g --std=gnu99 -fstrict-aliasing $(C_WARNINGS)
#!/bin/bash
#
# Before trying to use this script, please follow the instructions at
# http://gnuradio.org/trac/wiki/CrossCompilingForCell
#
scriptdir=`dirname $0`
prefix=
for arg in "$@"
do
case $arg in
--prefix=*)
prefix=${arg#--prefix=}
;;
--help)
$scriptdir/configure --help
exit
;;
esac
done
if test x$prefix = x
then
echo "usage: $0 --prefix=PREFIX [configure options...]" 1>&2
exit 1
fi
arch=ppu
cell_root=/mnt/cell-root
python_version=2.5
compiler_includes="-isystem ${cell_root}/usr/include"
$scriptdir/configure \
CC=${arch}32-gcc \
CXX=${arch}32-g++ \
AR=${arch}-ar \
NM=${arch}-nm \
RANLIB=${arch}-ranlib \
STRIP=${arch}-strip \
F77=false \
CPPFLAGS="$compiler_includes"
\
LDFLAGS="-L${cell_root}/lib -L${cell_root}/usr/lib -L${prefix}/lib"
\
PYTHON_CPPFLAGS=-I${cell_root}/usr/include/python${python_version}
\
PKG_CONFIG_PATH=${cell_root}/usr/lib/pkgconfig:${cell_root}/usr/local/lib/pkgconfig
\
--host=powerpc64-unknown-linux-gnu
\
--with-pythondir=$prefix/lib/python${python_version}/site-packages
\
--disable-gr-video-sdl \
--disable-gr-audio-portaudio \
--disable-usrp2-firmware \
"$@"
# Hack the libtool script so that it doesn't code an --rpath flag into anything
#sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
#sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio