[vwnc] DLLCC typedef trouble...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] DLLCC typedef trouble...

Nicolas Cellier-3
Hi,
porting Smallapack to VW7.7 I'm experimenting some trouble...

I defined in a superclass:
CMathLibrary>>doublereal
        <C: typedef double doublereal>

(I want to call FORTRAN functions, and that's the f2c type)

Then in a subclass:
LapackLibrary>>cElementType
        "Return the type of elements"

        self subclassResponsibility

(The elementType can be single/double real/complex to get polymorphism)

Then in sub-subclass:
LapackDLibrary>>cElementType
        <C: typedef doublereal cElementType>

(The elementType of real double matrix (D) is doublereal)

To my great surprise, the later translates to a (typedef on (typedef on void *))
(inspecting LapackDLibraryDictionary)
while it is correctly a (typedef on double) in super
(inspecting LapackLibraryDictionary)

Thoughts ?

Nicolas

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] DLLCC typedef trouble...

Nicolas Cellier-3
nicolas cellier <ncellier <at> ifrance.com> writes:

>
> Hi,
> porting Smallapack to VW7.7 I'm experimenting some trouble...
>
> I defined in a superclass:
> CMathLibrary>>doublereal
> <C: typedef double doublereal>
>
> snip...
>
> Then in sub-subclass:
> LapackDLibrary>>cElementType
> <C: typedef doublereal cElementType>
>
> To my surprise, the later translates to a (typedef on (typedef on void *))
> (inspecting LapackDLibraryDictionary)
> while it is correctly a (typedef on double) in super
> (inspecting LapackLibraryDictionary)
>
> Thoughts ?
>
> Nicolas
>

Replying to myself:

I got other strange problems when running tests
(return types of external functions interpreted as void *).
I republished, unloaded all my packages, then reloaded...
...and it seems to now work correctly.

So this is most likely a transition VW76->VW77 problems for external library.

Cheers

Nicolas

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] DLLCC typedef trouble...

Terry Raymond
Nicolas

There is an old DLLCC bug that sometimes causes definitions
using a typedef to be compiled as a void. This occurs when
the use of the typedef is compiled before the typedef definition
is compiled. There have been various attempts in the past to
fix this. I don't know how well it has been "fixed" in VW 7.7.

In my project, after the package load has completed, I force
all external functions to be recompiled twice. This will not
insure that no definition will be erroneously compiled as a void,
but I have not seen any definitions that are more than 3 definitions
removed from a basic declaration so I think it is close enough.

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of nicolas cellier
> Sent: Sunday, January 24, 2010 9:37 AM
> To: [hidden email]
> Subject: Re: [vwnc] DLLCC typedef trouble...
>
> nicolas cellier <ncellier <at> ifrance.com> writes:
>
> >
> > Hi,
> > porting Smallapack to VW7.7 I'm experimenting some trouble...
> >
> > I defined in a superclass:
> > CMathLibrary>>doublereal
> > <C: typedef double doublereal>
> >
> > snip...
> >
> > Then in sub-subclass:
> > LapackDLibrary>>cElementType
> > <C: typedef doublereal cElementType>
> >
> > To my surprise, the later translates to a (typedef on (typedef on void *))
> > (inspecting LapackDLibraryDictionary)
> > while it is correctly a (typedef on double) in super
> > (inspecting LapackLibraryDictionary)
> >
> > Thoughts ?
> >
> > Nicolas
> >
>
> Replying to myself:
>
> I got other strange problems when running tests
> (return types of external functions interpreted as void *).
> I republished, unloaded all my packages, then reloaded...
> ...and it seems to now work correctly.
>
> So this is most likely a transition VW76->VW77 problems for external library.
>
> Cheers
>
> Nicolas
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc