Build ML on Ubuntu Linux via Virtual Box on Mac OS X

Started by rprr, December 04, 2017, 10:13:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rprr

My thanks to all the developers working on ML. Thank you.

I was able to get a build environment going on my Mac Using Virtual Box. It was fairly straightforward. Here are the steps.

1. On your Mac download and install Virtual Box. I used version 5.2.2 r119230. https://www.virtualbox.org/wiki/Downloads

2. Download the Ubuntu ISO to your Mac. I used ubuntu-16.04.3 LTS. https://www.ubuntu.com/download/desktop

3. Start Virtual Box and Install Ubuntu into it. I chose 2 GB RAM and 20 GB hard drive.

4. Once Ubuntu is installed, log into it. These are the things I had to install on the stock Ubuntu version to get ML to compile.

sudo apt-get install gcc-arm-none-eabi (It installs version 4.9.3 in /usr)
sudo apt-get install mercurial
sudo apt-get install perl
sudo perl -MCPAN -e 'install File::Slurp'

(Python 2.7 installed during Ubuntu install)

sudo apt-get install python-docutils

5. Now get Magic Lantern

hg clone -u unified https://bitbucket.org/hudson/magic-lantern

6. Editing the Makefile.user.default

cd magic-lantern
cp Makefile.user.default Makefile.user

(Change GCC arm paths in the Makefile.user)
ARM_PATH=/usr
GCC_VERSION=-4.9.3

7. Build. I have a T1i (500D)

cd platform/500D.111
make clean
make zip

It went fairly smoothly. Again, thanks to all. Hope this is helpful.


Edit to add: This was not enough to compile tools such as cr2hdr etc. I needed to do

sudo apt-get install gcc-multilib

Then

cd modules/dual_iso
make cr2hdr

a1ex

Sounds easier than expected, although it requires a VM.

I'm preparing to upgrade the build process to something even easier (one that should not require editing Makefile.user, even on Mac) - do you mind giving it a quick try?

rprr

Will be happy to test. It will definitely make it easier to not have to do any edits.

My next task is to build for the QEMU.


ilia3101

I've never had to edit makefile.user on mac, it always seemed to work. Have I been messing something up by not doing so?

Would love to try out any upgraded build process though!

Danne

I think that makefile is only affecting cr2hdr lately, seems to be fine otherwise.

a1ex

Quote from: Ilia3101 on December 05, 2017, 07:55:50 AM
I've never had to edit makefile.user on mac, it always seemed to work. Have I been messing something up by not doing so?

It was tied to a particular compiler version installed in a particular location. If your system is set up that way, it works; otherwise, you had to edit the paths, compiler version, maybe others.

The new system allows any arm-none-eabi-gcc, as long as it's in PATH or in the "usual" location in the home directory; it also fixes a bunch of nitpicks - click on the links ;)

Quote from: Danne on December 05, 2017, 07:57:17 AM
I think that makefile is only affecting cr2hdr lately, seems to be fine otherwise.

I don't think so.

rprr

For me, those edits to Makefile.user were necessary. It failed to build otherwise.