Author Topic: Need help compiling on mac  (Read 24239 times)

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Need help compiling on mac
« on: August 28, 2013, 07:53:28 AM »
I'm trying to build on mac. I've gotten this far. Any ideas?

  $ make
  make -C  /Users/steve/magic-lantern/platform/5D3.113
  [ VERSION  ]   ../../platform/5D3.113/version.bin
  make[1]: truncate: No such file or directory
  make[1]: *** [../../platform/5D3.113/version.bin] Error 1
  make: *** [5D3] Error 2

The only lines I've so far changed in makefile.user are

  SUPPORTED_MODELS:=5D3
  GCC_VERSION=-4.7.2
  ARM_PATH=~/yagarto/yagarto-4.7.2

My PATH contains:

  /Users/steve/yagarto/yagarto-4.7.2/bin:/Users/steve/yagarto/yagarto-4.7.2/tools:/opt/local/bin:/opt/local/sbin
Steve Falcon

kichetof

  • Contributor
  • Senior
  • *****
  • Posts: 469
  • Take a beer and enjoy it!
Re: Need help compiling
« Reply #1 on: August 28, 2013, 09:43:59 AM »
You need to install truncate ;)

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #2 on: August 28, 2013, 03:12:27 PM »
Well, sure.. Which truncate from where?
Steve Falcon

Francis

  • Hero Member
  • *****
  • Posts: 818
Re: Need help compiling on mac
« Reply #3 on: August 28, 2013, 03:29:30 PM »
I used MacPorts to install truncate. You might have to also remove the -s flag after the truncate command in makefile.src

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #4 on: August 28, 2013, 03:48:26 PM »
I installed MacPorts, but it has no truncate - not as an executable anyway.

/opt/local/bin and /opt/local/sbin are the MacPorts PATH entries.
Steve Falcon

kichetof

  • Contributor
  • Senior
  • *****
  • Posts: 469
  • Take a beer and enjoy it!
Re: Need help compiling on mac
« Reply #5 on: August 28, 2013, 03:54:41 PM »
sudo port install truncate :)

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #6 on: August 28, 2013, 04:08:39 PM »
Steve Falcon

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #7 on: August 28, 2013, 04:25:34 PM »
Getting further...

  make docq
  cd /Users/steve/magic-lantern/platform/all; make docq
  cd ../../doc && RST2LATEX=rst2latex.py python2 mkdoc.py
  /bin/sh: python2: command not found
  make[1]: *** [docq] Error 127
  make: *** [docq] Error 2

Is there a particular Python I need to install? I thought that Mac has python installed by default.
Steve Falcon

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #8 on: August 29, 2013, 12:58:59 AM »
Ok, got past that by setting in Makefile.user:

  PYTHON=python2.7

Installed montage with "sudo port install montage" but still:

  make docq
  cd /Users/steve/magic-lantern/platform/all; make docq
  cd ../../doc && RST2LATEX=rst2latex.py python2.7 mkdoc.py
  sh: montage: command not found
  make[1]: *** [docq] Error 1
  make: *** [docq] Error 2

Steve Falcon

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: Need help compiling on mac
« Reply #9 on: August 29, 2013, 10:15:54 AM »
  make docq

I never managed to build docq on Windows cygwin/msys/mingw either - rest assured, you will run into even more problems further down the road.

My advice: Ignore it, the main ml binary & modules are compiles without the doc, and if you really want to produce a complete distribution zip package use a vm like virtualbox with some stable linux like debian stable, ubuntu lts or centos so you just have to set it up once.

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Need help compiling on mac
« Reply #10 on: August 29, 2013, 12:40:01 PM »
I used VM, finally no more bugs and all my problems solved:
http://www.magiclantern.fm/forum/index.php?topic=7579.0
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #11 on: August 29, 2013, 04:57:19 PM »
My advice: Ignore it...

How? The Make fails like this:

No menuindex.txt! The "Complete user guide" menu is empty!
Run make docq to update menuindex.txt.

[ CC       ]   menuindex.o
../../src/menuindex.c:108:42: fatal error: menuindexentries.h: No such file or directory
compilation terminated.
make[1]: *** [menuindex.o] Error 1
make: *** [5D3] Error 2


Steve Falcon

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #12 on: August 29, 2013, 05:11:18 PM »
I used VM, finally no more bugs and all my problems solved:
http://www.magiclantern.fm/forum/index.php?topic=7579.0

Thanks, I'll try that route if I can't get any further.
Steve Falcon

wolf

  • Senior
  • ****
  • Posts: 263
Re: Need help compiling on mac
« Reply #13 on: August 29, 2013, 05:49:25 PM »
Where did you get your source from? Did you clone it with "hg clone -r unified https://bitbucket.org/hudson/magic-lantern" ?
Have you tried  "make 5D3" ?

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: Need help compiling on mac
« Reply #14 on: August 29, 2013, 06:14:49 PM »
How? The Make fails like this:

Yes, but you can circumvent it by compiling the core & modules expicitly:

Code: [Select]
make 60D # or whatever your camera is
cd modules
make
cd ..
mkdir -p ../dist/ml/modules
rm -f ../dist/ml/modules/*.mo
mv platform/60D.111/autoexec.bin ../dist
mv platform/60D.111/60D_111.sym ../dist/ml/modules/
mv modules/*/*.mo ../dist/ml/modules

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #15 on: August 29, 2013, 07:24:55 PM »
Where did you get your source from? Did you clone it with "hg clone -r unified https://bitbucket.org/hudson/magic-lantern" ?
Have you tried  "make 5D3" ?

Yes on both, that's when I get the error:

No menuindex.txt! The "Complete user guide" menu is empty!
Run make docq to update menuindex.txt.

[ CC       ]   menuindex.o
../../src/menuindex.c:108:42: fatal error: menuindexentries.h: No such file or directory
compilation terminated.
make[1]: *** [menuindex.o] Error 1
make: *** [5D3] Error 2
Steve Falcon

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #16 on: August 29, 2013, 07:31:12 PM »
Yes, but you can circumvent it by compiling the core & modules expicitly:

I get the 'menuindexentries.h: No such file or directory' error on the first step, e.g. "make 5D3" or "make 60D"

And yes, trying to make docq leads to a wormhole.
Steve Falcon

wolf

  • Senior
  • ****
  • Posts: 263
Re: Need help compiling on mac
« Reply #17 on: August 29, 2013, 07:32:30 PM »
do you use the cloned source code?

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #18 on: August 29, 2013, 07:41:13 PM »
Yes, if I'm understanding correctly. I'm using the code fetched with "hg clone -r unified https://bitbucket.org/hudson/magic-lantern"
Steve Falcon

wolf

  • Senior
  • ****
  • Posts: 263
Re: Need help compiling on mac
« Reply #19 on: August 29, 2013, 08:24:05 PM »
My menuindexentries.h is an empty file in my source code. You could try to add an empty file with this name to ../src/ .
And wait for the next error ;-) It looks like you dont't have it.

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #20 on: August 29, 2013, 09:10:13 PM »
Yeah, 'make clean' removes it too. Adding the empty file got me further but still no dice - lots of spew but no clear error and no bins.
Steve Falcon

Francis

  • Hero Member
  • *****
  • Posts: 818
Re: Need help compiling on mac
« Reply #21 on: August 29, 2013, 09:46:59 PM »
Yea, I had to make that file also. FYI, the command 'touch whatfileyouneed.h' will create a file of that name with no content, rather than saving an empty text doc or something like that. What is your error now?

wolf

  • Senior
  • ****
  • Posts: 263
Re: Need help compiling on mac
« Reply #22 on: August 29, 2013, 09:49:45 PM »
Quote
lots of spew but no clear error and no bins.
Can you post it?
It's important to see where the compilation fails.

There is no need to generate the doc in order to get a binary. See my output.

Code: [Select]
...
[ CC       ]   propvalues.o
[ CC       ]   gui-common.o
[ CC       ]   chdk-gui_draw.o
[ CC       ]   movtweaks.o
[ CC       ]   menuhelp.o
[ MENU IDX ]   ../../src/menuindexentries.h

No menuindex.txt! The "Complete user guide" menu is empty!
Run make docq to update menuindex.txt.

[ CC       ]   menuindex.o
[ CC       ]   af_patterns.o
[ CC       ]   focus.o
[ CC       ]   notify_box.o
[ CC       ]   bootflags.o
[ CC       ]   dialog_test.o
...

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #23 on: August 29, 2013, 10:23:38 PM »
Without making an empty menuindexentries.h I get:
Code: [Select]
make
make -C  /Users/steve/ml/magic-lantern/platform/5D3.113
[ VERSION  ]   ../../platform/5D3.113/version.bin
[ CPP      ]   magiclantern.lds
[ AS       ]   ../../platform/5D3.113/stubs.o
[ VERSION  ]   ../../platform/5D3.113/version.c
[ CC       ]   version.o
[ CC       ]   boot-hack.o
[ CC       ]   ico.o
[ CC       ]   edmac.o
[ CC       ]   menu.o
[ CC       ]   debug.o
../../src/debug.c:4596:12: warning: 'zoom_in_pressed' defined but not used [-Wunused-variable]
[ CC       ]   cfn.o
[ CC       ]   gui.o
[ CC       ]   picstyle.o
[ CC       ]   exmem.o
[ CC       ]   bmp.o
../../src/bmp.c: In function 'bmp_puts':
../../src/bmp.c:388:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
[ CC       ]   font-dyn.o
[ CC       ]   config.o
../../src/config.c: In function 'config_var_lookup':
../../src/config.c:362:5: warning: return makes pointer from integer without a cast [enabled by default]
[ CC       ]   stdio.o
[ CC       ]   bitrate-5d3.o
[ CC       ]   lcdsensor.o
[ CC       ]   tweaks.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
[ MENU IDX ]   ../../src/menuindexentries.h

No menuindex.txt! The "Complete user guide" menu is empty!
Run make docq to update menuindex.txt.

[ CC       ]   menuindex.o
../../src/menuindex.c:108:42: fatal error: menuindexentries.h: No such file or directory
compilation terminated.
make[1]: *** [menuindex.o] Error 1
make: *** [5D3] Error 2

