CS 448A - Computational photography (Winter 2010)

"Hello Camera" Assignment

Setting up a build environment

Follow the following instructions to set up your own cross-compilation environment for N900. You will need VMWare Workstation or Fusion, or Virtualbox (open-source alternative) to create a VM. If not, you can use an existing physical machine.
  1. Install your favorite distribution of Linux. We used Ubuntu 9.10. Make sure to choose a 32-bit edition, however, even if your physical machine is 64-bit.

  2. Install basic packages you might need, such as wget, emacs, p7zip-full, vim. What you install is entirely up to you, but you will probably want at least one text editor, if you are not happy with gedit.

  3. Disable VSDO (Virtual Dynamic Shared Object):

  4. Install Xephyr: sudo apt-get install xserver-xephyr.

  5. Create a folder ~/maemo and download installer scripts for Maemo 5 SDK (using wget, for instance) into the folder you have just created:

  6. Execute the first script as follows. This installs Scratchbox.

    cd ~/maemo
    chmod 744 ./maemo-scratchbox-install_5.0.sh
    sudo ./maemo-scratchbox-install_5.0.sh -u cs448a
    
    This may take a while. After the installation is complete, close the terminal and launch a new terminal.

  7. Execute the second script.

    cd ~/maemo
    chmod 744 ./maemo-sdk-install_5.0.sh
    /maemo-sdk-install_5.0.sh
    
    You probably want to install all dev packages, when asked.

  8. You should now be ready to login into Scratchbox by running /scratchbox/login. Note that Scratchbox is simply a chroot operation, and its root directory can be found at /scratchbox/users/cs448a/targets/FREMANTLE_ARMEL. The home directory in Scratchbox can be found at /scratchbox/users/cs448a/home/cs448a. I found it useful to set up symbolic links in your VM as such:

    ln -s /scratchbox/users/cs448a/targets/FREMANTLE_ARMEL ~/scratchbox_root
    ln -s /scratchbox/users/cs448a/home/cs448a ~/scratchbox_home
    

    This is particularly useful because Scratchbox does not come with a good text editor, so you will probably be editing your code in the virtual machine, rather than inside Scratchbox.

    Go ahead and login to Scratchbox, and run the following:

    sb-conf se FREMANTLE_ARMEL
    

  9. Install the binaries provided by Nokia. You must visit this page and obtain a token.

  10. [OPTIONAL] If you wish, you can repeat the above procedure for X86 target, in case you want to run your binaries in your VM in emulation mode. Run sb-conf se FREMANTLE_X86, and repeat the same procedure, with X86 in place of ARMEL in all the commands. Make sure to run sb-conf se FREMANTLE_ARMEL to get back to N900 target.

  11. Download Qt, a cross-platform application and UI framework.

    fakeroot apt-get install libqt4-dev libqt4-gui libqt4-opengl-dev
    
    If you wish, install other modules (like networking).

  12. Download the FCam library and examples, which includes the assignment skeleton. The FCam library file contains libFCam.a, which should be placed in /usr/lib and FCam directory (containing headers) that should be placed in /usr/include. Make sure to place them within Scratchbox, not the VM. (In the VM, the path would be ~/scratchbox-root/usr/lib, et cetera.)

© 2010 Marc Levoy, Fredo Durand and Jongmin Baek
Last update: January 14, 2010 04:25:45 PM