Author Topic: Magic Lantern development compiler.app (Mac OS)  (Read 2548 times)

Danne

  • Hero Member
  • *****
  • Posts: 4250
Magic Lantern development compiler.app (Mac OS)
« on: April 05, 2018, 10:37:26 AM »
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/compiler/overview
Download
https://bitbucket.org/Dannephoto/compiler/downloads/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)

masc

  • Hero Member
  • *****
  • Posts: 516
  • EOS 5D Mark II
Re: Magic lantern development compiler tool(Mac OS)
« Reply #1 on: April 05, 2018, 02:03:36 PM »
@Danne: very cool! Got the toolchain and the repos. Is it also possible to compile with compiler.app? I only found make clean...
5D2.212

Danne

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic lantern development compiler tool(Mac OS)
« Reply #2 on: April 05, 2018, 02:14:53 PM »
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

  • Hero Member
  • *****
  • Posts: 516
  • EOS 5D Mark II
Re: Magic lantern development compiler tool(Mac OS)
« Reply #3 on: April 05, 2018, 02:37:41 PM »
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>/
5D2.212

Danne

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic lantern development compiler tool(Mac OS)
« Reply #4 on: April 05, 2018, 02:47:39 PM »
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:
Code: [Select]
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

  • Developer
  • Hero Member
  • *****
  • Posts: 3022
Re: Magic lantern development compiler tool(Mac OS)
« Reply #5 on: April 05, 2018, 03:38:41 PM »
@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.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 500D.112

Danne

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic lantern development compiler tool(Mac OS)
« Reply #6 on: April 05, 2018, 03:50:05 PM »
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

  • Hero Member
  • *****
  • Posts: 516
  • EOS 5D Mark II
Re: Magic lantern development compiler tool(Mac OS)
« Reply #7 on: April 05, 2018, 04:31:17 PM »
@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...
5D2.212

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 11470
  • 5D Mark Free
Re: Magic lantern development compiler tool(Mac OS)
« Reply #8 on: April 05, 2018, 04:36:46 PM »
@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

  • Developer
  • Hero Member
  • *****
  • Posts: 3022
Re: Magic lantern development compiler tool(Mac OS)
« Reply #9 on: April 05, 2018, 05:27:45 PM »
@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:

Code: [Select]
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.


5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 500D.112

Danne

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic lantern development compiler tool(Mac OS)
« Reply #10 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:
Code: [Select]
brew install caskroom/cask/gcc-arm-embeddedThis seems to run ok, tried compiling for 5D mark III, mlv_dump and cr2hdr. Picks up:
Code: [Select]
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

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic lantern development compiler tool(Mac OS)
« Reply #11 on: April 05, 2018, 06:26:15 PM »
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:
Code: [Select]
[ ! -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

  • Developer
  • Hero Member
  • *****
  • Posts: 3022
Re: Magic lantern development compiler tool(Mac OS)
« Reply #12 on: April 07, 2018, 03:18:53 AM »
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.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 500D.112

Danne

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic lantern development compiler tool(Mac OS)
« Reply #13 on: April 07, 2018, 08:12:49 AM »
Nice collaboration dfort and good idea to keep the script as a separate tool inside Compiler.app.

masc

  • Hero Member
  • *****
  • Posts: 516
  • EOS 5D Mark II
Re: Magic lantern development compiler tool(Mac OS)
« Reply #14 on: April 10, 2018, 11:59:51 AM »
I removed gcc-arm-none-eabi-4_8-2013q4 and gcc-arm-none-eabi-5_4-2016q3 and then added:
Code: [Select]
brew install caskroom/cask/gcc-arm-embeddedThis seems to run ok, tried compiling for 5D mark III, mlv_dump and cr2hdr. Picks up:
Code: [Select]
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?
5D2.212

Danne

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic Lantern development compiler tool (Mac OS)
« Reply #15 on: April 10, 2018, 12:45:52 PM »
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:
Code: [Select]
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

  • Hero Member
  • *****
  • Posts: 516
  • EOS 5D Mark II
Re: Magic Lantern development compiler tool (Mac OS)
« Reply #16 on: April 10, 2018, 07:28:39 PM »
Thx Danne! That works! I commented these lines out. 8)
5D2.212

Danne

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic Lantern development compiler tool (Mac OS)
« Reply #17 on: April 10, 2018, 09:44:02 PM »
Great masc. And good tip from A1ex.

Danne

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic Lantern development compiler.app (Mac OS)
« Reply #18 on: May 16, 2018, 03:26:56 PM »
Added some refinements to the (b) branches menu item:



keyword search...


After keyword search



kotik

  • Freshman
  • **
  • Posts: 80
Re: Magic Lantern development compiler.app (Mac OS)
« Reply #19 on: May 19, 2018, 04:05:20 PM »
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 ones: 80D 1.0.2, 6D Mark II 1.0.4, I would like to have this one: Canon C200 ;)

Danne

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic Lantern development compiler.app (Mac OS)
« Reply #20 on: May 19, 2018, 04:52:27 PM »
Interesting. Did you open it by ctrl click and open the first time?
By the way. What OS are you using?

kotik

  • Freshman
  • **
  • Posts: 80
Re: Magic Lantern development compiler.app (Mac OS)
« Reply #21 on: May 19, 2018, 06:54:50 PM »
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 ones: 80D 1.0.2, 6D Mark II 1.0.4, I would like to have this one: Canon C200 ;)

Danne

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic Lantern development compiler.app (Mac OS)
« Reply #22 on: May 19, 2018, 07:03:01 PM »
Cool. I'll see if I can reproduce this and then upload a fixed version. Compiling working as expected?

kotik

  • Freshman
  • **
  • Posts: 80
Re: Magic Lantern development compiler.app (Mac OS)
« Reply #23 on: May 19, 2018, 07:33:59 PM »
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 ones: 80D 1.0.2, 6D Mark II 1.0.4, I would like to have this one: Canon C200 ;)

Danne

  • Hero Member
  • *****
  • Posts: 4250
Re: Magic Lantern development compiler.app (Mac OS)
« Reply #24 on: May 19, 2018, 07:48:11 PM »
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.