Author Topic: Compiling Magic Lantern in the Cloud  (Read 56870 times)

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3203
  • 60Da / 1100D / EOSM
Compiling Magic Lantern in the Cloud
« on: March 14, 2015, 04:08:42 AM »
Compiling Magic Lantern in the Cloud

Just found this neat solution for compiling and editing ML "in the cloud". There are several different online services that provide free linux VMs for coding. I managed to get ML to compile in one of these with minimal setup.

Here's a simple step by step guide

  • Head over to http://www.codio.com and setup an account (you get a VM with 2GB of hard drive and 256MB of RAM for free).
  • Create a new project with the default "stack"
  • When the project opens, goto Tools > Install Software and install 'zip'
  • Now go to Tools > Terminal
  • Copy and paste in the following command* (thanks g3gg0):
Code: [Select]
wget -q -O - http://pastebin.com/raw.php?i=jfVXzw1a | sed "s/\r//g" | bash


Now you are all set to compile, cd to your specific camera's directory, for example:
Code: [Select]
cd platform/550D.109/

Then:
Code: [Select]
make clean && make zip

Once you finished building, to download your files from the VM to your computer go to Project > Export as Zip

For more info on how to checkout other branches, merge and do other version control stuff see: http://hginit.com and also http://www.magiclantern.fm/forum/index.php?topic=9524.0

Happy Coding!


Next Steps: figure out how to setup QEMU in there


*here's the original script for reference:
Code: [Select]
#!/bin/sh
cd
curl -OL https://launchpad.net/gcc-arm-embedded/4.8/4.8-2013-q4-major/+download/gcc-arm-none-eabi-4_8-2013q4-20131204-linux.tar.bz2
bzip2 -d gcc-arm-none-eabi-4_8-2013q4-20131204-linux.tar.bz2
tar -x -f gcc-arm-none-eabi-4_8-2013q4-20131204-linux.tar
curl -OL http://prdownloads.sourceforge.net/docutils/docutils-0.12.tar.gz
gzip -d docutils-0.12.tar.gz
tar -x -f docutils-0.12.tar
cd docutils-0.12
python setup.py install --prefix=~/.local
cd
export PATH="$HOME/.local/bin:$PATH"
echo "export PATH=\"\$HOME/.local/bin:\$PATH\"" >> .bash_profile
cp .local/bin/rst2html.py .local/bin/rst2html
cd workspace
hg clone -r unified https://bitbucket.org/hudson/magic-lantern
cd magic-lantern

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 2958
  • 5D3 / M1 / 7D / 70D / SL1
Re: Compiling Magic Lantern in the Cloud
« Reply #1 on: March 14, 2015, 05:41:27 AM »
Sweet Stuff @dmilligan -- thanks for sharing a much needed program to make it easier for some of us to compile.

However, when trying to do this for 5D3.113 -- I get the following error via Terminal:



Take 2:


Take 3:
https://vimeo.com/122166125

Perhaps, am I missing something?

Thanks!
5D3.113 • 5D3.123 • EOSM.203 • 7D.203 • 70D.112 • 100D.101

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3035
Re: Compiling Magic Lantern in the Cloud
« Reply #2 on: March 14, 2015, 09:42:53 AM »
good idea, dmilligan.

@DeafEyeJedi
Code: [Select]
cd magic-lantern
make 5D3


that bootstrap script from dmilligan in short (pastebin):
Code: [Select]
    wget -q -O - http://pastebin.com/raw.php?i=jfVXzw1a | sed "s/\r//g" | bash
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 2958
  • 5D3 / M1 / 7D / 70D / SL1
Re: Compiling Magic Lantern in the Cloud
« Reply #3 on: March 18, 2015, 08:27:35 AM »
Thanks @g3gg0 -- I'll get on it and once I get the hang of it...will let you guys know how it goes!

*edit*

I got it to work and exported as a zip file... then the unzipped file itself looks quite a bit of a mess or no?

Codio:


Zip file (unzipped):


Is this normal?
5D3.113 • 5D3.123 • EOSM.203 • 7D.203 • 70D.112 • 100D.101

vertigopix

  • Senior
  • ****
  • Posts: 281
  • EOS M - 60D - 6D
Re: Compiling Magic Lantern in the Cloud
« Reply #4 on: March 18, 2015, 08:49:22 AM »
it's the entire source tree.

