diff options
| -rw-r--r-- | host/docs/build.rst | 31 | ||||
| -rw-r--r-- | host/docs/usrp2.rst | 2 | ||||
| -rwxr-xr-x | host/lib/transport/gen_vrt.py | 2 | ||||
| -rwxr-xr-x | host/utils/usrp2_card_burner.py | 21 | 
4 files changed, 49 insertions, 7 deletions
| diff --git a/host/docs/build.rst b/host/docs/build.rst index d28682764..f5a8dac8d 100644 --- a/host/docs/build.rst +++ b/host/docs/build.rst @@ -8,9 +8,14 @@ UHD - Build Guide  Build Dependencies  ------------------------------------------------------------------------ -**Unix Notes:** +**Linux Notes:**  The dependencies can be acquired through the package manager. +**Mac OS X Notes:** +Install the "Xcode Developer Tools" to get the build tools (gcc and make). +Use MacPorts to get the Boost and Cheetah dependencies. +Other dependencies can be downloaded as dmg installers from the web. +  **Windows Notes:**  The dependencies can be acquired through installable exe files.  Usually, the windows installer can be found on the project's website. @@ -27,12 +32,13 @@ or install msysgit from http://code.google.com/p/msysgit/downloads/list  ^^^^^^^^^^^^^^^^  C++  ^^^^^^^^^^^^^^^^ -On unix, this is GCC 4.0 and above. On windows, this is MSVC 2008. +On Unix, this is GCC 4.0 and above. On Windows, this is MSVC 2008.  Other compilers have not been tested yet or confirmed working.  ^^^^^^^^^^^^^^^^  CMake  ^^^^^^^^^^^^^^^^ +* **Purpose:** generates project build files  * **Version:** at least 2.8  * **Required for:** build time  * **Download URL:** http://www.cmake.org/cmake/resources/software.html @@ -40,6 +46,7 @@ CMake  ^^^^^^^^^^^^^^^^  Boost  ^^^^^^^^^^^^^^^^ +* **Purpose:** C++ library  * **Version:** at least 3.6 unix, at least 4.0 windows  * **Required for:** build time + run time  * **Download URL:** http://www.boost.org/users/download/ @@ -48,13 +55,15 @@ Boost  ^^^^^^^^^^^^^^^^  Python  ^^^^^^^^^^^^^^^^ +* **Purpose:** used by Cheetah and utility scripts  * **Version:** at least 2.6 -* **Required for:** build time +* **Required for:** build time + run time utility scripts  * **Download URL:** http://www.python.org/download/  ^^^^^^^^^^^^^^^^  Cheetah  ^^^^^^^^^^^^^^^^ +* **Purpose:** source code generation  * **Version:** at least 2.0  * **Required for:** build time  * **Download URL:** http://www.cheetahtemplate.org/download.html @@ -63,9 +72,17 @@ Cheetah  ^^^^^^^^^^^^^^^^  Doxygen  ^^^^^^^^^^^^^^^^ +* **Purpose:** generates html api documentation  * **Required for:** build time (optional)  * **Download URL:** http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc +^^^^^^^^^^^^^^^^ +Docutils +^^^^^^^^^^^^^^^^ +* **Purpose:** generates html user manual +* **Required for:** build time (optional) +* **Download URL:** http://docutils.sourceforge.net/ +  ------------------------------------------------------------------------  Build Instructions (Unix)  ------------------------------------------------------------------------ @@ -80,7 +97,7 @@ Generate Makefiles with cmake      cd build      cmake ../ -For a custom prefix, use: cmake -DCMAKE_INSTALL_PREFIX=<myprefix> ../ +For a custom prefix, use: cmake -DCMAKE_INSTALL_PREFIX=<prefix> ../  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Build and install @@ -92,11 +109,15 @@ Build and install      sudo make install  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Setup the library path +Setup the library path (Linux)  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Make sure that libuhd.so is in your LD_LIBRARY_PATH  or add it to /etc/ld.so.conf and make sure to run sudo ldconfig +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Setup the library path (Mac OS X) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Make sure that libuhd.dylib is in your DYLD_LIBRARY_PATH  ------------------------------------------------------------------------  Build Instructions (Windows) diff --git a/host/docs/usrp2.rst b/host/docs/usrp2.rst index c4a7aa64f..1bd95cefa 100644 --- a/host/docs/usrp2.rst +++ b/host/docs/usrp2.rst @@ -50,7 +50,7 @@ you could overwrite your hard drive. Make sure that --dev= specifies the SD card  Use the *--list* option to get a list of possible raw devices.  The list result will filter out disk partitions and devices too large to be the sd card. -The list option has not yet been implemented on macosx. +The list option has been implemented on Linux, Mac OS X, and Windows.  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Use the card burner tool (unix) diff --git a/host/lib/transport/gen_vrt.py b/host/lib/transport/gen_vrt.py index 9a57c83c3..c34ffb198 100755 --- a/host/lib/transport/gen_vrt.py +++ b/host/lib/transport/gen_vrt.py @@ -57,7 +57,7 @@ void vrt::pack(      size_t packet_count,           //input      double tick_rate               //input  ){ -    boost::uint32_t vrt_hdr_flags; +    boost::uint32_t vrt_hdr_flags = 0;      boost::uint8_t pred = 0;      if (metadata.has_stream_id) pred |= $hex($sid_p); diff --git a/host/utils/usrp2_card_burner.py b/host/utils/usrp2_card_burner.py index 60aca9133..d47a4f5f4 100755 --- a/host/utils/usrp2_card_burner.py +++ b/host/utils/usrp2_card_burner.py @@ -22,6 +22,7 @@ import subprocess  import urllib  import optparse  import os +import re  ########################################################################  # constants @@ -107,6 +108,26 @@ def get_raw_device_hints():          return sorted(set(devs))      #################################################################### +    # Platform Mac OS X: parse diskutil list and info commands +    #################################################################### +    if platform.system() == 'Darwin': +        devs = map(lambda d: d.split()[0], filter(lambda l: l.startswith('/dev'), command('diskutil', 'list').splitlines())) +        def output_to_info(output): +            return dict([map(str.strip, pair.lower().split(':')) for pair in filter(lambda l: ':' in l, output.splitlines())]) +        def is_dev_valid(dev): +            info = output_to_info(command('diskutil', 'info', dev)) +            try: +                if info.has_key('internal'): assert info['internal'] == 'no' +                if info.has_key('ejectable'): assert info['ejectable'] == 'yes' +                if info.has_key('total size'): +                    size_match = re.match('^.*\((\d+)\s*bytes\).*$', info['total size']) +                    if size_match: assert int(size_match.groups()[0]) <= MAX_SD_CARD_SIZE +                return True +            except: return False + +        return sorted(set(filter(is_dev_valid, devs))) + +    ####################################################################      # Platform Others:      ####################################################################      return () | 
