Statistics
| Branch: | Tag: | Revision:

root / host / docs / build.rst @ af0543a8

History | View | Annotate | Download (5.5 kB)

1
========================================================================
2
UHD - Build Guide
3
========================================================================
4

    
5
.. contents:: Table of Contents
6

    
7
------------------------------------------------------------------------
8
Build Dependencies
9
------------------------------------------------------------------------
10

    
11
**Linux Notes:**
12
The dependencies can be acquired through the package manager.
13

    
14
**Mac OS X Notes:**
15
Install the "Xcode Developer Tools" to get the build tools (gcc and make).
16
Use MacPorts to get the Boost and Cheetah dependencies.
17
Other dependencies can be downloaded as dmg installers from the web.
18

    
19
**Windows Notes:**
20
The dependencies can be acquired through installable exe files.
21
Usually, the windows installer can be found on the project's website.
22
Some projects do not host windows installers, and if this is the case,
23
follow the auxiliary download url for the windows installer (below).
24

    
25
^^^^^^^^^^^^^^^^
26
Git
27
^^^^^^^^^^^^^^^^
28
Required to check out the repository.
29
On windows, install cygwin with git support to checkout the repository,
30
or install msysgit from http://code.google.com/p/msysgit/downloads/list
31

    
32
^^^^^^^^^^^^^^^^
33
C++
34
^^^^^^^^^^^^^^^^
35
On Unix, this is GCC 4.0 and above. On Windows, this is MSVC 2008.
36
Other compilers have not been tested yet or confirmed working.
37

    
38
^^^^^^^^^^^^^^^^
39
CMake
40
^^^^^^^^^^^^^^^^
41
* **Purpose:** generates project build files
42
* **Version:** at least 2.8
43
* **Required for:** build time
44
* **Download URL:** http://www.cmake.org/cmake/resources/software.html
45

    
46
^^^^^^^^^^^^^^^^
47
Boost
48
^^^^^^^^^^^^^^^^
49
* **Purpose:** C++ library
50
* **Version:** at least 3.6 unix, at least 4.0 windows
51
* **Required for:** build time + run time
52
* **Download URL:** http://www.boost.org/users/download/
53
* **Download URL (windows installer):** http://www.boostpro.com/download
54

    
55
^^^^^^^^^^^^^^^^
56
LibUSB
57
^^^^^^^^^^^^^^^^
58
* **Purpose:** USB userspace library
59
* **Version:** at least 1.0
60
* **Required for:** build time + run time (optional)
61
* **Download URL:** http://www.libusb.org/
62

    
63
^^^^^^^^^^^^^^^^
64
Python
65
^^^^^^^^^^^^^^^^
66
* **Purpose:** used by Cheetah and utility scripts
67
* **Version:** at least 2.6
68
* **Required for:** build time + run time utility scripts
69
* **Download URL:** http://www.python.org/download/
70

    
71
^^^^^^^^^^^^^^^^
72
Cheetah
73
^^^^^^^^^^^^^^^^
74
* **Purpose:** source code generation
75
* **Version:** at least 2.0
76
* **Required for:** build time
77
* **Download URL:** http://www.cheetahtemplate.org/download.html
78
* **Download URL (windows installer):** http://feisley.com/python/cheetah/
79

    
80
^^^^^^^^^^^^^^^^
81
Doxygen
82
^^^^^^^^^^^^^^^^
83
* **Purpose:** generates html api documentation
84
* **Required for:** build time (optional)
85
* **Download URL:** http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc
86

    
87
^^^^^^^^^^^^^^^^
88
Docutils
89
^^^^^^^^^^^^^^^^
90
* **Purpose:** generates html user manual
91
* **Required for:** build time (optional)
92
* **Download URL:** http://docutils.sourceforge.net/
93

    
94
------------------------------------------------------------------------
95
Build Instructions (Unix)
96
------------------------------------------------------------------------
97

    
98
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99
Generate Makefiles with cmake
100
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
101
::
102

    
103
    cd <uhd-repo-path>/host
104
    mkdir build
105
    cd build
106
    cmake ../
107

    
108
**Notes:**
109

    
110
* For a custom prefix, use: cmake -DCMAKE_INSTALL_PREFIX=<prefix> ../
111

    
112
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113
Build and install
114
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115
::
116

    
117
    make
118
    make test
119
    sudo make install
120

    
121
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122
Setup the library path (Linux)
123
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
124
Make sure that libuhd.so is in your LD_LIBRARY_PATH
125
or add it to /etc/ld.so.conf and make sure to run sudo ldconfig
126

    
127
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128
Setup the library path (Mac OS X)
129
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130
Make sure that libuhd.dylib is in your DYLD_LIBRARY_PATH
131

    
132
------------------------------------------------------------------------
133
Build Instructions (Windows)
134
------------------------------------------------------------------------
135

    
136
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
137
Generate the project with cmake
138
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139
* Open the cmake gui program.
140
* Set the path to the source code: <uhd-repo-path>/host
141
* Set the path to the build directory: <uhd-repo-path>/host/build
142
* Make sure that the paths do not contain spaces.
143
* Click configure and select the MSVC compiler.
144
* Set the build variables and click configure again.
145
* Click generate and a project file will be created in the build directory.
146

    
147
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148
Build the project in MSVC
149
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
150
* Open the generated project file in MSVC.
151
* Change the build type from "Debug" to "Release".
152
* Select the build all target, right click, and choose build.
153
* Select the install target, right click, and choose build.
154

    
155
**Note:** you may not have permission to build the install target.
156
You need to be an administrator or to run MSVC as administrator.
157

    
158
** alternative command line instructions **
159

    
160
* Open the Visual Studio Command Prompt Shorcut
161
* DevEnv <uhd-repo-path>\host\build\ALL_BUILD.vcproj /Build Release
162
* DevEnv <uhd-repo-path>\host\build\INSTALL.vcproj /Build Release
163

    
164
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
165
Setup the PATH environment variable
166
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
167
* Add the boost library path to %PATH% (usually c:\\program files\\boost\\<version>\\lib)
168
* Add the uhd library path to %PATH% (usually c:\\program files\\uhd\\lib)