Magic Lantern Forum

Developing Magic Lantern => General Development => Topic started by: xNiNELiVES on July 26, 2013, 02:53:46 AM

Title: Need help merging code, etc.
Post by: xNiNELiVES on July 26, 2013, 02:53:46 AM
I'm trying to compile a copy of a pull request (auto iso by marsu42). He said I need to prepare an auto exec.bin thats compatible with the module in order to run it.

This is what he said "I don't see a link to diff my whole pull request, so you have to pull the official ml source code through mercurial, then pull my code on top of and merge: https://bitbucket.org/Marsu42/ml-mod1/overview ... or, to keep it simpler, pull my mercurial tree which isn't far behind and compile: https://bitbucket.org/Marsu42/ml-mod1/src"

My goal is to just make this module and make it compatible with my current build of ML that I'm running. Thanks.
Title: Re: Need help merging code, etc.
Post by: Audionut on July 26, 2013, 05:42:32 AM
You only need the modules right?

https://bitbucket.org/Marsu42/ml-mod1/src/1f3a73613910162a661719d7af2583056c5ef054/modules?at=unified

Navigate to each module you need, click on the files, then right-click on the RAW option (top right) and save link as.

Check the makefiles as they don't have extensions.  Create the required folders in your source and copy the downloaded files to there.
Ugly, but it should work!
Title: Re: Need help merging code, etc.
Post by: xNiNELiVES on July 27, 2013, 12:33:58 AM
Quote from: Audionut on July 26, 2013, 05:42:32 AM
You only need the modules right?

https://bitbucket.org/Marsu42/ml-mod1/src/1f3a73613910162a661719d7af2583056c5ef054/modules?at=unified

Navigate to each module you need, click on the files, then right-click on the RAW option (top right) and save link as.

Check the makefiles as they don't have extensions.  Create the required folders in your source and copy the downloaded files to there.
Ugly, but it should work!

1) Does my source need to match my camera's source version of ML?
2) I got one module to make but for its counterpart, it gave me an error. This is what happened:

magiclantern@magiclantern-VirtualBox:~/magic-lantern/modules/m42_aiso$ make
[ CC       ]   m42_aiso.o
m42_aiso.c: In function 'm42_aiso_shoot_task_cbr':
m42_aiso.c:64:30: error: 'shooting_mode_c' undeclared (first use in this function)
m42_aiso.c:64:30: note: each undeclared identifier is reported only once for each function it appears in
m42_aiso.c: At top level:
m42_aiso.c:162:17: warning: initialized field overwritten [-Woverride-init]
m42_aiso.c:162:17: warning: (near initialization for '(anonymous)[2].help2') [-Woverride-init]
m42_aiso.c:217:1: error: expected identifier or '(' before '{' token
m42_aiso.c:217:1: error: expected identifier or '(' before '}' token
m42_aiso.c: In function 'm42_aiso_shoot_task_cbr':
m42_aiso.c:125:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [m42_aiso.o] Error 1
magiclantern@magiclantern-VirtualBox:~/magic-lantern/modules/m42_aiso$
Title: Re: Need help merging code, etc.
Post by: brapodam on July 28, 2013, 07:14:29 AM
Quote from: xNiNELiVES on July 27, 2013, 12:33:58 AM
1) Does my source need to match my camera's source version of ML?
2) I got one module to make but for its counterpart, it gave me an error. This is what happened:

magiclantern@magiclantern-VirtualBox:~/magic-lantern/modules/m42_aiso$ make
[ CC       ]   m42_aiso.o
m42_aiso.c: In function 'm42_aiso_shoot_task_cbr':
m42_aiso.c:64:30: error: 'shooting_mode_c' undeclared (first use in this function)
m42_aiso.c:64:30: note: each undeclared identifier is reported only once for each function it appears in
m42_aiso.c: At top level:
m42_aiso.c:162:17: warning: initialized field overwritten [-Woverride-init]
m42_aiso.c:162:17: warning: (near initialization for '(anonymous)[2].help2') [-Woverride-init]
m42_aiso.c:217:1: error: expected identifier or '(' before '{' token
m42_aiso.c:217:1: error: expected identifier or '(' before '}' token
m42_aiso.c: In function 'm42_aiso_shoot_task_cbr':
m42_aiso.c:125:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [m42_aiso.o] Error 1
magiclantern@magiclantern-VirtualBox:~/magic-lantern/modules/m42_aiso$

