Compiling Magic Lantern in the Cloud

Started by dmilligan, March 14, 2015, 04:08:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dmilligan

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):

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:

cd platform/550D.109/


Then:

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:

#!/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

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 | EOSM2.* | 50D.109

g3gg0

good idea, dmilligan.

@DeafEyeJedi

cd magic-lantern
make 5D3



that bootstrap script from dmilligan in short (pastebin):

    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

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 | EOSM2.* | 50D.109

vertigopix

it's the entire source tree.

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

dmilligan

Quote from: DeafEyeJedi on March 18, 2015, 08:27:35 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

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 | EOSM2.* | 50D.109

dmilligan

Quote from: DeafEyeJedi on March 18, 2015, 05:13:13 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.

Quote from: dmilligan on March 14, 2015, 04:08:42 AM
For more info on how to checkout other branches, merge and do other version control stuff see: http://hginit.com

DeafEyeJedi

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 | EOSM2.* | 50D.109

guisquil

Quote from: dmilligan on March 14, 2015, 04:08:42 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

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

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


garry23

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

550D + nightly ML

garry23

I'm directing all my learning at my 5DIII.

surami

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

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

Where are you getting stuck? Were you able to make a codio account and create a new project?

garry23

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

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

@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


garry23

@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

Another thing I noticed is that in the module folder there are no modules, only .c files.