root/documentation/ossie/user-guide-0.8.0/Installation.tex @ 9624

Revision 9624, 22.4 KB (checked in by shereef, 4 years ago)

Updates for proper installation; please review

Line 
1% ------------------------------------------------------------------
2%
3%   TITLE: OSSIE 0.8.0 Installation Guide
4% AUTHORS: Matt Carrick, Drew Cormier, Christopher Covington,
5%          Carl B. Dietrich, Joseph Gaeddert, Benjamin Hilburn,
6%          C. Ian Phelps, Shereef Sayed, Jason Snyder, Haris Volos
7% CREATED:
8% REVISED:
9%     URL: http://ossie.wireless.vt.edu/
10%
11% ------------------------------------------------------------------
12
13\newpage
14\section{Installation}
15\label{section:installation}
16For users that do not have access to a Linux system, or are unfamiliar with Linux, we recommend
17that you use our pre-built VMWare images.  These images have OSSIE pre-installed on them, and are
18ready to use out-of-the-box. Using an OSSIE VMware image is described in
19Section~\ref{section:installation:vmware}.
20
21For most users on Fedora systems, installing OSSIE and its dependencies via yum is the best
22route.  The only reason not to install via yum is if you plan on doing active
23development \emph{on} OSSIE, and need access to the source code.  Note that this
24does not include application/waveform developers who are developing \emph{with}
25OSSIE, as they do not need access to the OSSIE source code.
26
27Although we do not yet provide and support binary installation packages for more Linux
28distributions, compiling OSSIE from source on them should be possible.
29
30To install OSSIE from source, follow the below instructions to install the OSSIE dependencies,
31and then compile and install the source code.  The latter process is simplified with a provided convenience
32script, build.py, which compiles and installs OSSIE from source for you.
33
34% \subsection{Installing OSSIE via Yum}
35% \label{section:installation:yum}
36
37% Note:  At the time this guide was compiled, the latest version of OSSIE available by Yum was 0.7.0.  Version 0.7.1 is expected to be available by Yum in late 2008 or early 2009.
38
39% \subsubsection{Add OSSIE Repository to Yum}
40% \label{section:installation:yum:ossierepo}
41% In order to install OSSIE via the YUM repository, you must first edit your `/etc/yum.conf' to
42% add the OSSIE repository to the YUM search list. In this example, we use {\tt nano}, but you may use
43% whatever editor you wish ({\tt vim}, {\tt emacs}, etc). Unless your nanorc has already been configured to not
44% wrap lines, the `-w' flag is necessary to prevent {\tt nano} from adding line breaks to the file.
45% \begin{lstlisting}[]
46% $ su -
47% # nano -w /etc/yum.conf
48% \end{lstlisting}
49% Add the following lines at the bottom of the file:
50% \begin{lstlisting}[]
51% [ossie-vt]
52% name = OSSIE-VT
53% baseurl=http://ossie.wireless.vt.edu/yum/ossie-vt/
54% gpgcheck=0
55% \end{lstlisting}
56% Now update your system. This will refresh your yum package cache.  It is also always smart to have
57% a fully updated system before installing new software anyways.
58% \begin{lstlisting}[]
59% # yum update
60% \end{lstlisting}
61%
62% \subsubsection{Install OSSIE}
63% \label{section:installation:yum:installviayum}
64% Now install OSSIE and its dependencies via yum by typing:
65% \begin{lstlisting}[]
66% # yum install ossie
67% # exit
68% \end{lstlisting}
69
70% Congratulations!  You should now have a fully-operable OSSIE installation.
71
72\subsection{Installing OSSIE from Source}
73\label{section:installation:source}
74
75\subsubsection{Notes on OSSIE Installation from Source}
76\label{section:installation:source:notesonsource}
77This section assumes that the user is familiar with basic
78Linux commands such as {\tt cd} and {\tt ls}.
79Commands run with root permissions are prefixed with {\tt \#}, while others
80are prefixed with {\tt \$}.
81
82OSSIE depends on the following software packages:
83\begin{itemize}
84\item omniORB - a CORBA implementation
85\item omniORBpy - a Python interface for omniORB, necessary for the OSSIE tools and components
86\item wxPython - a Python interface for the wxWidgets graphical library, used by the OSSIE tools
87\item numpy - a Python numerical library used by the OSSIE tools
88\end{itemize}
89
90OSSIE \ossieversion\  is packaged with a convenient Python script called {\tt build.py} to automatically
91configure and build the packages necessary for the framework, tools, and other
92libraries. Use of this script is not mandatory, and you can manually compile and install all/part of
93OSSIE as you wish.
94
95\subsubsection{Installing Dependencies on Fedora}
96\label{section:installation:source:dependencies:fedora}
97 On Fedora systems, the dependencies can be installed via {\tt yum}.
98%
99% First, add the OSSIE yum repository to your yum.conf.  This is described in
100% Section~\ref{section:installation:yum:ossierepo}
101%
102This is the entire dependency list, so some of these packages may already be installed.
103\begin{lstlisting}[]
104# yum -y install omniORB omniORBpy wxPython \
105wxPython-devel numpy rpm-build cabextract glibc-devel \
106python-devel openssl-devel gcc gcc-c++ libtool \
107boost-1.34 boost-devel-1.34
108\end{lstlisting}
109
110If you are using Fedora Core 10, you will need to download the RPM for the SDL library in order to user the JPEGVideoViewer component.
111\begin{lstlisting}[]
112$ wget http://www.libsdl.org/release/SDL-devel-1.2.13-1.i386.rpm
113$ rpm -Ui SDL-devel-1.2.13-1.i386.rpm
114\end{lstlisting}
115%
116% Now move onto Section~\ref{section:installation:source:dependencies:gnuradio}
117%
118\subsubsection{Installing Dependencies on Ubuntu}
119\label{section:installation:dependencies:ubuntu}
120
121This is the entire dependency list, so some of these packages may already be installed.
122Install all of the following packages:
123\begin{lstlisting}[]
124$ sudo aptitude install gcc build-essential
125$ sudo aptitude -y install omniorb4 libomniorb4-dev omniidl4-python \
126omniorb4-nameserver python-omniorb2 libgtk2.0-dev freeglut3-dev \
127python-wxgtk2.8 python-wxversion python-wxtools python-numpy \
128python-numpy-ext python-numpy-dev g++ automake libtool subversion python-dev \
129fftw3-dev libcppunit-dev libboost-dev sdcc libusb-dev libasound2-dev \
130libsdl1.2-dev guile-1.8 libqt3-mt-dev swig libboost-filesystem-dev \
131python-profiler automake1.9 python2.5-dev libboost1.35-dev sdcc-nf \
132guile-1.8-dev libqt4-dev ccache python-opengl libgsl0-dev python-lxml \
133doxygen qt4-dev-tools libqwt5-qt4-dev libqwtplot3d-qt4-dev
134\end{lstlisting}
135
136\subsubsection{Configure omniORB}
137\label{section:installation:source:dependencies:configomni}
138omniORB must be configured through the modification of a file. This file may be either \\
139{\tt /etc/omniORB.cfg} or {\tt /etc/omniORB4.cfg}, depending on the
140version of the omniORB dependency. Open the file as root, and search for the
141following line:
142\begin{lstlisting}[]
143 InitRef = NameService=corbaname::my.host.name
144\end{lstlisting}
145Uncomment the line by deleting the pound or hash character `\#' and change
146it to:
147\begin{lstlisting}[]
148 InitRef = NameService=corbaname::127.0.0.1
149\end{lstlisting}
150Before running the framework you will need to start the naming service.
151{\tt omniNames} will automatically start when you restart your machine. Refer
152to Appendix~\ref{appendix:services} for instructions on how to start the
153omniNames service without restarting your machine or set whether the service
154starts automatically at boot.
155\footnote{You may also manually start a source-compiled tarball package of
156omniNames {\tt omniNames} with the script described in
157Appendix~\ref{appendix:omninamessh}}
158
159At this time it is a good idea to restart your machine.
160
161\subsubsection{Installing Portions of GNU Radio}
162\label{section:installation:source:dependencies:gnuradio}
163OSSIE uses a small subset of GNU Radio to communicate with and configure the USRP. The
164following steps will walk through installing portions of GNU Radio.
165
166First, GNU Radio's dependencies must be installed. If you are using Ubuntu and followed
167the instructions for installing the dependencies, skip down to checking out the source
168code from the GNU Radio Subversion repository. If you are installing on Fedora 9,
169proceed with the following directions.
170
171Install the Engineering and Scientific packages as well as the Software Development
172packages as root entering the command:
173
174\begin{lstlisting}[]
175 # yum groupinstall "Engineering and Scientific" "Development Tools"
176\end{lstlisting}
177
178Additional utilities such as the FFT library and the CPP Test Framework must also be
179installed. As root, enter the following command
180
181\begin{lstlisting}[]
182 # yum install fftw-devel cppunit-devel wxPython-devel libusb-devel  \
183   guile boost-devel alsa-lib-devel numpy
184\end{lstlisting}
185
186The Small Device C Compiler, SDCC, must be installed:
187
188\begin{lstlisting}[]
189 # yum install sdcc
190\end{lstlisting}
191
192The path for the SDCC must be set. Open the .bashrc file and add the path to the end
193of the file. To open the file, enter the command:
194
195\begin{lstlisting}[]
196 $ vim ~/.bashrc
197\end{lstlisting}
198
199Add the following path to the end of the file:
200\begin{lstlisting}[]
201 export PATH=/usr/libexec/sdcc:$PATH
202\end{lstlisting}
203
204At this point, all of the GNU Radio dependencies have been installed. Now, the GNU Radio
205software must be installed.
206
207Download the GNU Radio source code by entering the command:
208\begin{lstlisting}[]
209 $ svn co http://gnuradio.org/svn/gnuradio/branches/releases/3.1 gnuradio
210\end{lstlisting}
211
212Move into the {\tt gnuradio} directory and start building the source code by entering the
213following commands:
214
215\begin{lstlisting}[]
216 $ cd gnuradio/
217 $ ./bootstrap
218 $ ./configure --disable-all-components --enable-gnuradio-core \
219   --enable-usrp --enable-gr-usrp --enable-omnithread
220\end{lstlisting}
221
222This sets up the install to only build resources for the USRP which OSSIE requires.
223Compile the source code by entering the command:
224
225\begin{lstlisting}[]
226 $ make
227\end{lstlisting}
228
229Verify that the compile worked by running a check:
230
231\begin{lstlisting}[]
232 $ make check
233\end{lstlisting}
234
235Install the portions of GNU Radio by running the following command as root:
236
237\begin{lstlisting}[]
238 # make install
239\end{lstlisting} 
240
241The libraries installed by GNU Radio need to be linked:
242
243\begin{lstlisting}[]
244 # /sbin/ldconfig
245\end{lstlisting}
246
247At this point, GNU Radio and its dependencies have been installed. Now setup the
248proper permissions for the USRP. As root, create a group which will have access
249to the USRP:
250
251\begin{lstlisting}[]
252 # /usr/sbin/groupadd usrp
253\end{lstlisting}
254
255Add users to the group which need access to the USRP:
256
257\begin{lstlisting}[]
258 # /usr/sbin/usermod -G usrp -a USERNAME
259\end{lstlisting}
260
261Now that users will have access to the USRP, read and write access to the device
262must be created. As root, create the file {\tt /etc/udev/rules.d/10-usrp.rules} in
263a text editor:
264
265\begin{lstlisting}[]
266 # vim /etc/udev/rules.d/10-usrp.rules
267\end{lstlisting}
268
269Add the following text to the file:
270
271\begin{lstlisting}[]
272 ACTION=="add", BUS=="usb", SYSFS{idVendor}=="fffe", \
273 SYSFS{idProduct}=="0002", GROUP:="usrp", MODE:="0660"
274\end{lstlisting}
275
276The text above is displayed on two lines due to the contraints on page size, however
277the text must appear on a single line, without the backslash, in the file for the
278access to the USRP to work properly. You may also add the following comment lines to
279the file for future reference:
280
281\begin{lstlisting}[]
282 # rule to grant read/write access on USRP to group named usrp.
283 # to use, install this file in /etc/udev/rules.d/ as
284 # 10-usrp.rules
285\end{lstlisting}
286
287The USRP interface has now been created. As an optional test, connect the USRP
288to the computer and run the following command:
289
290\begin{lstlisting}[]
291 $ ls -lR /dev/bus/usb
292\end{lstlisting}
293
294The users root and usrp should now be listed under the user groups.
295
296\subsubsection{Install OSSIE}
297\label{section:installation:source:ossiecf}
298You are now ready to build and install OSSIE.  At this point, you can either compile and install
299everything by hand using the included Makefiles, or use the {\tt build.py} convenience script to
300do it for you.  Note that installing by hand requires some knowledge of OSSIE, Linux, and software development.
301
302Download the latest tarball from
303\href{http://ossie.wireless.vt.edu/download/tarballs/\ossieversion/}{http://ossie.wireless.vt.edu/download/tarballs/\ossieversion/}
304\\ and unpack {\tt ossie-\ossieversion.tar.bz2}.
305\begin{lstlisting}[]
306 $ wget http://ossie.wireless.vt.edu/download/tarballs/0.8.0/ \
307   ossie-0.8.0.tar.bz2
308 $ tar -xvjf ossie-0.8.0.tar.bz2
309\end{lstlisting}
310
311By default, the installation directory of the OSSIE platform is {\tt /sdr}. In order to install new
312source code and binaries into this directory without root permissions, you need to create and change
313the ownership of {\tt /sdr}.
314\begin{lstlisting}[]
315 # mkdir /sdr
316 # chown -R username.username /sdr
317\end{lstlisting}
318where {\tt username} is your user name.
319
320There are two methods of installation available for OSSIE 0.8.0. The easy method is to run the 'build.py' script, ~\ref{section:installation:source:ossiecf:buildpy}.
321The new method, which we recommend for users targeting embedded systems, is to build OSSIE from the root using the autotools 'configure' and 'make' system.
322If you plan to develop applications on your desktop or laptop, then move on to Section~\ref{section:installation:source:ossiecf:buildpy}. If you plan to target an
323embedded system, then follow the steps below.
324
325\subsubsection{Using Autoconf}
326\label{section:installation:source:ossiecf:autoconf}
327
328\begin{lstlisting}[]
329 $ cd ossie-0.8.0
330 $ ./bootstrap
331 $ ./configure --prefix=/sdr --libdir=/usr/local/lib/ --includedir=/usr/local/include/
332 $ make
333 $ sudo make install
334\end{lstlisting}
335
336If you prefer, or require, a different root directory, then change the '--prefix' flag to your appropriate absolute path.
337If you require the OSSIE libraries to be installed to a different locatio, then change the '--libdir' flag to your appropriate absolute path.
338For futher 'configure' options, use {\tt configure --help}.
339
340\subsubsection{Using Installation Scripts}
341\label{section:installation:source:ossiecf:buildpy}
342
343The included {\tt build.py} and {\tt setup.py} scripts automate the building and installation of
344the OSSIE packages. Because OSSIE is built as a set of dependent libraries it is
345necessary to build and install each one separately so that
346they can link properly. These scripts take care of that for you.
347
348In order for the script to run uninterrupted, the {\tt sudo} command must be
349able to execute {\tt make install}.
350As root, edit the {\tt sudoers} file\footnote{By default the sudoers file must
351be edited with the {\tt visudo} command}
352\begin{lstlisting}[]
353 # /usr/sbin/visudo
354\end{lstlisting}
355
356At the end of the file, add the following line:
357\begin{lstlisting}[]
358 ALL ALL = NOPASSWD: /usr/bin/make install
359\end{lstlisting}
360
361Save and quit ({\tt :wq}).  If you made an error, visudo will tell you. We
362recommend that you comment this line out by putting a pound character (`\#') in
363front of it once you have finished installing OSSIE.
364%TODO: Have a more secure (wheel group only?) method
365
366The {\tt setup.py} script installs the tools used for component and waveform development. To install the tools, move into the {\tt tools} directory and run the {\tt setup.py} script as follows \\(optionally, use {\tt su -c "<command>"} instead of {\tt sudo <command>}):
367
368\begin{lstlisting}[]
369 $ cd /home/username/path_to_ossie/tools
370 $ python setup.py build && sudo python setup.py install
371\end{lstlisting}
372
373The {\tt build.py} script installs the core framework, components, devices and a few demonstration waveforms. This script should not be run as root.
374To install, first exit out of root, then move into the directory where the OSSIE \ossieversion\ tarball has been unpacked and run the script:
375
376\begin{lstlisting}[]
377 # exit
378 $ cd /home/username/path_to_ossie/
379 $ python build.py
380\end{lstlisting}
381
382Depending on the speed of your system this might take several minutes. You may
383be asked for a password during the first {\tt make install} command. Because we
384are using {\tt sudo}, this prompt is asking for your user password, not the
385root password. If successful, the prompt should say:
386\begin{lstlisting}[]
387*********************************************************
388
389  Complete installation of OSSIE 0.8.0 finished!
390
391*********************************************************
392\end{lstlisting}
393
394\subsubsection{Updating System Libraries}
395\label{section:installation:source:ossiecf:ldconfig}
396Once the OSSIE libraries are installed, they need to be linked.
397As root edit the file {\tt /etc/ld.so.conf}, adding the line
398\begin{lstlisting}[]
399 /usr/local/lib
400\end{lstlisting}
401Now run:
402\begin{lstlisting}[]
403 # /sbin/ldconfig
404\end{lstlisting}
405
406OSSIE should now be successfully installed on your system. You can skip to
407Section~\ref{section:runningwaveforms} to learn how to run waveforms.
408
409\subsection{Installation of OSSIE Eclipse Feature}
410\label{section:installation:oefinstall}
411Installation of the OSSIE Eclipse Feature (OEF) requires the installation of OSSIE, Java, and Eclipse.
412
413\subsubsection{Installing Java}
414\label{section:installation:javainstall}
415Eclipse is written in Java, so you must have it installed to run Eclipse and OEF.
416We recommend using Sun's Java Development Kit. As of this writing, the GNU Compiler for Java (GCJ) will not work.
417
418Fedora Core 9 comes with the Sun JDK pre-installed but older versions require manual installation. On other distributions it is advisable to use the
419package manager to manage the installation, if possible.
420
421\subsubsection{Installing Java on Older Versions of Fedora}
422\label{section:installation:javafedora}
423Go to \href{http://java.sun.com/javase/downloads/index.jsp}{http://java.sun.com/javase/downloads/index.jsp}
424and click Download next to JDK 6 Update 6. Choose Linux in the platform drop down menu, click the check-box
425agreeing to the license agreement, and click continue. Download the Linux rpm in self extracting file,
426{\tt jdk-6u6-linux-i586-rpm.bin}.
427
428Open a terminal and navigate to the file. As root, execute the following command:
429\begin{lstlisting}[]
430 # sh jdk-u6-linux-i586-rpm.bin
431\end{lstlisting}
432
433Create {\tt java.sh} in {\tt /etc/profile.d/} with the following contents:
434\begin{lstlisting}[]
435 export JAVA_HOME="/usr/java/latest"
436 export JAVA_PATH="$JAVA_HOME"
437 export PATH="$PATH:$JAVA_HOME/bin"
438\end{lstlisting}
439
440Log out and back in to allow the changes to update.
441
442\subsubsection{Installing Java on Ubuntu}
443\label{section:installation:javaubuntu}
444In a terminal, enter the following lines:
445\begin{lstlisting}[]
446 $ sudo apt-get update
447 $ sudo apt-get install sun-java5-jdk
448\end{lstlisting}
449
450\subsubsection{Installing Eclipse}
451\label{section:installation:eclipseinstall}
452Install the Eclipse IDE for Java Developers. Go to the \href{http://www.eclipse.org/downloads/}{Eclipse Download Center} and download an Eclipse distribution for your platform.
453
454Eclipse is distributed as a tarball archive that you can unpack to location of your choice. Pick a location that is appropriate for your platform and
455simply unpack the contents. There is no self-installer, just unpack the distribution. Do not install Eclipse in a directory that has spaces anywhere
456in its full path name.
457
458\subsubsection{Installing OEF}
459\label{section:installation:oefinstall}
460Now that the dependencies have been installed, OEF can be installed.
461
462Move into the unpacked eclipse directory, and start eclipse:
463\begin{lstlisting}[]
464$ cd /path/to/eclipse
465$ ./eclipse
466\end{lstlisting}
467
468After Eclipse starts, on the toolbar select {\tt Help}, {\tt Software Updates}.
469In the new window, select the ``Available Software" tab and click the ``Add Site"
470button the right hand side. Enter the URL: {\tt http://ossie.wireless.vt.edu/eclipse/}
471and select OK. The window will then add the URL, OSSIE, OSSIE Waveform Developer
472Feature to the list of software to update. Place a check in the box next to OSSIE
473Waveform Developer Feature and click Install. Eclipse will bring up a window which will
474resolve any dependencies and then start the install guide.
475
476When the install window opens, make sure OSSIE Waveform Developer Feature is selected
477and click Next. Accept the GNU license agreement and select Next. Eclipse will then
478begin to download the necessary files, which may take a few minutes. Allow Eclipse to
479restart when it prompts to do so. After it restarts, the OSSIE Eclipse Feature will be
480installed.
481
482Select the OSSIE perspective within Eclipse. On the toolbar, select {\tt Window},
483{\tt Open Perspective}, {\tt Other}. In the new window, select OSSIE which will then
484open the OSSIE perspective. On the toolbar, select {\tt File}, {\tt New}, {\tt OSSIE Waveform},
485or {\tt OSSIE Component} to start developing.
486
487These same instructions used for installing OEF can be used later to update it to newer versions.
488
489\subsection{Using a VMware Image on Any Platform}
490\label{section:installation:vmware}
491A VMware image of a complete Fedora Core 9-based Linux system with all necessary
492dependencies and a complete install of OSSIE \ossieversion\ is available at \\
493\href{http://ossie.wireless.vt.edu/trac/wiki/Downloads}{http://ossie.wireless.vt.edu/trac/wiki/Downloads}.
494All that is needed to run the virtual image is the VM­Ware Player, available
495for no fee from \\
496\href{http://www.vmware.com/download/player/}{http://www.vmware.com/download/player/}.
497Versions of the player are available for both Windows and Linux.
498
499Install VMware Player on your system, unzip the virtual image and open it.
500For full instructions on installing and using VMware player, please
501consult the VMWare Player User Guide~\cite{vmware:web}.
502
503It is recommended that you keep a copy of the zipped virtual image so that you do
504not need to download the image a second time to start with a fresh copy. Changes
505that you make from within the image will alter it, and in the event of drastic
506unwanted changes, starting afresh is easy if you have an extra copy of the image
507on your hard drive.
508
509% \subsection{Via Ebuild on Gentoo Linux}
510% Support for installation via Gentoo's Portage package management system has not
511% yet been thoroughly tested but ebuilds do exist.
512%
513% To access the ebuilds, install and configure layman if you haven't already:
514% \begin{figure}
515% \begin{lstlisting}[]
516% # emerge layman
517% # echo "source /usr/portage/local/layman/make.conf" >> /etc/make.conf
518% \end{lstlisting}
519% \end{figure}
520%
521% Then, add ossie-overlay to your locally-stored overlays:
522% \begin{figure}
523% \begin{lstlisting}[]
524% # layman -a -o https://ossie.wireless.vt.edu/repos/ossie/experimental/scripts/gentoo/ossie-overlay.xml
525% \end{lstlisting}
526% \end{figure}
527%
528% You can then proceed with installing OSSIE:
529% \begin{figure}
530% \begin{lstlisting}[]
531% # emerge -av ossie
532% \end{lstlisting}
533% \end{figure}
534%
535% After sucessful compiliation of the OSSIE framework and its dependencies, skip
536% to section X.
537
538%\subsection{Embedded Platforms}
539%While installation on embedded platforms is not officially supported in the
540%0.6.2 release, work has been done (MENTION WORK) on porting OSSIE to embedded
541%platforms and we are interested in promoting more work in this area.
542
543
Note: See TracBrowser for help on using the browser.