Got the same error. I've got the other modules to make but m42_aiso always has a problem.

EDIT: Oh actually the errors I get are slightly different.

If I pull the main ML source and download the Makefile and m42_aiso.c files, I get the following when trying to make the auto iso module:
Quote[ CC       ]   m42_aiso.o
m42_aiso.c: In function 'm42_aiso_shoot_task_cbr':
m42_aiso.c:60:30: error: 'shooting_mode_c' undeclared (first use in this function)
m42_aiso.c:60:30: note: each undeclared identifier is reported only once for each function it appears in
m42_aiso.c:84:26: error: expected ',' or ';' before numeric constant
m42_aiso.c:88:19: error: 'e4' undeclared (first use in this function)
m42_aiso.c:90:23: error: expected ')' before 'er'
m42_aiso.c:90:23: error: expected ')' before 'er'
m42_aiso.c:90:23: error: expected ')' before 'er'
m42_aiso.c:91:42: error: 'ref_tv4' undeclared (first use in this function)
m42_aiso.c:87:13: warning: unused variable 'e' [-Wunused-variable]
m42_aiso.c:99:47: error: expected ',' or ';' before numeric constant
m42_aiso.c:102:22: error: expected ')' before numeric constant
m42_aiso.c:102:22: error: expected ')' before numeric constant
m42_aiso.c:102:22: error: expected ')' before numeric constant
m42_aiso.c:102:22: error: expected ')' before numeric constant
m42_aiso.c:102:22: error: expected ')' before numeric constant
m42_aiso.c:102:22: error: expected ')' before numeric constant
m42_aiso.c:102:22: error: expected ')' before numeric constant
m42_aiso.c:102:22: error: expected ')' before numeric constant
m42_aiso.c:102:22: error: expected ')' before numeric constant
m42_aiso.c:108:23: error: expected ')' before 'er'
m42_aiso.c:108:23: error: expected ')' before 'er'
m42_aiso.c:108:23: error: expected ')' before 'er'
m42_aiso.c:109:43: error: 'ref_av4' undeclared (first use in this function)
m42_aiso.c:104:13: warning: unused variable 'e' [-Wunused-variable]
m42_aiso.c:117:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [m42_aiso.o] Error 1

If I pull the whole source from Marsu42's branch, I get the following instead:
Quote[ CC       ]   m42_aiso.o
m42_aiso.c:162:17: warning: initialized field overwritten [-Woverride-init]
m42_aiso.c:162:17: warning: (near initialization for '(anonymous)[2].help2') [-Woverride-init]
m42_aiso.c:217:1: error: expected identifier or '(' before '{' token
m42_aiso.c:217:1: error: expected identifier or '(' before '}' token
m42_aiso.c: In function 'm42_aiso_shoot_task_cbr':
m42_aiso.c:125:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [m42_aiso.o] Error 1
Title: Re: Need help merging code, etc.
Post by: Marsu42 on July 28, 2013, 09:42:24 PM
Quote from: brapodam on July 28, 2013, 07:14:29 AM
EDIT: Oh actually the errors I get are slightly different.

Yes, for my current modules you don't only need the directory in /modules but also all the changes to the core because there is no way to use model-specific functions in modules :-\ so when you're just trying to compile the module you're getting errors about missing functions.

Also, as just written in the other thread there was a typo in the module, sorry about that, I didn't really looked at the errors because I suspected the above situation. It's fixed now and should be able to compile my whole updated branch w/o problems including a working autoiso module.
Title: Re: Need help merging code, etc.
Post by: g3gg0 on July 28, 2013, 11:46:59 PM
Quote from: Marsu42 on July 28, 2013, 09:42:24 PMthere is no way to use model-specific functions in modules :-\

