Results 1 to 10 of 15

Thread: Compiling made relatively easy

Threaded View

  1. #1
    Join Date
    Feb 2010
    Posts
    640

    Default Compiling made relatively easy

    So there's a couple of machines that I have that have nice features but are missing some programs/utilities I would like them to have.

    To get things done faster, I've turned to using an os-virtualizer along with a system image for a mipsel device.

    On my ubuntu laptop I have added two things that have made compiling for such devices a bit easier:
    QEMU:
    http://wiki.qemu.org/Main_Page (here's a link to a windows qemu project:http://www.davereyn.co.uk/download.htm)
    In combination with the system-image-mipsel.tar.bz2 from:
    http://impactlinux.com/fwl/downloads/binaries/

    After I've installed qemu (via synaptic package manager in ubuntu, or however) I run the dev-environment.sh script from the system-image-mipsel.tar.bz2 above.

    That starts the virtualized mipsel with an add on savable space, hdb.img.

    So, for example, I wanted to compile a program for the playlist script I've been tinkering with. Mixing a 4000 line file by way of bash took upwards of 5 minutes. A compiled program would run much faster.

    I found a program called shuffle that would do exactly what I needed with source code available:
    http://www.eskimo.com/~scs/src/

    So I went to the directory I untarred system-image-mipsel.tar.bz2 to. then:

    Code:
    ./dev-environment.sh
    (qemu load the mipsel image and I get this new prompt)
    (mipsel) /home #
    wget ftp://ftp.eskimo.com/u/s/scs/src/shuffle.tar.gz
    tar -xzf shuffle.tar.gz
    cd shuffle
    make
    ((wait for shuffle to compile when done:))
    exit
    Now back on my ubuntu system, I need to load that writable space that the system-image-mipsel was using, so:
    Code:
    mkdir temp
    sudo mount -o loop hdb.img temp/
    ((sudo is an ubuntu-required step for mounting, your linux install may not need it))
    cp temp/shuffle/shuffle .
    And now you should have your copy of your compiled shuffle executable in your folder.

    Move it on over to your media player. Try it out.

    Code:
    ./shuffle -help
    usage: shuffle [options] [-o outputfile] [inputfiles ...]
    -h, -?  print this help message
    -o file output to file
    -seed s use initial seed s
    -seedfile f  keep seed state in f
    Now things get harder with more advanced executables. You might need libraries and other depencies to be resolved. Nonetheless, this is a shortcut for some compiling needs.

    EDIT_NOTE:
    I saw this in the README:

    If both distccd and a compatible $ARCH-cc cross compiler are in the $PATH,
    dev-environment.sh will automatically set up distcc to call out through the
    virtual network to the host's $ARCH-cc, to move the heavy lifting of
    compilation outside the emulator, and also take advantage of SMP. (Doing
    so does not require the package being built to be cross compile aware.
    As far as the emulated build environment is concerned, it's still performing
    simple single-context native builds.)
    I downloaded, made and installed distcc on my ubuntu laptop, used the http://impactlinux.com/fwl/downloads...mipsel.tar.bz2, untarred and added to my PATH, and by golly, the making is much faster- which means my more ambitious compilations return errors faster!

    -wigout
    Last edited by wigout; 09-18-2010 at 04:20 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •