Hi,
I'm a total scheme novice so apologies in advance for dumb questions, but can anyone give me any advice on adding multiple Gambit generated C files to a (XCode) project?
I'm generating the files with 'gsc -link filename.scm', but in the setup code within the app I can only specify one module to the ___setup_params_struct passed to the setup call to Gambit. The functions from the other modules linked in are unavailable. What I'd like to do is be able to generate multiple C files and then have access to all the functions define in them from the app.
i.e. the code in my app that initiates Gambit looks like the standard....
___setup_params_reset (&setup_params); setup_params.version = ___VERSION; setup_params.linker = LINKER; // <------- Can only specify one module here setup_params.debug_settings = debug_settings;
___setup(&setup_params);
What I'm actually I'm trying to do is compile Meroon in to my app. I've been developing interactively using Swank with Meroon 'included' in to it at the start of every session, but the app is running too slow (spending all it's time calling eval) so I'm trying to compile it. I can load Meroon into an interactive gsi according to Bradley Lucier's instructions and then generate a _meroon.c file, but have no way to build it into my app. Any advice on achieving that or something equivalent will be most welcome.
Roger.
Afficher les réponses par date
Hallo,
i.e. the code in my app that initiates Gambit looks like the standard....
___setup_params_reset (&setup_params); setup_params.version = ___VERSION; setup_params.linker = LINKER; // <------- Can only specify one module here setup_params.debug_settings = debug_settings;
___setup(&setup_params);
You must call gsc with all your modules on the command line:
$ gsc -link mod1.scm mod2.scm mod3.scm ... master.scm
and then you only need to "link" with the master module in your C code.
Cheers,
On Thu, Jul 7, 2011 at 1:07 PM, Alex Queiroz asandroq@gmail.com wrote:
Hallo,
i.e. the code in my app that initiates Gambit looks like the standard....
___setup_params_reset (&setup_params); setup_params.version = ___VERSION; setup_params.linker = LINKER; // <------- Can only specify one
module
here setup_params.debug_settings = debug_settings;
___setup(&setup_params);
You must call gsc with all your modules on the command line:
$ gsc -link mod1.scm mod2.scm mod3.scm ... master.scm
and then you only need to "link" with the master module in your C code.
Cheers,
Hi,
Thanks, that was the answer I was looking for. However, in my case unfortunately it doesn't help as I can't get $ gsc -link "_meroon.scm" to generate code. I run Bradley Lucier's make_maroon, which basically concatenates all the Meroon scm files together into _meroon.scm, and then when I try $ gsc -link "_meroon.scm" I get
*** ERROR IN feature-present? -- Unbound variable: *meroon-features*
I suspect this is because of the way Meroon bootstraps itself.
The only way I've been able to generate C code from Meroon is..
$ gsc (load "old-load.scm") (old-load "pre_meroon.scm") (compile-file-to-c "_meroon.scm") (link-incremental '('"meroon"))
That generates _meroon.c and _meroon_.c which leads me to the original problem above. I've no idea if the C files generated that way do what I want though, as I've not been able to run any of the code in them.
Any ideas where I go from here?
Roger.
Hallo,
On Thu, Jul 7, 2011 at 2:53 PM, Roger Wilson misterrogerwilson@gmail.com wrote:
The only way I've been able to generate C code from Meroon is..
$ gsc (load "old-load.scm") (old-load "pre_meroon.scm") (compile-file-to-c "_meroon.scm") (link-incremental '('"meroon"))
That generates _meroon.c and _meroon_.c which leads me to the original problem above. I've no idea if the C files generated that way do what I want though, as I've not been able to run any of the code in them.
The file with the "_.c" at the end is the link file and internal to the Gambit-C linking process. So the name of your module is "_meroon".
Cheers,