it is using name strings.
see e.g.: https://bitbucket.org/hudson/magic-lantern/src/728e571a1276d46d1ad976d58c89cf5f1f4b8eed/modules/dual_iso/dual_iso.c?at=unified
Title: Re: Need help merging code, etc.
Post by: Marsu42 on July 29, 2013, 02:01:07 AM
Quote from: g3gg0 on July 28, 2013, 11:46:59 PM
it is using name strings.
see e.g.: https://bitbucket.org/hudson/magic-lantern/src/728e571a1276d46d1ad976d58c89cf5f1f4b8eed/modules/dual_iso/dual_iso.c?at=unified

Um, could you please elaborate on that :-p for a simply magic lantern enthusiast - what are "name strings"?
Title: Re: Need help merging code, etc.
Post by: John Kesl on August 12, 2013, 06:22:48 PM
Quote from: Marsu42 on July 29, 2013, 02:01:07 AM
Um, could you please elaborate on that :-p for a simply magic lantern enthusiast - what are "name strings"?

Here's what I did. I hg clone -r unified https://bitbucket.org/hudson/magic-lantern. Remember to cd to where you want the download before you do it.
then once it's done I copy the folder in place. Example: /your folder/magic-lantern is the original clone from bitbucket.
your folder/magic-lantern2 is my working dir. as soon as I copy the folder I open terminal and cd /your folder/magic-lantern2.
if you have your source code on your computer, copy it to this folder in the appropriate places (e.g.. if your working on modules don't overwrite the whole folder just add your part. type in terminal make clean and then make, then, cd /your folder/magic-lantern/modules/your module, then type make (name of your module) minus the parentheses. if you need to see how to set up the makefile look at the other modules. I recommend sourcetree it's free from bitbucket.
If you want to combine unified and some other fork or branch. do as before and make a copy of your clone. then go to bitbucket.org/hudson/magiclantern/downloads. if you click on tags or branches you can download the source for a tag or branch in zip format. Once you do. Unzip and copy the stuff you downloaded to your copy ( this is where making a copy of the clone and using something like source tree is wonderful). once you copy the stuff you want to work on into your copied unified, make clean && make, and go nuts. If you screw something up, you can either make yourself another one by copying your original clone, or use sourcetree to revert your changes. ( the beauty of copying the clone, is a) you never mess with the "pristine" code, and it's like undo for me ( cause i'm a dumb noob at this, and sometimes i just gotta start over) you can use this method for versioning, once you've got a change that works, make clean and copy the folder, so your next working dir is /your folder/magic-lantern3.
hope it helps.
and name strings looks to be an author descriptor for the module, so when you open it on your camera your name and such is there instead of no one or, one of the dev's, I think.  :D

ALSO. In your makefile.user make sure, to turn on TCC and modules. it's at the bottom in the config section, you must turn both on TCC helps make modules and modules make you yourcamer.sym file, and that's the one that's giving you all the trouble i'd say, is, you need to make (at least as far as I understand it) your autoexec.bin and your yourcamera.sym file at the same time, the modules not so much.
Title: Re: Need help merging code, etc.
Post by: xNiNELiVES on August 12, 2013, 06:59:36 PM
I'm using a build from A.D. Should I download his source or something?
Title: Re: Need help merging code, etc.
Post by: John Kesl on August 12, 2013, 07:10:00 PM
Quote from: xNiNELiVES on August 12, 2013, 06:59:36 PM
I'm using a build from A.D. Should I download his source or something?

can u post a link and lemme look at it?
Title: Re: Need help merging code, etc.
Post by: xNiNELiVES on August 12, 2013, 07:38:21 PM
Quote from: John Kesl on August 12, 2013, 07:10:00 PM
can u post a link and lemme look at it?

https://bitbucket.org/a_d_/magic-lantern/overview
Title: Re: Need help merging code, etc.
Post by: John Kesl on August 12, 2013, 09:08:35 PM
Quote from: xNiNELiVES on August 12, 2013, 07:38:21 PM
https://bitbucket.org/a_d_/magic-lantern/overview

should be this one.
and it's the full build of unified so you should be good to go.

hg clone https://bitbucket.org/pravdomil/magic-lantern-hack

open terminal. type cd /your/folder preffered dl folder/here hit enter
type the above link and it'll clone the repository to the folder you specified with cd