In "platform" you can get the autoexec.bin and in "modules" you gan get ...modules !   ;)

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3203
  • 60Da / 1100D / EOSM
Re: Compiling Magic Lantern in the Cloud
« Reply #5 on: March 18, 2015, 11:47:22 AM »
Is this normal?
Yes. I couldn't figure out a way to just download specific files, so you just download the entire thing. You should see a standard zip similar to the nightly build zip in platform/[cam]

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 2958
  • 5D3 / M1 / 7D / 70D / SL1
Re: Compiling Magic Lantern in the Cloud
« Reply #6 on: March 18, 2015, 05:13:13 PM »
Okay, I guess that makes sense. Thanks @vertigopix & @dmilligan for clarifying this. I'll give it another go.

Question -- how exactly can I grab the FRSP module that's been updated in the hudson branch recently by @a1ex? Do I just copy the whole module script from there and pasted it into the module's folder?
(i.e. -- I went ahead & copied the silent.c from hudson branch and just pasted it into silent.c within codio before exporting a zip file, is this correct?) [check video]

Also I'm not seeing autoexec.bin in platform -- hmmm?
 
I don't mind getting more familiar in advance with this so I can start compiling certain modules with the latest nightlies on a daily rate when possible.

Thanks again guys!

*edit*

Here's what I was referring to earlier...
https://vimeo.com/122552072

I don't think I'm seeing the 'standard' zip similar to the nightly build in platform (cam) folders... Unless I'm doing something wrong?
5D3.113 • 5D3.123 • EOSM.203 • 7D.203 • 70D.112 • 100D.101

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3203
  • 60Da / 1100D / EOSM
Re: Compiling Magic Lantern in the Cloud
« Reply #7 on: March 18, 2015, 07:20:35 PM »
Question -- how exactly can I grab the FRSP module that's been updated in the hudson branch recently by @a1ex?

FSRP is in it's own branch: "full-res-silent-pictures", you need to checkout that branch. Just coping silent.c will not work correctly.

For more info on how to checkout other branches, merge and do other version control stuff see: http://hginit.com

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 2958
  • 5D3 / M1 / 7D / 70D / SL1
Compiling Magic Lantern in the Cloud
« Reply #8 on: March 18, 2015, 07:40:38 PM »
Love the read so far regarding hg.

Definitely gonna dig deep on this to get the most of out it - thanks for the reminder w the link.

Until then...
5D3.113 • 5D3.123 • EOSM.203 • 7D.203 • 70D.112 • 100D.101

guisquil

  • New to the forum
  • *
  • Posts: 12
Re: Compiling Magic Lantern in the Cloud
« Reply #9 on: March 20, 2015, 08:30:23 AM »
Compiling Magic Lantern in the Cloud

Thanks so much for doing this I was able to compile the 7D "fullres-silent-pics" branch

guisquil

  • New to the forum
  • *
  • Posts: 12
Re: Compiling Magic Lantern in the Cloud
« Reply #10 on: March 21, 2015, 03:01:21 AM »
Some modules failed to build I'm following the OP steps:

Building module dual_iso...

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc                                         
/usr/bin/ld: cannot find -lgcc                                                                                                                 
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for -lgcc_s                                     
/usr/bin/ld: cannot find -lgcc_s                                                                                                               
collect2: error: ld returned 1 exit status                                                                                                     
make[4]: *** [cr2hdr] Error 1
                                                                                                                     
********************************************************                                                                                       
WARNING: module dual_iso failed to build, deleting                                                                                             
********************************************************

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3203
  • 60Da / 1100D / EOSM
Re: Compiling Magic Lantern in the Cloud
« Reply #11 on: March 21, 2015, 03:22:48 AM »
Yeah, cr2hdr and raw2dng have to be compiled in 32 bit mode, and this VM is 64 bit and doesn't have the 32bit gcc libraries installed. Without sudo privliges, I'm not sure installing them is possible. The only solution really is to modify the makefile for dual_iso module so that it doesn't try to compile cr2hdr (the same for raw_rec which tries to compile raw2dng).

guisquil

  • New to the forum
  • *
  • Posts: 12
Re: Compiling Magic Lantern in the Cloud
« Reply #12 on: March 21, 2015, 10:17:50 AM »
Thanks dmilligan for the info,

garry23

  • Hero Member
  • *****
  • Posts: 1267
