Magic Lantern development compiler.app (Mac OS)

Started by Danne, April 05, 2018, 10:37:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Danne

Compiler.app



Compiler.app is an automation tool aiming to be an easy one click solution setting up a magic lantern development environment on a mac. Main purpose is to get fast access into som basic functions such as changing branches, compile on a platform, module etc. Hopefully this also will encourage newcomers to get straight into compiling and testing. The tool can be used even if you already have a development environment installed.

Source
https://bitbucket.org/Dannephoto/ml_compiler-git/src/master/
Download
https://bitbucket.org/Dannephoto/ml_compiler-git/downloads/ml-compiler.dmg

Howto:

  • Download Compiler.app then Double click Compiler.app and follow instructions(link above)
    (Bypass gatekeeper by holding down ctrl when clicking the application the first time)
  • To change or add a repository just drag your magic-lantern repository onto Compiler.app

Most of the stuff is a continuation of what is brought into this thread by dfort. Bigger part of dfort quick installation script is included into Compiler.app.
(license gpl)



Example usage:
Here are some steps if you want to use my fork and the branch used for bleeding edge eosm:

Once you double clicked compiler.app and installed all dependencies do this:

1 - Download my repository. In terminal do:
hg clone https://[email protected]/Dannephoto/magic-lantern magic-lantern_dannephoto
This will download my repo and rename it to magic-lantern_dannephoto. It should land in your user folder

2 - Drag the repository named magic-lantern_dannephoto onto Compiler.app. Once the menu opens choose:
(b)  branches

3 - You´ll see at the top that your branch right now is:
current branch: default.
What you want is to be in:
current branch: crop_rec_4k_mlv_snd_isogain_1x3_presets

The top of source tree should look like this right now:
1   crop_rec_4k_mlv_snd_isogain_1x3_presets
2   digic6-dumper
3   recovery
4   crop_rec_4k_mlv_snd_isogain_1x3_presets_EOSM2
5   crop_rec_4k_5D2_rd_stuff

4 - So to get there simply print 1 at the bottom since the branch you want is the first one(hg source tree always keeps latest first) like this:
Please enter your selection number below and press enter:
1

If it a the top looks like this all has worked:
current branch: crop_rec_4k_mlv_snd_isogain_1x3_presets

5 - Now go back to:
(m)  main

6 - To compile select platform first in main menu:
(p)  platform

7 - select 17 for eosm:
17   EOSM.202

8 - Choose c for compiling and just wait until it´s done. When ready Compiler.app will open up the platform folder that you compiled from:
(c)  compile

masc

@Danne: very cool! Got the toolchain and the repos. Is it also possible to compile with compiler.app? I only found make clean...
5D3.113 | EOSM.202

Danne

Thanks masc :)
Yes, compiling possible. You navigate through menus, first enter (b)  branches and select a branch, head back to (m)  main then get into (p)  platform and select your camera and this will happen:


Just print make zip and when done the folder will open up serving you the goodies :)

masc

Yeaha. That works. Nice.
On installing there comes the question "Press RETURN to continue or any other key to abort" ... there is no difference between RETURN and other keys.
But hey, I can compile! :D

Is it possible to install to another directory? All is installed to /Users/<name>/
5D3.113 | EOSM.202

Danne

Great!
Yes, I´m aware of the abort failure. Will fix it. It´s in the script from dfort. Thanks for pointing that out.
You can drag any repo onto Compiler.app and that will become the repo you work from after this. It´s only installing default magic-lantern repo on vanilla installs(If this is what you´re asking regarding installing to another directory). This means you can move repos anywhere after downloading them and when dragged to Compiler.app work from there.

*update
Well, it´s actually not continuing after not hitting enter. The script correctly skips brew installation but immidietaly goes to the next command in the script which is brew related so one will think it´s installing anyway. I put in a safety check if brew already installed so it skips the ruby command all together:
if ! [ -f "/usr/local/bin/brew" ]
then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew install gcc@5 python wget mercurial

dfort

@Danne - updated the quick install script from the Compiling Magic Lantern on a Macintosh tutorial with your changes. Since the script lives on the forum and is not under version control please check it to make sure we stay in sync.

A better option is if you have the script in your repository I can just link to it from the tutorial so it will always be in sync. I already put in a link to this topic in the tutorial.

Danne

Nice one dfort :)
The quick installation script would be put into a repository you mean?
Or it could be detached into a subscript in Compiler.app and the referred/linked to but then it wouldn´t be a copy paste thingy since I did some minor changes to fit the compiler.
Maybe best to create a repo here? I could update it as I add changes in Compiler.app.
Only loss will be that it will be linked and not a direct code snippet in your forum post...

masc

@Danne: I don't mean the magic-lantern folder. I mean the gcc-arm-none-eabi-4_8-2013q4 & gcc-arm-none-eabi-5_4-2016q3 folder. I would like to have them somewhere else...
5D3.113 | EOSM.202

a1ex

@masc: as long as you have arm-none-eabi-gcc in your PATH, ML makefiles should pick it up without any tweaking. This looks up the compiler, so you can see what it tries.

