Author Topic: Build ML on Ubuntu Linux via Virtual Box on Mac OS X  (Read 261 times)

rprr

  • New to the forum
  • *
  • Posts: 3
  • T1i/500D
Build ML on Ubuntu Linux via Virtual Box on Mac OS X
« on: December 04, 2017, 10:13:19 AM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 10546
  • 5D Mark Free
Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
« Reply #1 on: December 05, 2017, 12:04:24 AM »
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

  • New to the forum
  • *
  • Posts: 3
  • T1i/500D
Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
« Reply #2 on: December 05, 2017, 02:18:14 AM »
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

  • Senior
  • ****
  • Posts: 252
Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
« Reply #3 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?

Would love to try out any upgraded build process though!
5D2

Danne

  • Hero Member
  • *****
  • Posts: 3537
Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
« Reply #4 on: December 05, 2017, 07:57:17 AM »
I think that makefile is only affecting cr2hdr lately, seems to be fine otherwise.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10546
  • 5D Mark Free
Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
« Reply #5 on: December 05, 2017, 10:03:57 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 ;)

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

I don't think so.

rprr

  • New to the forum
  • *
  • Posts: 3
  • T1i/500D
Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
« Reply #6 on: December 06, 2017, 06:21:08 AM »
For me, those edits to Makefile.user were necessary. It failed to build otherwise.