If I create an empty menuindexentries.h I get:
Code: [Select]
make
make -C  /Users/steve/ml/magic-lantern/platform/5D3.113
[ VERSION  ]   ../../platform/5D3.113/version.bin
[ VERSION  ]   ../../platform/5D3.113/version.c
[ CC       ]   version.o
[ CC       ]   menuindex.o
[ CC       ]   focus.o
[ CC       ]   notify_box.o
[ CC       ]   dialog_test.o
[ CC       ]   vram.o
[ CC       ]   aj_port.o
[ CC       ]   fps-engio.o
[ CC       ]   shoot.o
../../src/shoot.c: In function 'display_shooting_info_lv':
../../src/shoot.c:6055:9: warning: unused variable 'audio_meters_at_top' [-Wunused-variable]
[ 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       ]   beep.o
[ CC       ]   crop-mode-hack.o
[ CC       ]   ph_info_disp.o
[ CC       ]   flexinfo.o
[ CC       ]   fileprefix.o
[ CC       ]   console.o
[ CC       ]   tcc-glue.o
../../src/tcc-glue.c: In function 'open':
../../src/tcc-glue.c:64:5: warning: passing argument 2 of 'FIO_GetFileSize' from incompatible pointer type [enabled by default]
In file included from ../../src/tcc-glue.c:9:0:
../../src/dryos.h:532:12: note: expected 'uint32_t *' but argument is of type 'unsigned int *'
../../src/tcc-glue.c: In function 'read':
../../src/tcc-glue.c:97:5: warning: passing argument 2 of 'memcpy' makes pointer from integer without a cast [enabled by default]
In file included from ../../src/tcc-glue.c:9:0:
../../src/dryos.h:549:15: note: expected 'const void *' but argument is of type 'long unsigned int'
../../src/tcc-glue.c: In function 'close':
../../src/tcc-glue.c:105:5: warning: passing argument 1 of 'free_dma_memory' makes pointer from integer without a cast [enabled by default]
In file included from ../../src/tcc-glue.c:9:0:
../../src/dryos.h:557:13: note: expected 'const void *' but argument is of type 'int'
../../src/tcc-glue.c: In function 'fputc':
../../src/tcc-glue.c:158:1: warning: number of arguments doesn't match built-in prototype [enabled by default]
make -C ../../tcc
make[2]: Nothing to be done for `all'.
[ CC       ]   module.o
../../src/module.c: In function 'module_get_symbol':
../../src/module.c:573:5: warning: return makes integer from pointer without a cast [enabled by default]
[ CC       ]   video_hacks.o
[ CC       ]   fio-5d3.o
[ CC       ]   misc.o
[ CC       ]   afma.o
../../src/afma.c: In function 'afma_auto_tune_automatic':
../../src/afma.c:362:9: warning: 'return' with a value, in function returning void [enabled by default]
[ CC       ]   raw.o
[ CC       ]   chdk-dng.o
[ CC       ]   edmac-memcpy.o
../../src/edmac-memcpy.c: In function 'edmac_memcpy_init':
../../src/edmac-memcpy.c:52:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../src/edmac-memcpy.c:56:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../src/edmac-memcpy.c:67:9: warning: passing argument 1 of 'CreateResLockEntry' from incompatible pointer type [enabled by default]
In file included from ../../src/edmac-memcpy.c:3:0:
../../src/edmac.h:73:19: note: expected 'uint32_t *' but argument is of type 'int *'
../../src/edmac-memcpy.c: In function 'edmac_memcpy_res_lock':
../../src/edmac-memcpy.c:94:9: warning: 'return' with a value, in function returning void [enabled by default]
../../src/edmac-memcpy.c: In function 'edmac_memset':
../../src/edmac-memcpy.c:208:5: warning: passing argument 1 of 'memset' makes pointer from integer without a cast [enabled by default]
In file included from ../../src/edmac-memcpy.c:2:0:
../../src/dryos.h:51:15: note: expected 'void *' but argument is of type 'long unsigned int'
../../src/edmac-memcpy.c:211:5: warning: passing argument 1 of 'edmac_copy_rectangle_adv_start' makes pointer from integer without a cast [enabled by default]
../../src/edmac-memcpy.c:107:7: note: expected 'void *' but argument is of type 'long unsigned int'
../../src/edmac-memcpy.c:211:5: warning: passing argument 2 of 'edmac_copy_rectangle_adv_start' makes pointer from integer without a cast [enabled by default]
../../src/edmac-memcpy.c:107:7: note: expected 'void *' but argument is of type 'long unsigned int'
../../src/edmac-memcpy.c:220:9: warning: passing argument 1 of 'memset' makes pointer from integer without a cast [enabled by default]
In file included from ../../src/edmac-memcpy.c:2:0:
../../src/dryos.h:51:15: note: expected 'void *' but argument is of type 'long unsigned int'
[ CC       ]   asm.o
../../src/asm.c: In function 'seems_to_be_string':
../../src/asm.c:22:15: warning: incompatible implicit declaration of built-in function 'strlen' [enabled by default]
../../src/asm.c: In function 'asm_guess_func_name_from_string':
../../src/asm.c:36:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
[ AR       ]   strrchr.o
[ AR       ]   dietlibc.a
[ AR       ]   lib_a-setjmp.o
[ AR       ]   newlib-libc.a
[ LD       ]   magiclantern
dietlibc.a(vsscanf.o): In function `vsscanf':
vsscanf.c:(.text+0x5c): warning: warning: the scanf functions add several kilobytes of bloat.
dietlibc.a(sprintf.o): In function `sprintf':
sprintf.c:(.text+0x14): warning: warning: Avoid *sprintf; use *snprintf. It is more secure.
/Users/steve/mltools/yagarto/yagarto-4.7.2/bin/../lib/gcc/arm-none-eabi/4.7.2/libgcc.a(unwind-arm.o): In function `unwind_phase2':
/Users/mfischer/Projects/yagarto/gcc-build/arm-none-eabi/libgcc/../../../gcc-4.7.2/libgcc/unwind-arm-common.inc:289: undefined reference to `abort'
/Users/steve/mltools/yagarto/yagarto-4.7.2/bin/../lib/gcc/arm-none-eabi/4.7.2/libgcc.a(unwind-arm.o): In function `__gnu_Unwind_Resume':
/Users/mfischer/Projects/yagarto/gcc-build/arm-none-eabi/libgcc/../../../gcc-4.7.2/libgcc/unwind-arm-common.inc:487: undefined reference to `abort'
/Users/mfischer/Projects/yagarto/gcc-build/arm-none-eabi/libgcc/../../../gcc-4.7.2/libgcc/unwind-arm-common.inc:505: undefined reference to `abort'
/Users/steve/mltools/yagarto/yagarto-4.7.2/bin/../lib/gcc/arm-none-eabi/4.7.2/libgcc.a(pr-support.o): In function `_Unwind_GetDataRelBase':
/Users/mfischer/Projects/yagarto/gcc-build/arm-none-eabi/libgcc/../../../gcc-4.7.2/libgcc/config/arm/pr-support.c:394: undefined reference to `abort'
/Users/steve/mltools/yagarto/yagarto-4.7.2/bin/../lib/gcc/arm-none-eabi/4.7.2/libgcc.a(pr-support.o): In function `_Unwind_GetTextRelBase':
/Users/mfischer/Projects/yagarto/gcc-build/arm-none-eabi/libgcc/../../../gcc-4.7.2/libgcc/config/arm/pr-support.c:400: undefined reference to `abort'
collect2: error: ld returned 1 exit status
make[1]: *** [magiclantern] Error 1
make: *** [5D3] Error 2
Steve Falcon


stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #25 on: August 29, 2013, 11:03:17 PM »
Hallelujah, that worked. Thanks! I was able to build core ML in a snap.

However, even though CONFIG_MODULES = y, modules don't seem to get built. I've also tried in make in /modules, but I get "make: Nothing to be done for `all'."

Here's the output for making for 5D3:

Code: [Select]
make
make -C  /Users/steve/ml/magic-lantern/platform/5D3.113
[ VERSION  ]   ../../platform/5D3.113/version.bin
[ VERSION  ]   ../../platform/5D3.113/version.c
[ CC       ]   version.o
make -C ../../tcc
make[2]: Nothing to be done for `all'.
[ LD       ]   magiclantern
dietlibc.a(vsscanf.o): In function `vsscanf':
vsscanf.c:(.text+0x5c): warning: warning: the scanf functions add several kilobytes of bloat.
dietlibc.a(sprintf.o): In function `sprintf':
sprintf.c:(.text+0x14): warning: warning: Avoid *sprintf; use *snprintf. It is more secure.
[ OBJCOPY  ]   magiclantern.bin
[ STAT     ]   magiclantern.bin
magiclantern.bin: 435000 bytes
[ CC       ]   reboot.o
[ LD       ]   autoexec

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  EXIDX          0x06a430 0x000d3830 0x000d3830 0x00008 0x00008 R   0x4
  LOAD           0x000100 0x00069500 0x00069500 0x6a338 0x7d17c RWE 0x100
[ OBJCOPY  ]   autoexec.bin
[ STAT     ]   autoexec.bin
autoexec.bin: 435584 bytes
[ SYMBOLS  ]   magiclantern.sym
[ CP       ]   5D3_113.sym
Steve Falcon

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12466
Re: Need help compiling on mac
« Reply #26 on: August 29, 2013, 11:11:08 PM »
In Makefile.modules.user, select the modules you want to build.

Mine looks like this:

ML_MODULES_DYNAMIC = raw_rec file_man pic_view ettr dual_iso adtg_gui script

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #27 on: August 29, 2013, 11:34:03 PM »
Works. Thanks so much.
Steve Falcon

mkrjf

  • Freshman
  • **
  • Posts: 53
Re: Need help compiling on mac and virtual if dev image
« Reply #28 on: September 10, 2013, 07:15:06 PM »
Does anyone have a complete documented process for building on Mac?
A few people I talked to offline said they could not get it to work.

Also - the virtu of suggestion - can someone share a virtual machine image that has successfully compiled a recent nightly? That would result in immediate zero pain access!
I mean assuming people want to share their efforts
Mike

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #29 on: September 10, 2013, 07:47:42 PM »
I'm happy to give it a shot right here and keep editing until we get it right. I went down many false paths before getting it working. I also ended up installing lots of stuff that was ultimately unnecessary, at least for my purposes. I'll be back soon with my first take.
Steve Falcon

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #30 on: September 10, 2013, 09:52:28 PM »
Here goes - stevefal's brain-dead MacOS setup:

Getting the Code:

1) Install SourceTree from http://www.sourcetreeapp.com. This lets you clone the repository locally, without learning the Mercurial source control system command line interface.
2) Get an account on BitBucket.org. This will be used when you interact with the ML repository via SourceTree.
3) Click "Clone" on https://bitbucket.org/hudson/magic-lantern, and choose 'Clone in SourceTree'. Accept the defaults, and you will have the tree at /users/<you>/magic-lantern/ (hereafter shown as .../magic-lantern/

Getting required compilers, etc:

4) Make the folder /users/<you>/mltools/, and copy http://tinyurl.com/ovzk7rp into it. This 'truncate' tool is needed by the makefile.
5) Make the folder /users/<you>/mltools/gcc/ and copy the contents of  http://tinyurl.com/p2brjme (4 folder e.g. bin, lib ) into it. This is the ARM toolchain.

Setting up your PATH to include the tools:

6) Open Terminal and enter open -a TextEdit .profile to edit your environment. Use .bash_profile instead if you are using bash.
7) Add ~mltools:~/mltools/gcc/bin:~/mltools/gcc/tools to the "PATH=" statement, if it has one. If it doesn't have one, add the following two lines:
       PATH=~mltools/:~/mltools/gcc/bin:~/mltools/gcc/tools
       export PATH

8 ) Quit Terminal completely (important)

Setting up your make files:

9 ) Copy the file .../magic-lantern/Makefile.user.default and rename to Makefile.user. This is your personal make file.
10) Edit the new .../magic-lantern/Makefile.user lines:
      ~19:          SUPPORTED_MODELS:= <your camera model>
      ~25:          ARM_PATH=~/mltools/gcc
11) Create .../magic-lantern/modules/Makefile.modules.user, with the following line to build modules you want:
      ML_MODULES_DYNAMIC = <module1> <module2>     (e.g. My line reads "ML_MODULES_DYNAMIC = raw_rec")

Building:

12) To build ML, re-open Terminal, cd to .../magic-lantern and enter make. Expect messy output. Successful building produces the following files:
       .../magic-lantern/platforms/<camera>/autoexec.bin
       .../magic-lantern/platforms/<camera>/<camera>.sym
13) To build modules, cd to .../magic-lantern/modules and enter make. Module files are in each module folder:
       .../magic-lantern/modules/<module>/<module>.mo

Comments welcome and I'll edit this to correct mistakes.
Steve Falcon

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Need help compiling on mac
« Reply #31 on: September 10, 2013, 10:27:41 PM »
you might be interested in this:

http://www.magiclantern.fm/forum/index.php?topic=8199.msg74756#msg74756

I also prefer brew, and would recommend using that to install ML build dependencies (I use it for a bunch of other stuff too). I didn't have any issues like your 12) and 13) I think b/c I used brew to install truncate, python, etc.

You'll have to modify the PATH setting in that Xcode project for your setup since you didn't use brew (Xcode does not setup the PATH from your bash profile).
I also set all the environment variables for everything that is typically in Makefile.user in the xcode build options, so that that file wouldn't be necessary, but Makefile.user.default does not check before overwriting the values, so some of them do not "stick" and you still need the Makefile.user. Maybe a dev would be willing to modify Makefile.user.default to not overwrite things if they are already defined in environment variables.

I came up with this little script that should do everything:
Code: [Select]
#!/bin/bash
cd
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
curl -OL https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q2-update/+download/gcc-arm-none-eabi-4_7-2013q2-20130614-mac.tar.bz2
bzip2 -d gcc-arm-none-eabi-4_7-2013q2-20130614-mac.tar.bz2
tar -x -f gcc-arm-none-eabi-4_7-2013q2-20130614-mac.tar
brew install hg
hg clone -b unified https://bitbucket.org/hudson/magic-lantern
brew install truncate

I may have left off something ML needs that I already had installed on my system, if so just do
Code: [Select]
brew install name_of_missing_tool

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #32 on: September 10, 2013, 11:22:19 PM »
Although my setup has the silly fixes, it doesn't depend on installing python, ruby, brew or the hg cli. I think it will work as explained on a virgin mac. Correct me if I'm wrong.

Perhaps the build could eliminate the truncate '-s' parameters if they are unnecessary, and remove the dependency on an empty menuindexentries.h file.

My initial challenge was explanations that require prior familiarity with the toolchain. I have no experience with python, ruby, brew, yagarto, gcc, macports, and any number of tools and acronyms that can pop up along the way. So once I was building, I tried to eliminate all the seeming unnecessary stuff I'd accumulated along the way. Those steps are the result.

Maybe you can write up beginner instructions for the more robust environment.
Steve Falcon

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Need help compiling on mac
« Reply #33 on: September 11, 2013, 12:07:43 AM »
Although my setup has the silly fixes, it doesn't depend on installing python, ruby, brew or the hg cli. I think it will work as explained on a virgin mac. Correct me if I'm wrong.

Yes your setup should work fine, but installing brew is so easy, and it's even scriptable, then you can script the installation of everything else. I can't really test that script b/c I don't have a "virgin" mac, but theoretically all you should have to do is install xcode from the app store and then run that script. The only thing missing is a Makefile.user, so I'll put that up on my bitbucket so that the script can download it, so now we have:
Code: [Select]
#!/bin/bash
cd
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
curl -OL https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q2-update/+download/gcc-arm-none-eabi-4_7-2013q2-20130614-mac.tar.bz2
bzip2 -d gcc-arm-none-eabi-4_7-2013q2-20130614-mac.tar.bz2
tar -x -f gcc-arm-none-eabi-4_7-2013q2-20130614-mac.tar
brew install hg
hg clone -b unified https://bitbucket.org/hudson/magic-lantern
brew install truncate
cd magic-lantern
curl -OL https://bitbucket.org/dmilligan/magic-lantern/downloads/Makefile.user
make clean
make

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Need help compiling on mac
« Reply #34 on: September 11, 2013, 12:20:48 AM »
So here's my 3 step instructions:

1) Install Xcode from the Mac App Store (free, but will require AppleID)

2) Install the command line tools from the Xcode Preferences

3) Open the Terminal and run this:
Code: [Select]
bash <(curl -L https://bitbucket.org/dmilligan/magic-lantern/downloads/SetupML.sh)

You should end up with a compiled magic lantern at the end of it.
(Assuming my script does everything right, I need some help testing it since I don't have a "virgin" system)

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #35 on: September 11, 2013, 01:43:19 AM »
I'm in the process of fresh-installing another mac, so I'll give it a try later.
Steve Falcon

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #36 on: September 11, 2013, 03:10:12 AM »
Almost made it. Choked on truncate:

...
Error: No available formula for truncate
...


...
make[1]: truncate: No such file or directory
...


Output: http://popspring.com/mldrop/installML1.rtf
Steve Falcon

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Need help compiling on mac
« Reply #37 on: September 11, 2013, 03:18:34 AM »
ah, looks like truncate is not it's own brew package but part of coreutils

try this:
Code: [Select]
brew install coreutils

if it works I'll update the script

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #38 on: September 11, 2013, 03:24:56 AM »
I did that alone, and truncate is still not found.
Steve Falcon

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Need help compiling on mac
« Reply #39 on: September 11, 2013, 03:35:56 AM »
hmmm, did brew say everything went ok? it should automatically setup your PATH for new stuff it installs

what do you get when you type this
Code: [Select]
echo $PATH

it also should have symlinks to truncate and the other stuff here:
/usr/local/opt/coreutils/libexec/gnubin

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Need help compiling on mac
« Reply #40 on: September 11, 2013, 03:43:32 AM »
I think I know what's wrong, after first installing brew I think you need to run
Code: [Select]
brew doctorand then
Code: [Select]
brew updatetry that and then install coreutils again

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #41 on: September 11, 2013, 04:28:50 AM »
falconmacmini:magic-lantern stevefal$ ECHO $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

falconmacmini:magic-lantern stevefal$ brew doctor
Your system is ready to brew.
falconmacmini:magic-lantern stevefal$ brew update
Already up-to-date.
falconmacmini:magic-lantern stevefal$ brew install coreutils
Warning: coreutils-8.21 already installed

falconmacmini:magic-lantern stevefal$ make
make -C  /Users/stevefal/magic-lantern/platform/60D.111
[ VERSION  ]   ../../platform/60D.111/version.bin
make[1]: truncate: No such file or directory
make[1]: *** [../../platform/60D.111/version.bin] Error 1
make: *** [60D] Error 2
falconmacmini:magic-lantern stevefal$
Steve Falcon

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Need help compiling on mac
« Reply #42 on: September 11, 2013, 01:11:47 PM »
Looks like brew didn't set the PATH, I thought that it should, maybe it didn't b/c brew doctor wasn't run b4 installing. I'm going to assume that's the case and fix the script as such, maybe somebody else can try it on a fresh system. You can try brew uninstall coreutils then brew install coreutils, if that still doesn't work set the path by hand. It may be the case that I have to add that to the script. I'm not at my computer so I can't test it but this should work:
Code: [Select]
export PATH="$PATH:$(brew --prefix coreutils)/libexec/gnubin"

(type that in terminal and also add to your bash profile)

I'm not 100% that the libexec/gnubin part is correct so double check those are the correct directory names.

stevefal

  • Contributor
  • Hero Member
  • *****
  • Posts: 528
Re: Need help compiling on mac
« Reply #43 on: September 24, 2013, 09:50:31 PM »
I updated my instructions to eliminate the silly fixes: http://www.magiclantern.fm/forum/index.php?topic=7936.msg74962#msg74962

I finally got the correct truncate tool, which solved all my build problems.
Steve Falcon

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Need help compiling on mac
« Reply #44 on: September 24, 2013, 10:41:33 PM »
for step 7 I would recommend doing this for the PATH in your profile (this appends to PATH rather than overwriting it, also makes it only one line):
Code: [Select]
export PATH="$PATH:~mltools/:~/mltools/gcc/bin:~/mltools/gcc/tools"

so then for step 6 you can add this line to your profile with one command via the >> pipe (rather than the command to open it with text edit, then having to manually edit it):
Code: [Select]
echo "export PATH=\"\$PATH:~mltools/:~/mltools/gcc/bin:~/mltools/gcc/tools\"" >> ~/.bash_profile

k1w1

  • New to the forum
  • *
  • Posts: 16
Re: Need help compiling on mac
« Reply #45 on: August 10, 2014, 07:15:38 AM »
I had this problem on my OSX Mavericks MacBookPro too, and solved it by installing Python and ImageMagick under MacPorts (see http://www.imagemagick.org/script/binary-releases.php#macosx and http://astrofrog.github.io/macports-python/).

I then ran into more issues (e.g. missing MnSymbols.sy fonts), and resolved this using info found at http://codealamode.blogspot.co.nz/2012/08/installing-minionpro-for-latex-on-mac.html.

I'm now a lot closer to getting a fully error-free ML 'make docq' or 'make docs' compile finished, but still have at least one more issue to fix. ("! LaTeX Error: File `titlesec.sty' not found.").

