Compiling Magic Lantern on a Macintosh

Started by dfort, October 14, 2015, 02:36:14 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

dfort

That is one of the most common issues--
rst2html: command not found.
Are you sure you followed all of my instructions?
Try this:
which rst2html
If you get nothing -- Did you install docutils? That's where we get rst2html.
pip install docutils
and then make soft links to all the python scripts that end in .py with:
for f in /usr/local/bin/*.py; do ln -s $f "${f/.py/}"; done


DeafEyeJedi

That's weird because I actually went back to the OP of this thread AFTER I successfully got the 2nd gcc installed into the root user.

Here's what I did...

Last login: Mon Nov  2 08:25:57 on ttys000
Apples-Macintosh-10:~ DeafEyeJedi$ which rst2html
Apples-Macintosh-10:~ DeafEyeJedi$ pip install docutils
Requirement already satisfied (use --upgrade to upgrade): docutils in /usr/local/lib/python2.7/site-packages
Apples-Macintosh-10:~ DeafEyeJedi$ pip install docutils --upgrade
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(54, 'Connection reset by peer'))': /simple/docutils/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(54, 'Connection reset by peer'))': /simple/docutils/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(54, 'Connection reset by peer'))': /simple/docutils/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(54, 'Connection reset by peer'))': /simple/docutils/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(54, 'Connection reset by peer'))': /simple/docutils/
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(54, 'Connection reset by peer'))': /simple/docutils/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(54, 'Connection reset by peer'))': /simple/docutils/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(54, 'Connection reset by peer'))': /simple/docutils/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(54, 'Connection reset by peer'))': /simple/docutils/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(54, 'Connection reset by peer'))': /simple/docutils/
Requirement already up-to-date: docutils in /usr/local/lib/python2.7/site-packages
Apples-Macintosh-10:~ DeafEyeJedi$


Is this common to you at all? I haven't seen this one before myself...

Anyway after all is said and done... Went ahead and tried to compile again from your fork which still shows "Error, Module did not Build -- Deleted" for each and every Module... I find this strange. I wonder if it had anything to do with the Firewall through Wifi that I am using at work.

Will give it a 2nd try using my Hotspot from iPhone to see if I can bypass those so called errors...

*edit#1*

Doesn't seem to matter which Network I am using (as expected) and now even tho I did install "pip install docutils" which claims I already have them installed. However, May I just go-ahead & deleted those and reinstall them if that would to help?

Apples-Macintosh-10:~ DeafEyeJedi$ cd magic-lantern/platform/EOSM.202/
Apples-Macintosh-10:EOSM.202 DeafEyeJedi$ make clean && make zip
[ RM ]  *.o *.d autoexec autoexec.bin magiclantern magiclantern.bin
[ RM ]  EOSM_202.sym magiclantern.sym
[ RM ]  magiclantern.bin autoexec autoexec.map location.map
[ RM ]  autoexec-fir autoexec-fir.bin
[ RM ]  magiclantern.lds
[ RM ]  dietlibc.a newlib-libc.a newlib-libm.a gcc-libgcc.a
[ RM ]  version.c version.bin
[ RM ]  ../../build_tools/xor_chk ../../build_tools/xor_chk.exe
[ RM dir ]  zip
[ RM ]  *.zip
../../Makefile.inc:79: remove /Users/appleuser/magic-lantern/platform/EOSM.202/zip
[ RM dir ]  /Users/appleuser/magic-lantern/platform/EOSM.202/zip/
mkdir -p /Users/appleuser/magic-lantern/platform/EOSM.202/zip
[ CPP      ]   magiclantern.lds
[ AS       ]   entry.o
[ AS       ]   ../../platform/EOSM.202/stubs.o
[ VERSION  ]   ../../platform/EOSM.202/version.c
[ CC       ]   version.o
[ CC       ]   boot-hack.o
[ CC       ]   fio-ml.o
[ CC       ]   mem.o
[ CC       ]   ico.o
[ CC       ]   edmac.o
[ CC       ]   menu.o
[ CC       ]   debug.o
[ CC       ]   rand.o
[ CC       ]   posix.o
[ CC       ]   util.o
[ CC       ]   imath.o
[ CC       ]   electronic_level.o
[ CC       ]   cfn.o
[ CC       ]   gui.o
[ CC       ]   picstyle.o
[ CC       ]   exmem.o
[ CC       ]   bmp.o
[ CC       ]   rbf_font.o
[ CC       ]   config.o
[ CC       ]   stdio.o
[ CC       ]   bitrate.o
In file included from ../../src/bitrate.c:5:0:
../../src/bitrate.c: In function 'time_indicator_show':
../../src/bitrate.c:400:81: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         int fnts = FONT(FONT_SMALL, COLOR_WHITE, mvr_config.actual_qscale_maybe == -16 ? COLOR_RED : COLOR_BLACK);
                                                                                 ^
../../src/bmp.h:174:13: note: in definition of macro 'FONT'
         | ((bg) & 0xFF) << 8 \
             ^
../../src/bitrate.c:405:23: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
             mvr_config.actual_qscale_maybe < 0 ? "-" : "+",
                       ^
[ CC       ]   lcdsensor.o
[ CC       ]   tweaks.o
[ CC       ]   tweaks-eyefi.o
[ CC       ]   lens.o
[ CC       ]   property.o
[ CC       ]   propvalues.o
[ CC       ]   gui-common.o
[ CC       ]   chdk-gui_draw.o
[ CC       ]   movtweaks.o
[ CC       ]   menuhelp.o
[ CC       ]   menuindex.o
[ CC       ]   focus.o
[ CC       ]   notify_box.o
[ CC       ]   bootflags.o
[ CC       ]   dialog_test.o
[ CC       ]   vram.o
[ CC       ]   greenscreen.o
[ CC       ]   fps-engio.o
../../src/fps-engio.c:294:12: warning: 'fps_timer_b_method' defined but not used [-Wunused-variable]
static int fps_timer_b_method = 0;
            ^
[ CC       ]   shoot.o
[ CC       ]   hdr.o
[ CC       ]   lv-img-engio.o
[ CC       ]   state-object.o
[ CC       ]   tasks.o
[ CC       ]   vsync-lite.o
[ CC       ]   tskmon.o
[ CC       ]   battery.o
[ CC       ]   imgconv.o
[ CC       ]   histogram.o
[ CC       ]   falsecolor.o
[ CC       ]   audio-ak.o
[ CC       ]   zebra.o
../../src/zebra.c:173:12: warning: 'transparent_overlay_hidden' defined but not used [-Wunused-variable]
static int transparent_overlay_hidden = 0;
            ^
[ CC       ]   vectorscope.o
[ CC       ]   beep.o
[ CC       ]   crop-mode-hack.o
[ CC       ]   ph_info_disp.o
[ CC       ]   flexinfo.o
[ CC       ]   screenshot.o
[ CC       ]   fileprefix.o
[ CC       ]   lvinfo.o
[ CC       ]   builtin-enforcing.o
[ CC       ]   ml-cbr.o
[ CC       ]   raw.o
../../src/raw.c: In function 'raw_update_params_work':
../../src/raw.c:539:10: warning: #warning FIXME: are these values correct for 720p and crop modes? [-Wcpp]
         #warning FIXME: are these values correct for 720p and crop modes?
          ^
[ CC       ]   chdk-dng.o
[ CC       ]   edmac-memcpy.o
[ CC       ]   console.o
[ CC       ]   tcc-glue.o
make -C ../../tcc
make[1]: Nothing to be done for `all'.
[ CC       ]   module.o
[ AR       ]   strrchr.o
[ AR       ]   dietlibc.a
[ AR       ]   lib_a-setjmp.o
[ AR       ]   newlib-libc.a
[ CP       ]   newlib-libm.a
[ CP       ]   gcc-libgcc.a
[ LD       ]   magiclantern
[ SYMBOLS  ]   magiclantern.sym
[ CP       ]   EOSM_202.sym
[ MKDIR    ]   install
[ CP       ]   install
[ VERSION  ]   ../../platform/EOSM.202/version.bin
[ OBJCOPY  ]   magiclantern.bin
[ STAT     ]   magiclantern.bin
magiclantern.bin: 441336 bytes
[ CC       ]   reboot.o
[ CC       ]   disp_direct.o
[ CC       ]   font_direct.o
[ CC       ]   footer.o
[ LD       ]   autoexec

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  EXIDX          0x06bcd0 0x00109dd0 0x00109dd0 0x00008 0x00008 R   0x4
  LOAD           0x0000e0 0x0009e1e0 0x0009e1e0 0x6bbf8 0x7f20c RWE 0x100
[ XOR_CHK  ]   ../../build_tools/xor_chk
[ OBJCOPY  ]   autoexec.bin
[ OBJCOPY  ]   autoexec.bin
[ XOR_CHK  ]   autoexec.bin
cp autoexec.bin /Users/appleuser/magic-lantern/platform/EOSM.202/zip/
mkdir -p /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML
mkdir -p /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/fonts
mkdir -p /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/settings
mkdir -p /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/data
mkdir -p /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/cropmks
mkdir -p /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/scripts
mkdir -p /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/logs
mkdir -p /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/doc
cp ../../data/fonts/*.rbf /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/fonts/
cp ../../data/vram/*.lut /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/data/
cp ../../data/cropmks/*.bmp /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/cropmks/
cp ../../scripts/*.lua /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/scripts/
cp ../../scripts/*.c /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/scripts/
cp ../../scripts/*.py /Users/appleuser/magic-lantern/platform/EOSM.202/zip/ML/scripts/
make -C ../../modules

Building module raw_rec...
Updated HGVERSION
[ README   ]   module_strings.h
$//"README.rst | grep -v -E "^:([^:])+:.+$" | rst2html --no-xml-declaration | python ../html2text.py -b 700 | sed "s/



/bin/sh: rst2html: command not found

(<type 'exceptions.SystemExit'>, SystemExit(1,), <traceback object at 0x100c72cf8>)
make[4]: *** [module_strings.h] Error 1

********************************************************
WARNING: module raw_rec failed to build, deleting
********************************************************

[ RM ]  raw_rec.o raw_rec.mo raw_rec.sym raw_rec.dep module_strings.h *.o *.d *.dep *.sym hgstamp
[ RM ]  raw2dng raw2dng.exe dng2raw dng2raw.exe
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

dfort

It looks like docutils is installed, those error messages had to do with the "--upgrade" option that you didn't really have to do. As far as your development environment not working yet---

/bin/sh: rst2html: command not found
Same problem. Did you do as I told you?
which rst2html
If that comes up empty try:
which rst2html.py
If you get:
/usr/local/bin/rst2html.py
That means you skipped one of my steps:
for f in /usr/local/bin/*.py; do ln -s $f "${f/.py/}"; done

Walter Schulz

I have to thank you, dfort! Installation on Hackintosh following your clear and detailed instructions worked like a charm. Was able to compile a1ex' latest branch (see here).

dfort

You're welcome--and thank you WalterSchulz for doing what you do.

It worked on a Hacintosh? Great! I've got some other tutorials for Windows users too.

I wanted to give something back to the ML community and since there were several requests for special builds I felt there was a need to demystify compiling. Now if someone could demystify reverse engineering....

Danne

Hey guys! I upgraded to El Capitan on my main computer and installed your fine compilation through script. Unfortunately I get the "clang" related error. I can,t really remember how I fixed it on my other computer, hmm

dfort

Maybe the compiler didn't install properly. Try running this:

brew tap homebrew/dupes; brew install gcc --use-llvm && for f in /usr/local/bin/*-5; do mv -n "$f" "${f/-5/}"; done

Danne

Tried that a few times. Too new build? Check it.

Warning: Tap homebrew/dupes already tapped.
Warning: gcc-5.3.0 already installed
mv: rename /usr/local/bin/*-5 to /usr/local/bin/*: No such file or directory


dfort

What are you trying to compile that is giving you the clang errors? Also, what exactly are those error messages trying to tell you?

Are you getting this when you enter "gcc --version"?

$ gcc --version
gcc (Homebrew gcc 5.2.0) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Oops--looks like I didn't update my system for a while, you're on gcc-5.3.0.

DeafEyeJedi

Should I not update the gcc then after all?
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

Danne

There,s that clang thingy again. I should dive in a little here.

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin15.2.0
Thread model: posix


So when trying make on mlv_dump

make mlv_dump
[ HOST_CC  ]   mlv_dump.host.o
clang: error: unknown argument: '-mno-ms-bitfields'
make: *** [mlv_dump.host.o] Error 1


Had the exact same error on mavericks before. Suppose my upgrade to El Capitan kept my problems. Solution here? Uninstall and reinstall something?

Make cr2hdr gives following

make cr2hdr
Updated HGVERSION
[ README   ]   module_strings.h
cat README.rst | grep -v -E "^:([^:])+:.+$" | rst2html --no-xml-declaration | py$//" ../html2text.py -b 700 | sed "s/



Traceback (most recent call last):
  File "/opt/local/bin/rst2html", line 17, in <module>
    from docutils.core import publish_cmdline, default_description
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docutils/core.py", line 20, in <module>
    from docutils import frontend, io, utils, readers, writers
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docutils/frontend.py", line 41, in <module>
    import docutils.utils
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docutils/utils/__init__.py", line 20, in <module>
    import docutils.io
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docutils/io.py", line 18, in <module>
    from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 47, in <module>
    locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale
    return _parse_localename(localename)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

(<type 'exceptions.SystemExit'>, SystemExit(1,), <traceback object at 0x10e4cd320>)
make: *** [module_strings.h] Error 1



make raw2dng

make raw2dng
Makefile:27: warning: overriding commands for target `raw2dng.exe'
Makefile:22: warning: ignoring old commands for target `raw2dng.exe'
[ HOST_CC  ]   raw2dng
[ HOST_CC  ]   raw2dng
clang: error: unknown argument: '-mno-ms-bitfields'
make: *** [raw2dng] Error 1






dmilligan

I prefer not to replace the clang gcc with gnu gcc. By default I think homebrew actually installs gnu gcc to something like gcc5 or maybe gcc-5 (just type gcc then hit tab twice to find out) and leaves clang gcc alone. This is a good idea. All you need to do is change your makefile.user thusly:

HOST_CC = gcc5

Danne

After hitting tab twice I get this
gcc         gcc-ar      gcc-nm      gcc-ranlib


Tried changing in the Makefile.user.default first to as suggested to HOST_CC = gcc5

and then to any of the other gcc names that entered in terminal.

make mlv_dump
[ HOST_CC  ]   mlv_dump.host.o
/bin/sh: gcc5: command not found
make: *** [mlv_dump.host.o] Error 127
Daniels-MacBook-Pro:mlv_rec Daniel$ make mlv_dump
[ HOST_CC  ]   mlv_dump.host.o
gcc-ar: Cannot find plugin 'liblto_plugin.so'
make: *** [mlv_dump.host.o] Error 1
Daniels-MacBook-Pro:mlv_rec Daniel$ make mlv_dump
[ HOST_CC  ]   mlv_dump.host.o
clang: error: unknown argument: '-mno-ms-bitfields'
make: *** [mlv_dump.host.o] Error 1
Daniels-MacBook-Pro:mlv_rec Daniel$ make mlv_dump
[ HOST_CC  ]   mlv_dump.host.o
gcc-nm: Cannot find plugin 'liblto_plugin.so'
make: *** [mlv_dump.host.o] Error 1
Daniels-MacBook-Pro:mlv_rec Daniel$ make mlv_dump
[ HOST_CC  ]   mlv_dump.host.o
gcc-ranlib: Cannot find plugin 'liblto_plugin.so'
make: *** [mlv_dump.host.o] Error 1
Daniels-MacBook-Pro:mlv_rec Daniel$



dmilligan

This:

for f in /usr/local/bin/*-5; do mv -n "$f" "${f/-5/}";

is probably not a good idea. I'm guessing the purpose of this command is to rename the homebrew gcc from gcc-5 to just gcc. It's really not a good idea to try and outsmart your package manager, things will only get screwed up worse (plus this command could potentially touch other stuff unrelated to gcc, that you didn't really wanted moved around).

My guess for what is going on here, Danne, is that you have multiple gccs on your path since homebrew is reporting it has already installed gcc. You have the clang gcc from apple, and you have the gnu gcc from homebrew, renamed from gcc-5 to just gcc. Because of your specific path order, the clang gcc is being found first. Try this:

/usr/local/bin/gcc --version


I would suggest moving the gcc executables in /usr/local/bin/ back to gcc-5, and change your Makefile.user (not Makefile.user.default) to this

HOST_CC = gcc-5


If you do this, you won't have to try and outsmart homebrew and run into these kinds of issues.

Basically you want this:

$gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin15.2.0
Thread model: posix

$gcc-5 --version
gcc (Homebrew gcc 5.3.0) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


On a clean system it should be as simple as installing gcc via homebrew the normal way, and updating Makefile.user to use gcc-5.

Danne

I got it to compile a couple of hours ago. I will put up a thorough description later. Thanks again for your help dmilligan and dfort.

Danne

First I unistalled and reinstalled gcc using brew
brew uninstall gcc
brew install gcc

Checking my /usr/local/bin and /usr/local/Cellar/gcc/5.3.0/bin/ directory it seemed ok.





Looking for gcc versions I found only
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin15.2.0
Thread model: posix


When looking for below version it found nothing
gcc-5 --version



Had to create a makefile.user since I only have makefile.user.default. Changed to HOST=gcc-5
Tried running make mlv_dump still it couldn,t find the correct gcc-5.

I asked dfort and another idea from him about my path not being correct and some commands I could try so here is what made it finally work with the new makefile.user document.

Solution

Tip from dfort. I checked my paths
echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin


Then I wrote
cat ~/.profile
Which gave me this
# MacPorts Installer addition on 2015-10-02_at_10:36:46: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.


Then I decided to fool around with a path command I use in MLP
mlv_rec Daniel$ export PATH="/usr/local/bin:$PATH" make mlv_dump
Daniels-MacBook-Pro:mlv_rec Daniel$ make mlv_dump


And finally tried this and all worked. After this it compiles and it finds the gcc-5 --version fine in terminal
Daniels-MacBook-Pro:mlv_rec Daniel$ export PATH="/usr/local/bin:$PATH" make mlv_dump
Daniels-MacBook-Pro:mlv_rec Daniel$ make mlv_dump
[ HOST_CC  ]   mlv_dump.host.o
mlv_dump.c: In function 'chroma_smooth':
mlv_dump.c:946:31: warning: passing argument 1 of 'chroma_smooth_2x2' from incompatible pointer type [-Wincompatible-pointer-types]
             chroma_smooth_2x2(aux, aux2, raw2ev, ev2raw);



Conclusion. Not finding the path to gcc-5 but somehow a path fiddling got the paths straight. This seems to have been my issue also in mavericks.
Not sure if it was the cat ~/.profile command or the export PATH="/usr/local/bin:$PATH" that fixed the issue.
Glad that I finally got it right. Thanks again guys!





dfort

Glad you got it working Danne. I've got to take another look into that hack that I've got in my setup instructions. (I'll admit it is a hack, as in an inelegant solution.) The reason I did that is because I've had too many issues with the Apple compiler and setting it up this way would also allow me compile ML without touching one line of code. I don't have much coding experience so that appealed to me. The default path for a new Mac has /usr/local/bin ahead of /usr/bin but Danne's system has that reversed and that's why the hack didn't work.

dmilligan is right when he said that it isn't a good idea. This actually bit me last night when I updated Homebrew and though it updated gcc to 5.3.0 my gcc was still pointing to 5.2.0. That's not really a big deal for someone who just wants to compile ML. Once you got a system that can compile ML there shouldn't be any need to update the development environment unless the source code is changed to require newer development tools. There is work underway that will update the ARM compiler to gcc-arm-none-eabi-4_9-2015q3, we're still using the one from 2013q4 but that hasn't been merged into the unified branch yet so don't update the ARM compiler just yet.

In any case, I'll change the setup instructions with some gcc caveats and options after I chew on it a while.


DeafEyeJedi

Am glad you got it working on your end as well ... However I decided to give it another go on my MBP and now I am back to square one with errors looking like this... Here's a portion of it.

Apples-Macintosh-10:~ DeafEyeJedi$ cd magic-lantern/platform/5D3.113/
Apples-Macintosh-10:5D3.113 DeafEyeJedi$ make clean && make zip
[ RM ]  *.o *.d autoexec autoexec.bin magiclantern magiclantern.bin
[ RM ]  5D3_113.sym magiclantern.sym
[ RM ]  magiclantern.bin autoexec autoexec.map location.map
[ RM ]  autoexec-fir autoexec-fir.bin
[ RM ]  magiclantern.lds
[ RM ]  dietlibc.a newlib-libc.a newlib-libm.a gcc-libgcc.a
[ RM ]  version.c version.bin
[ RM ]  ../../build_tools/xor_chk ../../build_tools/xor_chk.exe
[ RM dir ]  zip
[ RM ]  *.zip
../../Makefile.inc:80: remove /Users/appleuser/magic-lantern/platform/5D3.113/zip
[ RM dir ]  /Users/appleuser/magic-lantern/platform/5D3.113/zip/
mkdir -p /Users/appleuser/magic-lantern/platform/5D3.113/zip
[ CPP      ]   magiclantern.lds
[ AS       ]   entry.o
[ AS       ]   ../../platform/5D3.113/stubs.o
[ VERSION  ]   ../../platform/5D3.113/version.c
[ CC       ]   version.o
[ CC       ]   boot-hack.o
[ CC       ]   fio-ml.o
[ CC       ]   mem.o
[ CC       ]   ico.o
[ CC       ]   edmac.o
[ CC       ]   menu.o
[ CC       ]   debug.o
[ CC       ]   rand.o
[ CC       ]   posix.o
[ CC       ]   util.o
[ CC       ]   imath.o
[ CC       ]   electronic_level.o
[ CC       ]   cfn.o
[ CC       ]   gui.o
[ CC       ]   picstyle.o
[ CC       ]   exmem.o
[ CC       ]   bmp.o
[ CC       ]   rbf_font.o
[ CC       ]   config.o
[ CC       ]   stdio.o
[ CC       ]   bitrate-5d3.o
[ CC       ]   lcdsensor.o
[ CC       ]   tweaks.o
[ CC       ]   tweaks-eyefi.o
[ CC       ]   lens.o
[ CC       ]   property.o
[ CC       ]   propvalues.o
[ CC       ]   gui-common.o
[ CC       ]   chdk-gui_draw.o
[ CC       ]   movtweaks.o
[ CC       ]   menuhelp.o
[ CC       ]   menuindex.o
[ CC       ]   focus.o
[ CC       ]   notify_box.o
[ CC       ]   bootflags.o
[ CC       ]   dialog_test.o
[ CC       ]   vram.o
[ CC       ]   greenscreen.o
[ CC       ]   fps-engio.o
[ CC       ]   shoot.o
[ CC       ]   hdr.o
[ CC       ]   lv-img-engio.o
[ CC       ]   state-object.o
[ CC       ]   tasks.o
[ CC       ]   vsync-lite.o
[ CC       ]   tskmon.o
[ CC       ]   battery.o
[ CC       ]   imgconv.o
[ CC       ]   histogram.o
[ CC       ]   falsecolor.o
[ CC       ]   audio-ak.o
[ CC       ]   zebra.o
[ CC       ]   vectorscope.o
[ CC       ]   beep.o
[ CC       ]   crop-mode-hack.o
[ CC       ]   ph_info_disp.o
[ CC       ]   flexinfo.o
[ CC       ]   screenshot.o
[ CC       ]   fileprefix.o
[ CC       ]   lvinfo.o
[ CC       ]   builtin-enforcing.o
[ CC       ]   ml-cbr.o
[ CC       ]   raw.o
[ CC       ]   chdk-dng.o
[ CC       ]   edmac-memcpy.o
[ CC       ]   console.o
[ CC       ]   tcc-glue.o
make -C ../../tcc
make[1]: Nothing to be done for `all'.
[ CC       ]   module.o
[ CC       ]   video_hacks.o
[ CC       ]   afma.o
[ CC       ]   asm.o
[ AR       ]   strrchr.o
[ AR       ]   dietlibc.a
[ AR       ]   lib_a-setjmp.o
[ AR       ]   newlib-libc.a
[ CP       ]   newlib-libm.a
[ CP       ]   gcc-libgcc.a
[ LD       ]   magiclantern
[ SYMBOLS  ]   magiclantern.sym
[ CP       ]   5D3_113.sym
[ MKDIR    ]   install
[ CP       ]   install
[ VERSION  ]   ../../platform/5D3.113/version.bin
[ OBJCOPY  ]   magiclantern.bin
[ STAT     ]   magiclantern.bin
magiclantern.bin: 484288 bytes
[ CC       ]   reboot.o
[ CC       ]   disp_direct.o
[ CC       ]   font_direct.o
[ CC       ]   footer.o
[ LD       ]   autoexec

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  EXIDX          0x0764b8 0x000df8b8 0x000df8b8 0x00008 0x00008 R   0x4
  LOAD           0x000100 0x00069500 0x00069500 0x763c0 0x8a0f4 RWE 0x100
[ XOR_CHK  ]   ../../build_tools/xor_chk
[ OBJCOPY  ]   autoexec.bin
[ OBJCOPY  ]   autoexec.bin
[ XOR_CHK  ]   autoexec.bin
cp autoexec.bin /Users/appleuser/magic-lantern/platform/5D3.113/zip/
mkdir -p /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML
mkdir -p /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/fonts
mkdir -p /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/settings
mkdir -p /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/data
mkdir -p /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/cropmks
mkdir -p /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/scripts
mkdir -p /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/scripts/lib
mkdir -p /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/logs
mkdir -p /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/doc
cp ../../data/fonts/*.rbf /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/fonts/
cp ../../data/vram/*.lut /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/data/
cp ../../data/cropmks/*.bmp /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/cropmks/
cp ../../scripts/*.lua /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/scripts/
cp ../../scripts/lib/*.lua /Users/appleuser/magic-lantern/platform/5D3.113/zip/ML/scripts/lib/
make -C ../../modules

Building module raw_rec...
Updated HGVERSION
[ README   ]   module_strings.h
cat README.rst | grep -v -E "^:([^:])+:.+$" | rst2html --no-xml-declaration | py$//" ../html2text.py -b 700 | sed "s/



/bin/sh: rst2html: command not found

(<type 'exceptions.SystemExit'>, SystemExit(1,), <traceback object at 0x10f30fcf8>)
make[4]: *** [module_strings.h] Error 1

********************************************************
WARNING: module raw_rec failed to build, deleting
********************************************************

[ RM ]  raw_rec.o raw_rec.mo raw_rec.sym raw_rec.dep module_strings.h *.o *.d *.dep *.sym hgstamp
[ RM ]  raw2dng raw2dng.exe dng2raw dng2raw.exe

Building module file_man...
Updated HGVERSION
[ README   ]   module_strings.h
cat README.rst | grep -v -E "^:([^:])+:.+$" | rst2html --no-xml-declaration | py$//" ../html2text.py -b 700 | sed "s/



/bin/sh: rst2html: command not found

(<type 'exceptions.SystemExit'>, SystemExit(1,), <traceback object at 0x103a85cf8>)
make[4]: *** [module_strings.h] Error 1

********************************************************
WARNING: module file_man failed to build, deleting
********************************************************

[ RM ]  file_man.o file_man.mo file_man.sym file_man.dep module_strings.h *.o *.d *.dep *.sym hgstamp

Building module pic_view...
Updated HGVERSION
[ README   ]   module_strings.h
cat README.rst | grep -v -E "^:([^:])+:.+$" | rst2html --no-xml-declaration | py$//" ../html2text.py -b 700 | sed "s/



/bin/sh: rst2html: command not found


Yes I know it's because you're probably thinking I 'skipped' the directions on your OP but no it isn't it ... I just haven't compiled ever since I last had it working on this same MBP about a month or two ago ... so I doubt it has anything to do with me needing to update the gcc?

Sorry for being a pain in the ass, guys!
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

dfort

Quote from: DeafEyeJedi on December 19, 2015, 03:04:31 AM
/bin/sh: rst2html: command not found

Roll back to Reply #50 on: November 02, 2015:

QuoteThat is one of the most common issues--
rst2html: command not found.
Are you sure you followed all of my instructions?
Try this:
which rst2html
If you get nothing -- Did you install docutils? That's where we get rst2html.
pip install docutils
and then make soft links to all the python scripts that end in .py with:
for f in /usr/local/bin/*.py; do ln -s $f "${f/.py/}"; done


You sure you didn't mess around with the system that caused this to break?

Unlike the gcc hack, making a link from rst2html.py to rst2html is something that dmilligan recommends so I take it that this is a good idea.

dfort

I made a few changes to the Homebrew installation instructions. The biggest change is that I got rid of my ugly gcc hack. The downside is that you need to make a small modification in the Magic Lantern code.

Go into the magic-lantern directory, find the file named Makefile.user.default and make a copy named Makefile.user next open up Makefile.user with your preferred text editor and find this block of code:

#
# Host compiler settings
#
HOST_CC=$(shell which gcc)
HOST_LD=$(shell which ld)
HOST_AR=$(shell which ar)


Simply change the lines to this:

#
# Host compiler settings
#
HOST_CC=gcc-5
HOST_LD=$(shell which ld)
HOST_AR=$(shell which ar)


What if you liked the hack because you didn't have to make any changes to the ML code? There's a better way to handle it provided your system is setup so that /usr/local/bin is listed before /usr/bin in your path. To find out what's in your path do this:

echo $PATH

Mine looks like this:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

Here's the hack, make symbolic links to the gcc-5 binaries in /usr/local/bin. If you look closely you'll see that they are already symbolic links so we're making symbolic links to symbolic links. Let's say we just want to have the system default to the Homebrew gcc installation instead of the Apple Clang compiler:

ln -s /usr/local/bin/gcc-5 /usr/local/bin/gcc


Now when you enter "which gcc" in the terminal it will point to /usr/local/bin/gcc. Want to switch to the Apple Clang compiler? "brew uninstall gcc" will do it. The symbolic link no longer works and "which gcc" now points to /usr/bin/gcc. Switch back to Homebrew again? "brew install gcc" since it has already been downloaded it is a fairly quick install.

There was another slight change, the quick install script now checks to see if you already have Xcode command line tools and deals with it properly.

dfort

I recently updated from El Capitan to Sierra and came up with some errors when trying to compile Magic Lantern. The fix was simply to re-install the X-code command line tools:

xcode-select --install

dfort

Another issue with the Sierra update. Seems like some of the symlinks disappeared. I got them back by re-running this from the install script:

for f in /usr/local/bin/*.py; do ln -s $f "${f/.py/}"; done


dfort

I just realized that I haven't tested Windows in a while and found out that my cross compiler is broken. Darn it--another Sierra issue?

dfort

Ok--seems that the issues with Sierra are pretty simple to fix. Simply rerun the installation steps on the first post. When you invoke Homebrew it will see that you've already got it installed but it will also recognize that you've got Sierra and move files to a new location and change permissions. After that things seem to be working as they should. If you installed the cross compiler, rerun those installation steps too. Don't mind the messages that you've already got something installed, just go through the steps.

dfort

I've been playing around with some of the development branches of Magic Lantern. The focus branch is going to allow lua scripts to have more control over the lens.

You might these warnings when compiling the newer lua development branches:

[ LUAC     ]   syntax_check.log
/bin/sh: luac: command not found


luac will compile lua scripts into binaries. Will we be using compiled lua for faster in-camera performance? Cool. That means the lua scripts will probably have to be compiled using the ARM cross compiler but for now I thought I'd get rid of the warnings by installing luac. Simple enough, it is a part of the homebrew lua package:

brew install lua

So is someone working on compiling lua scripts?  :)