-
Notifications
You must be signed in to change notification settings - Fork 459
Getting started: Mac OSX
This guide describes the process of building and installing the bladeRF host libraries and tool for a macOS system, and quickly getting a device up and running using pre-built firmware and FPGA images.
As of this writing, MacPorts contains quite up-to-date builds of the bladeRF libraries and utilities, and supports all bladeRF boards.
With MacPorts, the bladeRF utilities can be installed with:
$ sudo port install bladeRF +tecla
Ensure that your shell configuration (e.g., .bash_profile, .bashrc, .zshrc) contains the following items (adjusted accordingly):
export PATH=/opt/local/bin:/opt/local/sbin:$PATH export PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages:/opt/local/lib/python2.7/site-packages:${PYTHONPATH}
You may need to log out and log back in to ensure this change is applied to all of your terminal sessions.
Next, proceed to the "Checking basic device operation" section (below), and then "GNU Radio and gr-osmosdr" if you wish to use the bladeRF with GNU Radio.
Install XCode from Apple, as you will need a compiler. This is available in the App Store.
If you plan to use graphical tools (i.e., GNU Radio Companion), ensure you have X11 installed. See the XQuartz project for additional information and instructions.
Next, install a package management system, such as MacPorts or Homebrew.
If you're using Homebrew, install the dependencies via the following command. Older homebrew versions required using libusbx which has now been merged into libusb. Homebrew no longer has a libusbx formula.
$ brew install libusb pkgconfig cmake libtecla
If you've installed bladeRF items via a package manager, you can skip this section. However, if you're interested in diving into the host-side code, continue on!
Required dependencies include: libusb(x), CMake. libtecla is optional, but highly recommended for bladeRF-cli. MacPorts and Homebrew provide packages for all of these.
To obtain the latest source code for the first time, clone the Nuand git repository via:
$ git clone https://github.com/Nuand/bladeRF.git $ cd ./bladeRF
In the future, you can update the repository via:
$ git pull
First enter the directory containing the host source. Then create and enter a directory to perform the build in. By working out of the a 'build' directory, it's easy to later clean up, by simply removing 'build/'.
$ cd host/ $ mkdir build; cd build
Next, configure the build. In the below example, we:
- Set up a Release build
- Change to
Debug
for a debug build, orRelWithDebInfo
for a release build with debug symbols
- Change to
- Specify that files should be installed into /opt/local
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/local ..
Kick off the build and install to the location specified by CMAKE_INSTALL_PREFIX.
$ make $ sudo make install
Note that from this same directory, you can run the following to uninstall the files place on your system in the previous step.
sudo make uninstall
The install_manifest.txt file, created after running the install step successfully, lists all the files installed. It is a good idea to back up this file if you plan on removing this build directory later.
Before continuing on with the rest of this article, head over to the Getting Started: Verifying Basic Device Operation page. If you have any issues:
- Try both USB 2.0 and 3.0 ports
- Check if the bladeRF appears without problems in Command-Space 'System Information' to see your USB devices.
- Head over to the Troubleshooting page.
The following command may be used to install GNU Radio via MacPorts, and any necessary dependencies.
$ sudo port install gnuradio +grc +swig +wxgui +qtgui +python27
After the installation completes (it may take quite some time), you can verify the installation by running gnuradio-companion. Note: XQuartz will automatically start if it is not already started.
To get support for the bladeRF source and sink in GnuRadio, you will need to install gr-osmosdr.
$ sudo port install gr-osmosdr
If you are having difficulty selecting a bladeRF source/sink, you can check a list of supported device types in osmosdr with the following command.
$ osmocom_fft 2>&1 | grep "source types" built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf netsdr
If you have a good graphics card in your mac that supports opencl + opengl concurrently (currently it seems Intel's Iris Pro doesn't?), you can also install the fosphor sinks for gnuradio with.
$ sudo port install gr-fosphor
The following is a bit vague, but it is assured to be workable. As of Jan 2014 it seems that that gnuradio is still not yet part of the supported tree for Homebrew. There are, however, several 3rd-party scripts. One of them by user "titanous." To use this, you need to run:
$ brew tap titanous/homebrew-gnuradio $ brew install --with-qt gnuradiobut it is advisable to see the README at https://github.com/titanous/homebrew-gnuradio since there are several prerequisites and some options to consider. Subsequent steps are akin to those under "Building gr-osmosdr from source" (above).
Note that `gfortran` and `umfpack` have been removed from brew as of February 2015. Do not `brew install gcc`. brew will install the right dependency (i.e. apple-gcc42).