Seems that a lot more persistence than should be necessary is needed!

Part of my problem (I think) is that I haven't found a complete (-enough) description anywhere of what the detailed pre-requisites for setting up a successful dev environment are. Some authors have described what they did to get theirs going, but I'm not aware of anything that documents exactly what is assumed to be loaded/running from the outset? Anyone who knows what that is and can spare time to write it up could save other would-be devs some time to get themselves going!? Having said that, it has been an instructive, if time-consuming, way of learning!
 
EOS 7DII, EOS 70D, EF 70-200 f/2.8L USM, Sigma 150-600mm Sport zoom, EF-S 60 f/2.8 macro USM, EF-S 18-135 f/3.5-5.6 IS, EF10-20mm wide angle.

k1w1

  • New to the forum
  • *
  • Posts: 16
Re: Need help compiling on mac
« Reply #46 on: August 10, 2014, 07:20:07 AM »
Ok, got past that by setting in Makefile.user:

  PYTHON=python2.7

Installed montage with "sudo port install montage" but still:

  make docq
  cd /Users/steve/magic-lantern/platform/all; make docq
  cd ../../doc && RST2LATEX=rst2latex.py python2.7 mkdoc.py
  sh: montage: command not found
  make[1]: *** [docq] Error 1
  make: *** [docq] Error 2




