Compiling the MSP source code

From University of Washington - Ubicomp Research Page
Jump to: navigation, search

Building the base source tree

If you'd like to make any changes to the MSP software, or would like to build new applications on top of the existing MSP software, you'll first need to compile the MSP source tree. To do so:

  1. Check out the MSP source code from the CSE subversion repository:
    svn co svn+ssh://<username>
    . TODO: Move this to a public repository.
  2. Switch to the source directory:
    cd msp/src
  3. Run the configure script. If building the MSP software for a native system, just run:
    If building the MSP software for the MSP, execute:
    CROSS_COMPILE=<path to cross-compiler>/bin/arm-linux- ./configure
    On CSE machines, this would be:
    CROSS_COMPILE=/projects/ubicomp/uwar/arm-linux/3.4.3_binutils/bin/arm-linux- ./configure
  4. Execute make:

Extending the source code

If you'd like to develop your own applications, there are a few things you need to do to integrate it with the MSP build system:

  1. Create a directory in src for your project.
  2. In that directory, create a Makefile. Use this template:
    include ../Makefile.conf
    MODULE_NAME = "<short module name>"
    MODULE_COMMENT = "<module description>"
    CFLAGS +=
    IFLAGS +=
    LFLAGS +=  -lglobal -lipc <any other libs you need>
    SOURCES = <a list of source files, seperated by spaces>
    PUBLIC_INCLUDES = <any header files to make available to other apps, seperated by spaces>
    PUBLIC_LIBRARIES = <any library files to make available to other apps, seperated by spaces>
    PUBLIC_BINARIES = <any binaries to copy to the bin directory>
    TARGETS = <a list of the binaries and potentially libraries to build, seperated by spaces>
    target-1:               <source objects, seperated by spaces>
    target-2:               <source objects, seperated by spaces>
    # rules
    include ../Makefile.rules
    Here's an example Makefile from the camera server:

    include ../Makefile.conf

    MODULE_NAME = "Camera" MODULE_COMMENT = "Camera Server"

    CFLAGS += IFLAGS += -I../../extern/ipp/5.0/pca_wmmx/include/ LFLAGS += -L../../extern/ipp/5.0/pca_wmmx/lib/pvkit -l ippIP_WMMX50LNX_r -l ippJP_WMMX50LNX_r -l ippAC_WMMX50LNX_r -l ippSP_WMMX50LNX_r -lglobal

    SOURCES = cam-server.c ippimem.c

    PUBLIC_INCLUDES = camera_interface.h

    PUBLIC_LIBRARIES = libcamera_interface.a


    TARGETS = libcamera_interface.a cam-server


    libcamera_interface.a: camera_interface.o

    cam-server: cam-server.o ippimem.o crc32.o

    1. rules

    include ../Makefile.rules

  3. Add the directory name to the list of PACKAGES in the main Makefile:
    PACKAGES = ipc global fileio activity-inference msb imu logger proccontrol system-tools gps examples \
               lsb new-gps camera gps-debug sb-update <new directory>