Building the KUSP Software

This is a guide to building and installing the KUSP user-level software tree. Note that you must check out and build a KUSP kernel as described by Building the KUSP Kernel before following these instructions. The reason for this is that the KUSP user-level software uses KUSP kernel features and must have access to the header files and other information created by building the kernel in order to build the application code that will run on the KUSP kernel successfully.

KUSP User Software Dependencies

To build the KUSP Software:

  • KUSP kernel source
  • CMake 2.6
  • SWIG 1.3
  • Flex 2.5
  • Bison 2.4
  • gcc-c++ 4.4
  • python
  • python-devel
  • python-ply
  • zlib-devel
  • rpmdevtools
  • wget
  • patch
  • autoconf
  • automake
  • libtool

To use the KUSP software:

  • KUSP kernel install
  • python-ply (Python Lex and Yacc)
  • gnuplot
  • matplotlib

To prepare the proper context you should check out the KUSP tree from our SVN repository using the following SVN command and set two shell environment variables to point to the appropriate directories. Make sure that you are currently in the directory where you wish to checkout the KUSP user-level source tree before running the SVN command:

bash$ cd <kernel-source-tree-root>; export KUSPKERNELROOT=`pwd`
bash$ cd <directory-where-want-to-check-KUSP-out>

Get the Source:

bash$ svn co https://subversion.ittc.ku.edu/svn/libertos/kusp/trunk kusp
bash$ cd kusp; export KUSPROOT=`pwd`

Building and Installing the KUSP RPM

The RPM method is preferred over the local installation method. The transition from a local install to an RPM install can be a little tricky. Sometimes, CMake will cache things in weird ways that make the RPM install work incorrectly. It is best to delete the local install directory, delete the kusp directory, and then start from a fresh checkout of the kusp directory.

Creating a rpmbuild Directory

An rpmbuild directory is needed to build the KUSP RPM. The rpmbuild directory can be located anywhere. If an rpmbuild directory already exists then this step can be skipped.

  1. First, install rpmdevtools:

    bash$ sudo yum install rpmdevtools
  2. Next, navigate to the directory where the rpmbuild directory should be created and create it using rpmdev-setuptree

    bash$ cd <directory to contain rpmbuild>;rpmdev-setuptreee
  3. Finally, rpmbuild needs to be pointed to where the rpmbuild directory is located. To direct rpmbuild, add/modify the %_topdir line in ~/.rpmmacros

    %_topdir   <path to rpmbuild directory>

Building the RPM

RPM builds are automated by a makefile located in the root of the KUSP directory.

  1. Tell the kusp software where the kernel is located. This can be done from the command line

    bash$ export KUSPKERNELROOT=<path-to-kernel-source>

    Alternatively, consider adding this line to your .bash_profile file (located in your home directory as a hidden file):

    export KUSPKERNELROOT=<path-to-kernel-source>
  2. Reload your .bash_profile by logging out and then logging back in.

  3. Navigate to the root of your kusp directory:

    bash$ cd $KUSPROOT
  4. Run the makefile:

    bash$ make

Installing the RPM

The rpm can be installed automatically by the same makefile that was used to build it. If the rpm has already been installed, the makefile will automatically remove it before installing the rpm again.:

bash$ make install

Note

In addition to installing the RPM on the current machine, KUSP developers my also install on remote testbed(s) by running:

bash$ make install REMOTE=mytestbed

or for multiple machines:

bash$ make install REMOTE="mytestbed0 mytestbed1 ..."

Building Kusp Examples

To build the kusp examples

bash$ cd $KUSPROOT/examples
bash$ make -f examples.mk

DebugFS

The DSKI subsystem depends on DebugFS to operate properly. Many systems do not mount DebugFS by default. To automatically mount DebugFS, create a directory for the mount:

bash$ cd /; sudo mkdir debug

To mount DebugFS at start up, add the following line to /etc/fstab and reboot the system:

debugfs                 /debug                  debugfs defaults        0 0

Udev Rules

There are several KUSP devices that are inaccessible by default. Udev rules can be used to change the permissions of the KUSP devices and make them usable. A 40-kusp.rules file is located in $KUSPROOT/misc. Copy this file to /lib/udev/rules.d and reboot the system.

Building the KUSP Source Tree Using CMake

Warning

This approach to building the software is now deprecated.

We are about to build a series of commands and other software which will need to be installed somewhere. Part of setting up your own environment will be to create a directory in which all of the KUSP software will be installed:

bash$ mkdir <kusp-install-dir>

Consider adding these lines to your .bashrc file (located in your home directory as hidden file):

export KUSPINSTALL=<kusp-install-dir>
export PYTHONPATH=$KUSPINSTALL/lib/python2.5/site-packages:$PYTHONPATH
export LD_LIBRARY_PATH=$KUSPINSTALL/lib:$LD_LIBRARY_PATH
export PATH=$KUSPINSTALL/bin:$PATH
export KUSPKERNELROOT=<path-to-kernel-source>

Reload your .bashrc by going to your home directory and entering (at the command line):

bash$ . ~/.bashrc
  • Note: please double check paths, including ensuring that your python path is pointing to the most up-to-date library, (2.5 may become out of date)<br><br>

The KUSP Quick Installation guide is meant for those familiar with CMake, Subversion, the KUSP source tree, and general Linux software installation methods.

Build KUSP:

bash$ cd $KUSPROOT
bash$ make -f kusp.mk