← Back to team overview

instant team mailing list archive

Re: What remains before we can release Instant 1.0 ?

 

Just thinking loudly here:


This is a declaration:

  void foo(int bar);

This is a definition:

  void foo(int bar)
  {
    cout << bar;
  }


SWIG only needs the declaration, but can take the definition as well
(just throws away the garbage).

Since additional_definitions is included together with additional_declarations
in the "non-%{}" section, additional_declarations is intended for
stuff that is only
declared for wrapping by SWIG while additional_definitions is intended for
stuff that needs to be compiled into the SWIG module _and_ wrapped by SWIG.

additional_declarations can depend on additional_definitions, but not
the other way around.

Martin



On Tue, Jan 13, 2009 at 10:33 AM, Martin Sandve Alnæs
<martinal@xxxxxxxxx> wrote:
> Definitions are also included in the %{ %} section.
> Definitions and declarations have specific meanings in C/C++,
> but I'm not sure how clear that distinction is in their use here:
>
>    interface_string = reindent("""
>        %%module  %(modulename)s
>        //%%module (directors="1") %(modulename)s
>
>        //%%feature("director");
>
>        %%{
>        #include <iostream>
>        %(additional_definitions)s
>        %(system_headers_code)s
>        %(local_headers_code)s
>        %(wrap_headers_code1)s
>        %(code)s
>        %%}
>
>        //%%feature("autodoc", "1");
>        %%init%%{
>        %(init_code)s
>        %%}
>
>        %(additional_definitions)s
>        %(additional_declarations)s
>        %(wrap_headers_code2)s
>        //%(typemaps)s
>        %(code)s;
>
>        """ % locals())
>
>
> Martin
>
>
>
> On Tue, Jan 13, 2009 at 10:17 AM, Johan Hake <hake@xxxxxxxxx> wrote:
>> On Tuesday 13 January 2009 10:10:26 Martin Sandve Alnæs wrote:
>>> There is some small stuff in the TODO file.
>>> And there are some TODO and FIXMEs in the code.
>>> This is probably overlapping.
>>> In particular, there are some old arguments
>>> that may be removed or must be explained.
>>>
>>
>> Also, what is the difference between additional_declarations and
>> additional_definitions? It seems that both gets included before the
>> main %include of the the source, in the constructoed interface file. Whould
>> it be instructive to have a pre_declaration and a a post_declaration as we
>> have both in pycc and dolfin?
>>
>> Johan
>>
>>> TODO:
>>> - Fix arguments not used in setup.py
>>>
>>> - Remove unused csrcs stuff.
>>>
>>> - Explain arrays argument.
>>>
>>> - Use object files argument.
>>>
>>> - Improve documentation
>>>
>>> - Add tests for all variants of cache mechanisms available now
>>>
>>> - Clean up imports, don't use import *
>>>
>>>
>>> martinal@martinal-xps:~/dev/fenics/instant/src/instant$ egrep FIXME *
>>> build.py:          FIXME: Describe this correctly. Tests pass arrays
>>> of arrays of strings.
>>> build.py:        instant_error("FIXME: setup.py doesn't use the C
>>> sources.") codegeneration.py:      - additional_definitions (FIXME:
>>> comment)
>>> codegeneration.py:      - additional_declarations (FIXME: comment)
>>> codegeneration.py:      - arrays (FIXME: comment)
>>> codegeneration.py:    #instant_warning("FIXME: Not using csrcs in
>>> write_setupfile().")
>>> codegeneration.py:    arrays = [] # FIXME: Example input here
>>> martinal@martinal-xps:~/dev/fenics/instant/src/instant$ egrep TODO *
>>> build.py:# TODO: Import only the official interface
>>> build.py:        # TODO: Error instead? Indicates race condition
>>> build.py:        - If you want to compile the files yourself. TODO:
>>> Not yet supported.
>>> cache.py:# TODO: We could make this an argument, but it's used
>>> indirectly several places so take care.
>>> __init__.py:# TODO: Import only the official interface
>>> inlining.py:    # TODO: Something more robust? Regexp?
>>> inlining.py:    # TODO: This isn't very general!
>>> inlining.py:    # TODO: This isn't very general!
>>> inlining.py:    # TODO: Is the second and third path here necessary?
>>> inlining.py:    # TODO: Is the second and third path here necessary?
>>>
>>>
>>> Martin
>>>
>>> On Tue, Jan 13, 2009 at 9:59 AM, Kent Andre <kent-and@xxxxxxxxx> wrote:
>>> > As always, improved documentation and better tests.
>>> > Anything else ?
>>> >
>>> > Kent
>>> >
>>> > _______________________________________________
>>> > Instant-dev mailing list
>>> > Instant-dev@xxxxxxxxxx
>>> > http://fenics.org/mailman/listinfo/instant-dev
>>>
>>> _______________________________________________
>>> Instant-dev mailing list
>>> Instant-dev@xxxxxxxxxx
>>> http://fenics.org/mailman/listinfo/instant-dev
>>
>>
>>
>


Follow ups

References