Notes on gnuradio installation on Mac OS X, January 3 -- 7, 2005, J. Jacky Mac OS 10.3.6 "Panther", Darwin 7.6.0 Followed instructions in gnuradio/gr-build/gnuradio-core/README ----------------------------------------- Prerequisites gnuradio/gr-build/gnuradio-core/README says you need: pkgconfig 0.15.0 or later http://www.freedesktop.ord/Software/pkgconfig FFTW 3.0 or later http://www.fftw.org Python 2.3 or later http://www.python.ord Boost C++ Libraries http://www.boost.org cppunit 1.9.14 or later http://cppunit.sourceforge.net autoconf 2.57 or later automake 1.7.4 or later libtool 1.5 or later swig 1.3.22 or later says "DO NOT USE GCC 3.3, gnuradio triggers bugs in g++ 3.3 for X86. gcc 3.2 and 3.4 are known to work well." Mac OS X 10.3.6 with developer tools (XCode etc.) has pkg-config 0.15.0 FFTW not installed Python 2.3 boost not installed cppunit not installed autoconf 2.57 automake 1.6.3 libtool ??? --version etc. don't report version number swig not installed gcc 3.3 -- uh-oh!!?? But for PPC, not X86 Mac OS X shell is tcsh not bash -- no apparent problems due to that ------------------------------------------ Install prerequisites Install in this order: darwinports from http://darwinports.com autoconf 2.59_0 and automake 1.9.4_0 from darwinports swig 1.3.25 from http://www.swig.org/ libtool 1.5.2 and libtoolize 1.5.2 from darwinports pkgconfig 0.15.0 from darwinports fftw-3 3.0.1-fma, Revision 2 from darwinports boost 1.31.0 from darwinports cppunit 1.10.2 from http://cppunit.sourceforge.net Installation order shown is the one that worked. Several attempts to install things in the wrong order failed. Install prerequisites in /opt/local, the darwinports default This preserves original Mac OS X versions in /usr/... For packages not installed from darwinports, use ./configure --prefix=/opt/local Added /opt/local/bin to PATH right after /bin:/sbin, before /usr/bin, /usr/local/bin etc. to be sure to run newer versions of prerequisites, not the Mac OS X versions. Edit set path= ... in .tcshrc "from darwinports" means install by "sudo port install " "port install automake" installs both autoconf and automake darwinports provides swig 1.3.21 and swig-1.3.19 I got swig 1.3.25 from swig.org and built it. To test swig, do "make check-python-examples" and "make check-python-test-suite". All tests pass except testcase enum_thorough, in one file enum_thorough_wrap.cxx there are 38 error messages in from lines 1498 -- 1518. Decided to press on anyway. "port install libtoolize" installs /opt/local/bin/glibtool and .../glibtoolize. But other scripts call for libtool, libtoolize. So make symbolic links in /opt/local/bin: ln -s glibtool ./libtool, ditto for libtoolize. pkgconfig installs in /opt/local/bin/pkg-config Install fftw-3, not fftw To build fftw-3, gnuradio-core/README says you must use --enable-single and --enable-shared configure options. A note on discuss-gnuradio (Ian Wraith, 01 Jan 2004) says configure --enable-float works. I added --enable-float to configure.args in ~/darwinports/dports/math/fftw-3/Portfile (renamed original version to Portfile.orig). Then the build generates /opt/local/lib/pkgconfig/fftw3f.pc Before I configured with --enable-float, I got fftw3.pc not fftw3f.pc. gnuradio-core .configure requires fftw3f.pc, not fftw3.pc ---------------------------------------------------------------- Check out gnuradio Follow directions at http://comsec.com/wiki?CvsAccess % cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/gnuradio co -P gr-build then following instructions in gr-build/README % ./checkout --exclude=mc4020 That gets everything except the mc4020 support. It does get the usrp stuff from sourceforge. Got it on 3 Jan 2005 at 16:56 ---------------------------------------------------------------- Install gnuradio: bootstrap, configure, make Attempt procedure recommended in gnuradio/gr-build/gnuradio-core/README: % ./bootstrap % ./configure --enable-maintainer-mode % make % make check % make install After install all prerequisites, bootstrap completes with one warning: /opt/local/share/aclocal/pkg.m4:5: warning: underquoted definition of PKG_CHECK_MODULES run info '(automake) Extending aclocal' or see http://sources.redhat.com/automake/automake.html#Extending_aclocal But I just pressed on configure step requires some tweaking in configure file, as follows: autoconf in distribution can't find some items in Mac OS X, had to hard-code some paths in gnuradio-core/configure. Call the edited version configure.osx. Perhaps this was not necessary -- maybe this would work: ./configure --with-foo==/some/path autoconf in distribution can't find boost in Mac OS X In configure.osx hard-code gr_boost_include_dir="/opt/local/include/boost-1_31" autoconf in distribution can't find python in Mac OS X In configure.osx hard-code python_path="/System/Library/Frameworks/Python.Framework/Versions/2.3" pythondir="/Library/Python/2.3" Tried to put gnuradio under /opt/local also by ./configure.osx --prefix=/opt/local but then after make, make check fails with python can't open library /usr/local/lib/libgnuradio-core so apparently make check looks under /usr/local despite prefix so configure, make again without --prefix to put gnuradio under /usr/local Finally, after install all prerequisites and edit configure.osx, ./configure.osx --enable-maintainter-mode completes without errors make step requires one tweak. Initially make fails with cp -r html /usr/local/share/doc/gnuradio html: no such file or directory I created an empty directory gnuradio/gr-build/gnuradio-core/doc/html (Perhaps this problem arose because I don't have the doxygen doc. package) Finally, after creating empty html directory, make completes without errors ------------------- Check installation with make check Indicates there are still problems % make check ... (many tests pass) All codec tests passed! ... Making check in tests make check-TESTS .Testing gr_vmcircbuf_sysv_shm_factory... gr_vmcircbuf_sysv_shm: shmat (1): Too many open files gr_vmcircbuf_sysv_shm: shmget (1): Invalid argument gr_vmcircbuf_sysv_shm: shmat (1): Too many open files ....... gr_vmcircbuf_sysv_shm_factory: Failed Testing gr_vmcircbuf_mmap_shm_open_factory... ....... gr_vmcircbuf_mmap_shm_open_factory: OK Testing gr_vmcircbuf_mmap_tmpfile_factory... ....... gr_vmcircbuf_mmap_tmpfile_factory: OK ............................. [generic] . [generic] ... (etc.) OK (35 tests) PASS: test_all ... Making check in python Making check in gnuradio Making check in gr make check-TESTS Traceback (most recent call last): File "./qa_add_and_friends.py", line 23, in ? from gnuradio import gr, gr_unittest File "/Users/jon/gnuradio/gr-build/gnuradio-core/src/python/gnuradio/gr/__init__.py", line 29, in ? from flow_graph import * File "/Users/jon/gnuradio/gr-build/gnuradio-core/src/python/gnuradio/gr/flow_graph.py", line 26, in ? from gnuradio_swig_python import buffer, buffer_add_reader, block_detail, \ ImportError: cannot import name buffer ... ... and so on, same error message from all the qa_*.py files ... FAIL: run_tests =================== 1 of 1 tests failed =================== make[5]: *** [check-TESTS] Error 1 make[4]: *** [check-am] Error 2 make[3]: *** [check-recursive] Error 1 make[2]: *** [check-recursive] Error 1 make[1]: *** [check-recursive] Error 1 make: *** [check-recursive] Error 1 I confirmed there is a file /Users/jon/gnuradio/gr-build/gnuradio-core/src/lib/swig/gnuradio_swig_python.py (there is also a .pyc, .lo, .d, and .cc) This is on the PYTHON_PATH defined in run_tests sh script called from Makefile in gnuradio/gr-build/gnuradio-core/src/python/gnuradio/gr This file does not define any buffer. It does define a gr_buffer_sptr class and several other gr_buffer_sptr* classes.