Re: Compiling Magic Lantern in the Cloud
« Reply #13 on: April 09, 2015, 10:22:50 PM »
I'm not a coder but tried this 'in the cloud' approach.

I'm afraid I failed at step one, ie trying to duplicate dmilligan's instructions.

Has anyone successfully used this approach and is willing to give a little more insight into the workflow or steps to take.

I will be happy to simply get a compiled version, ie without changing anything.

Cheers

surami

  • Member
  • ***
  • Posts: 103
Re: Compiling Magic Lantern in the Cloud
« Reply #14 on: April 09, 2015, 10:50:48 PM »
Which ML build version?
550D + nightly ML

garry23

  • Hero Member
  • *****
  • Posts: 1267
Re: Compiling Magic Lantern in the Cloud
« Reply #15 on: April 09, 2015, 10:52:13 PM »
I'm directing all my learning at my 5DIII.

surami

  • Member
  • ***
  • Posts: 103
Re: Compiling Magic Lantern in the Cloud
« Reply #16 on: April 09, 2015, 11:03:09 PM »
If you are not a coder, it's better to wait for the right person. I compiled my first build on this week, so I'm not a pro in this.

Ask for help here.
550D + nightly ML

garry23

  • Hero Member
  • *****
  • Posts: 1267
Re: Compiling Magic Lantern in the Cloud
« Reply #17 on: April 09, 2015, 11:10:08 PM »
Let me correct myself.

I'm not an ML coder or more correctly someone who understands how to compile ML .

I do know how to code, it's just the steps to take using the 'in the cloud' approach.

Any help gratefully received :-)

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3203
  • 60Da / 1100D / EOSM
Re: Compiling Magic Lantern in the Cloud
« Reply #18 on: April 10, 2015, 12:10:30 AM »
Where are you getting stuck? Were you able to make a codio account and create a new project?

garry23

  • Hero Member
  • *****
  • Posts: 1267
Re: Compiling Magic Lantern in the Cloud
« Reply #19 on: April 10, 2015, 12:18:13 AM »
Truly, I don't want you to waste your time, however, I did stumble at the start:

Head over to http://www.codio.com and setup an account (you get a VM with 2GB of hard drive and 256MB of RAM for free). - DID THIS OK

Create a new project with the default "stack". I THINK I DID THIS OK

When the project opens, goto Tools > Install Software and install 'zip': DID NOT UNDERSTAND INSTALL ZIP

Now go to Tools > Terminal DIDNT GET THIS FAR

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3203
  • 60Da / 1100D / EOSM
Re: Compiling Magic Lantern in the Cloud
« Reply #20 on: April 10, 2015, 01:41:52 AM »
You see the tools menu? Go to "install software" you will see a lot of things you can install. Down near the end is "zip". Install it.

garry23

  • Hero Member
  • *****
  • Posts: 1267
Re: Compiling Magic Lantern in the Cloud
« Reply #21 on: April 10, 2015, 02:24:53 AM »
@dmilligan

Many thanks: progress.

It is exciting to see ML compile in front of you.

Having said that I stumbled again, as clearly I don't know how to use the 'cd' command.

Also, I really need to see the workflow of someone who has taken the ML 'source' and tweaked it and compiled it in the cloud.

BTW I'm not asking you to tell me or show me.

But I help some kind ML traveler who has worked out the 'cloud secrets' will share their method sometime.

Once again, thanks for getting me this far: I sense there is hope for me :-)

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3203
  • 60Da / 1100D / EOSM
Re: Compiling Magic Lantern in the Cloud
« Reply #22 on: April 10, 2015, 04:21:48 AM »

garry23

  • Hero Member
  • *****
  • Posts: 1267
Re: Compiling Magic Lantern in the Cloud
« Reply #23 on: April 10, 2015, 04:45:27 AM »
@dmilligan

I owe you a beer ;-)

I managed to complete the full process. Thanks for your help.

The 'last' question I have now is, how do I change the source, say in lens.c, ie to create a personal tweak of lens.c and compile it in the cloud..

Is this too complicated.

garry23

  • Hero Member
  • *****
  • Posts: 1267
Re: Compiling Magic Lantern in the Cloud
« Reply #24 on: April 10, 2015, 05:10:11 AM »
Another thing I noticed is that in the module folder there are no modules, only .c files.