General instructions: https://www.magiclantern.fm/forum/index.php?topic=991

dfort

@Danne: yeah, looks like we're already out of sync. I was thinking of something along the lines of this stackoverflow tip. My quick install script is meant to be copied and pasted into the terminal so the part that writes the file to disk before executing then deleting it when finished needs to be changed.

I should be able to do something like this only with the quick install script:

cd ~
wget https://bitbucket.org/Dannephoto/compiler/raw/default/Compiler.app/Contents/main.command
bash main.command && rm main.command


Try it.

BTW--looks like we're both using a non-portable bash shebang and should probably change it to "#!/usr/bin/env bash" like we did in the QEMU scripts.



Danne

I removed gcc-arm-none-eabi-4_8-2013q4 and gcc-arm-none-eabi-5_4-2016q3 and then added:
brew install caskroom/cask/gcc-arm-embedded
This seems to run ok, tried compiling for 5D mark III, mlv_dump and cr2hdr. Picks up:
Using /usr/local/bin/arm-none-eabi-gcc (from PATH).

If this seems a valid change I could replace the (preferred) gcc-arm versions with this?


@dfort. I´l look into your suggestions.

Danne

Seems to work nice @dfort. Nice suggestion. I added a few changes to have this work with (c) option too. I would suggest for this command:
[ ! -f "`which brew`" ] && /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
[ ! -f "`which wget`" ] && brew install wget
cd ~
sleep 1 && clear && echo "Press enter to proceed"  &
if [ -f main.command ]; then rm main.command; fi
wget https://bitbucket.org/Dannephoto/compiler/raw/default/Compiler.app/Contents/main.command
bash main.command && rm main.command

dfort

So no more excuses for Mac users not setting up a Magic Lantern development environment!

Thanks for keeping the install script separate so that it can be run as a stand alone script. Now it is under revision control just like a "real" app. Linked to this project from the Compiling Magic Lantern on a Macintosh tutorial.

Danne

Nice collaboration dfort and good idea to keep the script as a separate tool inside Compiler.app.

masc

Quote from: Danne on April 05, 2018, 05:29:13 PM
I removed gcc-arm-none-eabi-4_8-2013q4 and gcc-arm-none-eabi-5_4-2016q3 and then added:
brew install caskroom/cask/gcc-arm-embedded
This seems to run ok, tried compiling for 5D mark III, mlv_dump and cr2hdr. Picks up:
Using /usr/local/bin/arm-none-eabi-gcc (from PATH).

I tried that, but for me it does not work. That means compiler.app does not find the arm compiler and wants to install it. Did I miss something?
5D3.113 | EOSM.202

Danne

Should work by just bypassing and neglect to download and install the missing gcc folders or erase following from main.command inside Contents folder in Compiler.app to get rid of the nagging message:
https://bitbucket.org/Dannephoto/compiler/src/8a16fef6c98a38b1dec78bcab4099e826e920659/Compiler.app/Contents/main.command?at=default&fileviewer=file-view-default
lines 64-71:
if ! test -d ~/gcc-arm-none-eabi-4_8-2013q4;
then
gcc4=$(tput setaf 1)$(echo gcc4_8-2013q4 missing)$(tput sgr0)
fi
if ! test -d ~/gcc-arm-none-eabi-5_4-2016q3;
then
gcc5=$(tput setaf 1)$(echo gcc5_4-2016q3 missing)$(tput sgr0)
fi



masc

Thx Danne! That works! I commented these lines out. 8)
5D3.113 | EOSM.202

Danne


Danne

Added some refinements to the (b) branches menu item:



keyword search...


After keyword search



kotik

Error when installing Compiler.app:
'main.command' can not be opened because Sandbox is not allowed to open documents in Terminal.

P.s. 'Show contents' in Compiler.app and running 'main.command' in Terminal did the trick!   
My first Canon: FTb QL (Quick Loading), my first digital Canon: 20D 2.0.3
The current one: Canon EOS R

Danne

Interesting. Did you open it by ctrl click and open the first time?
By the way. What OS are you using?

kotik

Yep. Tried Ctrl-click the first time. Failed.
The latest macOS 10.13.4 on an iMac (Retina 5K, 27-inch, 2017).

P.S. As far as I 'know' it is working alright now. Still learning!  ;-)
My first Canon: FTb QL (Quick Loading), my first digital Canon: 20D 2.0.3
The current one: Canon EOS R

Danne

Cool. I'll see if I can reproduce this and then upload a fixed version. Compiling working as expected?

kotik

Tried to compile 17  80D.101
I get the next error after each command:

********************************************************
WARNING: module mlv_rec failed to build, deleting
********************************************************
Unfortunately the terminal is cleared after compiling.
So it is impossible to see the other errors.

I will remove the magic-lantern and qemu-eos folders and start from scratch.
My first Canon: FTb QL (Quick Loading), my first digital Canon: 20D 2.0.3
The current one: Canon EOS R

Danne

80D, that camera hasn't got magic lantern working yet I think?
What branch were you compiling in?
You can scroll up in terminal after compiling to see what else didin't work even after window is cleared.