Magic Lantern Forum

Developing Magic Lantern => General Development => Topic started by: rprr on December 04, 2017, 10:13:19 AM

Title: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
Post by: rprr 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 (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 (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
Title: Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
Post by: a1ex 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 (http://www.magiclantern.fm/forum/index.php?topic=991.msg194011#msg194011) to something even easier (one that should not require editing Makefile.user, even on Mac) - do you mind giving it a quick try?
Title: Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
Post by: rprr 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.

Title: Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
Post by: 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?

Would love to try out any upgraded build process though!
Title: Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
Post by: Danne on December 05, 2017, 07:57:17 AM
I think that makefile is only affecting cr2hdr lately, seems to be fine otherwise.
Title: Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
Post by: a1ex on December 05, 2017, 10:03:57 AM
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. (http://www.magiclantern.fm/forum/index.php?topic=14828.msg173590#msg173590)
Title: Re: Build ML on Ubuntu Linux via Virtual Box on Mac OS X
Post by: rprr on December 06, 2017, 06:21:08 AM
For me, those edits to Makefile.user were necessary. It failed to build otherwise.