Author Topic: Compiling Magic Lantern on a Macintosh  (Read 58742 times)

Levas

  • Hero Member
  • *****
  • Posts: 1357
  • 6d - Nightly build user
Re: Compiling Magic Lantern on a Macintosh
« Reply #175 on: June 27, 2018, 10:33:23 AM »
Quote
What do you see when running this?
Code: [Select]
python -c "import sys; print('\n'.join(sys.path))"

I see this:
Code: [Select]
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Users/magic_lantern/Library/Python/2.7/lib/python/site-packages
/usr/local/lib/python2.7/site-packages
/usr/local/Cellar/numpy/1.14.5/libexec/nose/lib/python2.7/site-packages
/Library/Python/2.7/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC

Haven't try to reinstall python 2, is it better or needed for compiling ?

Danne

  • Hero Member
  • *****
  • Posts: 4916
Re: Compiling Magic Lantern on a Macintosh
« Reply #176 on: June 27, 2018, 10:36:17 AM »
It seems to be there, must have been paths.
Well, I would play around with butterflow and then reinstall python2. Probably more futureproof.

Levas

  • Hero Member
  • *****
  • Posts: 1357
  • 6d - Nightly build user
Re: Compiling Magic Lantern on a Macintosh
« Reply #177 on: June 27, 2018, 10:53:36 AM »
Couldn't get butterflow to work (gonna give it a try on a new user account, so when things get messy again, I delete the user account  :P)

So I reinstalled python 2, needed to do some forced relinking, changed the default.user.file back to python2 and ML compiling is working again with python2, thanks  :D

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3432
Re: Compiling Magic Lantern on a Macintosh
« Reply #178 on: June 27, 2018, 08:00:14 PM »
Yeah, I also had issues when installing dependencies for various applications. Good to hear you got python2 working again.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3432
Re: Compiling Magic Lantern on a Macintosh
« Reply #179 on: October 29, 2018, 03:38:18 PM »
For those of us who like to live on the bleeding edge--Apple released a major OS update called Mojave (10.14). After running the update I had to re-install the xcode command line developer tools. There's also a Homebrew update for Mojave. Seems I did everything right but I'm getting this error when compiling ML:

Code: [Select]
[ XOR_CHK  ]   ../../build_tools/xor_chk
In file included from /usr/local/Cellar/[email protected]/5.5.0_2/lib/gcc/5/gcc/x86_64-apple-darwin17.3.0/5.5.0/include/stdint.h:9:0,
                 from ../../build_tools/xor_chk.c:2:
/usr/local/Cellar/[email protected]/5.5.0_2/lib/gcc/5/gcc/x86_64-apple-darwin17.3.0/5.5.0/include-fixed/stdint.h:27:32: fatal error: sys/_types/_int8_t.h: No such file or directory
compilation terminated.
make: *** [../../build_tools/xor_chk] Error 1

I also tried wiping out brew and starting over with Danne's Compiler.app but I'm still getting this error.

There's also problems building the ML command line tools:

Code: [Select]
make mlv_dump
Using ~/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gcc (preferred).
[ HOST_CC  ]   mlv_dump.host.o
In file included from mlv_dump.c:22:0:
/usr/local/Cellar/[email protected]/5.5.0_2/lib/gcc/5/gcc/x86_64-apple-darwin17.3.0/5.5.0/include-fixed/math.h:45:23: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
make: *** [mlv_dump.host.o] Error 1

The MinGW compiler works fine so there seems to be an issue with Mojave and the Homebrew gcc compiler.

[EDIT] Workaround is to remove the Makefile.user section that points to the Homebrew gcc-5 compiler. This works for compiling ML but not for the command line tools, mlv_dump and cr2hdr.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103

Danne

  • Hero Member
  • *****
  • Posts: 4916
Re: Compiling Magic Lantern on a Macintosh
« Reply #180 on: October 29, 2018, 04:17:33 PM »
Could you try uninstall command line tools and reinstall them?

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3432
Re: Compiling Magic Lantern on a Macintosh
« Reply #181 on: October 29, 2018, 05:22:05 PM »
Could you try uninstall command line tools and reinstall them?

Been there, done that. Seems to be a problem with the Homebrew version of gcc-5 not being compatible with Mojave.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103

Danne

  • Hero Member
  • *****
  • Posts: 4916
Re: Compiling Magic Lantern on a Macintosh
« Reply #182 on: October 29, 2018, 05:32:56 PM »
Just upgraded command line tools and now facing the same issues as you describe.

Danne

  • Hero Member
  • *****
  • Posts: 4916
Re: Compiling Magic Lantern on a Macintosh
« Reply #183 on: October 29, 2018, 05:44:48 PM »
Ok, fix seems this:
https://stackoverflow.com/questions/52509602/cant-compile-c-program-on-a-mac-after-upgrade-to-mojave

Install macOS_SDK_headers_for_macOS_10.14.pkg by finding it here:
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Conclusion: command line tools will not install the same way anymore. Will fix the script later.
Compiles platform build
Compiles both mlv_dump and cr2hdr

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3432
Re: Compiling Magic Lantern on a Macintosh
« Reply #184 on: October 29, 2018, 05:55:07 PM »
Ok--this command fixed it:

Code: [Select]
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103

Danne

  • Hero Member
  • *****
  • Posts: 4916
Re: Compiling Magic Lantern on a Macintosh
« Reply #185 on: October 29, 2018, 05:57:58 PM »
Should rework the script to do proper reinstalls/updates.

Danne

  • Hero Member
  • *****
  • Posts: 4916
Re: Compiling Magic Lantern on a Macintosh
« Reply #186 on: October 30, 2018, 07:45:41 AM »