Author Topic: Need help compiling on mac  (Read 24232 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