I had this problem on my OSX Mavericks MacBookPro too, and solved it by installing ImageMagick and Python (see http://www.imagemagick.org/script/binary-releases.php#macosx and http://astrofrog.github.io/macports-python/).

I then ran into more issues (e.g. missing MnSymbols.sy fonts), and resolved this using info found at http://codealamode.blogspot.co.nz/2012/08/installing-minionpro-for-latex-on-mac.html.

I'm now a lot closer to getting a fully error-free ML 'make docq' or 'make docs' compile finished, but still have at least one more issue to fix. ("! LaTeX Error: File `titlesec.sty' not found.").

Seems that a lot more persistence than should be necessary is needed!

Part of my problem (I think) is that I haven't found a complete (-enough) description anywhere of what the detailed pre-requisites for setting up a successful dev environment are. Some authors have described what they did to get theirs going, but I'm not aware of anything that documents exactly what is assumed to be loaded/running from the outset? Anyone who knows what that is and can spare time to write it up could save other would-be devs some time to get themselves going!? Having said that, it has been an instructive, if time-consuming, way of learning!
EOS 7DII, EOS 70D, EF 70-200 f/2.8L USM, Sigma 150-600mm Sport zoom, EF-S 60 f/2.8 macro USM, EF-S 18-135 f/3.5-5.6 IS, EF10-20mm wide angle.