On Mon, May 4, 2009 at 6:18 PM, Mark Lodato <[email protected]> wrote:
> What about using something like my script?
> http://www.mail-archive.com/[email protected]/msg04989.html
>
> I think this solution would be much cleaner - to create a *new* C file
> in addition to everything on the command line.  That way you can
> compile all your modules to object files, and then either make them
> into shared objects or compile them with the extra C file into a
> standalone.
>

Looks good, however...

* Not sure if the usage of PyMODINIT_FUNC is fine in the Windows
case... (because of the __dclspec stuff)
* In Py3K, "main()"" should be "wmain()" using wchar_t API.
* Instead of using C stdlib calls for reporting failures and exiting,
I would use Py_FatalError()

Up to now, I'm still -1, just because:

>>> import this
...
Now is better than never.
Although never is often better than *right* now.
...

Anyway, the inittab extending stuff seems the way to go...


> Mark
>
> On Mon, May 4, 2009 at 4:42 PM, Stefan Behnel <[email protected]> wrote:
>> Hi,
>>
>> I just tried to use the new main() embedding feature to compile a
>> multi-module Python program. This doesn't seem to work as expected. What I
>> would like to see is that when I say
>>
>>    $ cython --embed somemain.py other1.py other2.py ...
>>
>> Cython should generate a .c file for each .py file and add a main()
>> function only to the first module. This main() function should then
>> register all other modules that were compiled at the same run, so that the
>> resulting main program can become self-contained by simply compiling all .c
>> files into a single executable. Since this is not how it currently works
>> (instead, all .c files get their own main() function), we might want to at
>> least disable the --embed option for multiple compilation in 0.11.2, so
>> that people do not start relying on this.
>>
>> Stefan
>> _______________________________________________
>> Cython-dev mailing list
>> [email protected]
>> http://codespeak.net/mailman/listinfo/cython-dev
>>
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to