Hi again Dave,
I have moved the files to the according places
x10.runtime/src-cpp/x10/lang and x10.runtime/src-x10/x10
and I can call the constructor and functions in my test program.
But I am really stuck with the integration of the new type.
I am trying to implement the Any interface and making changes according to
the Complex type.
I keep getting large amounts of errors (that seem irrelevant) and the
following error in basic_functions.h:
error: ISO C++ forbids declaration of ‘x10_mpz’ with no type
in three different places.
Firstly in the lines:
inline x10_boolean struct_equals_inner(const x10_mpz x, const x10_mpz y) {
return x==y; }
inline x10_boolean equals_inner(const x10_mpz x, const x10_mpz y){ return
x==y; }
I checked the other basic types (eg Double) (Complex doesn't declare an
"equals" method) and added this part
@Native("c++", "::x10aux::equals(#this, #x)")
public native def equals(x:Any):Boolean;
@Native("c++", "::x10aux::equals(#this, #x)")
public native def equals(x:Mpz):Boolean;
in my Mpz.x10 file.
I suppose my type should fit in one of the templates in basic_functions.h,
probably this one:
template<class T, class U> inline x10_boolean struct_equals(T x, U y) {
return struct_equals_inner(x, y); }
but the error persists.
Also, I get the same error in line:
inline x10_int hash_code(const x10_mpz x){return hash_code((x10_ulong)x);}
Now this is a naive implementation until I get the build successful (if
ever)
Any suggestion on these would be of great help!!
last thing..
Is this line required in the .x10 file?
public type Mpz(b:Mpz) = Mpz{self==b};
Most of the types will have it, but Complex doesn't.
Regards,
Konstantina
2014-05-12 15:16 GMT+01:00 David P Grove <gro...@us.ibm.com>:
> Konstantina Panagiotopoulou <kwno...@hotmail.com> wrote on 05/09/2014
> 09:58:40 AM:
>
> >
> > I have started implementing basic functions for my GMP type but I
> > have an issue on where to place my .h and .x10 files.
> > First I added them in
>
> > x10.runtime/src-cpp/x10/lang and
> > x10.runtime/src-x10/x10 accordingly.
> > I have used proper namespaces for the .h file and added a couple of
> > lines in basic_function.h
> > When I try to build, this fails, and if I don't build it, then my
> > test program (located in x10.dist) cannot find the type.
>
> > Now, if I put everything in the x10.dist directory, I cannot refer
> > to the .h file from basic_functions.h
> > Not even using its full path.
> >
> > Any suggestions?
> >
>
>
> Hi,
>
> It should work to put the .x10 files in x10.runtime/src-x10/x10/lang and
> the .cc/.h files in x10.runtime/src-cpp/x10/lang. You will need to edit
> the Makefile in x10.runtime/src-cpp to add the corresponding .o file to
> ALL_XRCPP_OBJECTS.
>
> After doing this, you need to force at least enough of the build to
> happen so that the new .h files are copied into x10.dist/stdlib/. Probably
> the simplest thing to do is in x10.dist, do "ant clean-cpp dist-cpp"
>
> --dave
>
>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform
> available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> X10-users mailing list
> X10-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/x10-users
>
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users