<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 29.05.2015 15:22, Tamas Szekeres wrote:<br>
<blockquote
cite="mid:CACALY+Tw4FocB0YxKzuum0Am=8UoZpqbcv2OrLe0B8BZtP5=Ng@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Ari,
<div><br>
</div>
<div>Which SWIG version have you been testing with?</div>
</div>
</blockquote>
<br>
Mostly with the one that's loaded by default into a new Ubuntu
(travis) / Mint (I have version 17 which is based on Ubuntu Trusty),
both are 2.0.11 I think.<br>
<br>
<blockquote
cite="mid:CACALY+Tw4FocB0YxKzuum0Am=8UoZpqbcv2OrLe0B8BZtP5=Ng@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Converting IntPtr to string doesn't seem to be a good
solution. We should do something like what we do for
ReadRaster which also use A<span
style="color:rgb(0,0,0);font-size:12.8000001907349px">ddrOfPinnedObject().
I'm trying to reproduce this.</span></div>
</div>
</blockquote>
<br>
Yes I'm sure it is not, I just used it to make it compile. It is
used only(?) by FileFromMemBuffer, which is not tested in CSharp
tests (I'm not yet testing it in Perl bindings either).<br>
<br>
Ari<br>
<br>
<blockquote
cite="mid:CACALY+Tw4FocB0YxKzuum0Am=8UoZpqbcv2OrLe0B8BZtP5=Ng@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><span style="color:rgb(0,0,0);font-size:12.8000001907349px"><br>
</span></div>
<div><span style="color:rgb(0,0,0);font-size:12.8000001907349px">Best
regards,</span></div>
<div><span style="color:rgb(0,0,0);font-size:12.8000001907349px"><br>
</span></div>
<div><span style="color:rgb(0,0,0);font-size:12.8000001907349px">Tamas</span></div>
<div><span style="color:rgb(0,0,0);font-size:12.8000001907349px"><br>
</span></div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-05-29 9:11 GMT+02:00 Ari Jolma <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:ari.jolma@gmail.com" target="_blank">ari.jolma@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> In my fork I've now
added mono-mcs into the travis test machine and "make
test" to CSharp. The build & tests all work. <br>
<br>
<a moz-do-not-send="true"
href="https://travis-ci.org/OSGeo/gdal/builds/64450000"
target="_blank">https://travis-ci.org/OSGeo/gdal/builds/64450000</a><br>
<br>
However, one fix I did for the CSharp bindings is most
probably wrong (convert return value of
handle.AddrOfPinnedObject() to char *)<br>
<br>
<a moz-do-not-send="true"
href="https://github.com/ajolma/gdal/commit/6509ef06d6f89d99c446300e4f4a63b65613911e"
target="_blank">https://github.com/ajolma/gdal/commit/6509ef06d6f89d99c446300e4f4a63b65613911e</a><br>
<br>
Tamas, do you have an idea for this?<br>
<br>
There are a lot of #if ... #endif's in for example ogr.i
to limit %feature("kwargs"), this is due to a swig bug,
which is fixed in 3.03 so we need to leave them in for
now.<br>
<br>
<a moz-do-not-send="true"
href="https://github.com/swig/swig/issues/242"
target="_blank">https://github.com/swig/swig/issues/242</a><br>
<br>
There's a lot still to do to cleanup the common interface
files but how do you feel, is there a chance that this is
accepted into the trunk (and 2.1)? I'd also love to have a
policy for developing the bindings and working test codes
for all maintained languages. A rule could be that the use
of #if ... #endif in common files needs a good
justification and commits, which do not cause test codes
to fail are ok per se.<br>
<br>
Best,<br>
<br>
Ari<span class=""><br>
<br>
<div>On 26.05.2015 13:53, Tamas Szekeres wrote:<br>
</div>
</span>
<div>
<div class="h5">
<blockquote type="cite">
<div dir="ltr">Is that a requirement that the
bindings should work well with all SWIG versions
or that the generated wrappers should work just
fine?
<div><br>
</div>
<div>Formerly I have been thinking that we should
support all versions, but it took large amount
of extra efforts to work around all incompatible
changes what SWIG introduces all the time even
with the minor releases. Regarding to SWIG C#
the earlier versions produced definitely wrong
code and I had implement quite some generic
stuff in the bindings (for example to work
around the early garbage collection issues). I
see some enhancements in the recent versions in
this regard, but I'm not sure if I can
completely remove these additions to get a
stable and consistent build.</div>
<div><br>
</div>
<div>Tamas</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-05-26 11:09
GMT+02:00 Ari Jolma <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:ari.jolma@gmail.com"
target="_blank">ari.jolma@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex"><span>26.05.2015,
11:38, Even Rouault kirjoitti:<br>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex"> Le mardi 26
mai 2015 10:13:49, Tamas Szekeres a écrit
:<br>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex"> Hi Ari,<br>
<br>
I haven't tried to compile that with
mono for quite a long time. I'll give<br>
it a try.<br>
<br>
However we did not follow the latest
changes in the SWIG implementation<br>
with the bindings, so I'd try with an
earlier version (ie. 1.3.39) to<br>
generate the wrappers.<br>
</blockquote>
I can confirm that I can compile the
CSharp bindings on Linux with SWIG 1.3.40<br>
(and run the tests), but I get the same
error as Ari with SWIG 2.0.X<br>
<br>
As far as I know, Java and Python bindings
build and run equaly well with SWIG<br>
1.3.40 or 2.0.X (although there's a Unix
makefile hack to have Python 3.2<br>
compat, conditionnaly applied with SWIG
1.3.40, that is no longer needed with<br>
SWIG 2.0.4 or later)<br>
</blockquote>
<br>
</span> Swig 1.3.39 seems questionable. Just
look at the download amounts at sourceforge.
1.3.39 one download and 1.3.40 148 downloads
per week.<br>
<br>
However, 1.3.39 does *not* put the PVINVOKE()
method twice into the PVINVOKE.cs file.<span><br>
<br>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex"> <br>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex"> May be we
should consider including the generated<br>
wrappers in gdal instead of let the
users to use different versions with<br>
different results.<br>
</blockquote>
It would be good if we could have a common
SWIG version that works for all the<br>
bindings. So currently it seems to be
1.3.40 ?<br>
<br>
Regarding putting the generated wrappers
in SVN, that's already what we do for<br>
Python. We could also just include the
generated wrappers in the tarballs.<br>
</blockquote>
<br>
</span> IMO "users" = people who use
ready-made packages. Developers and packagers
should be intelligent enough to use
development tools. I don't like the idea of
having generated files in source repositories.
I'm also of the opinion that there should be a
really good reason to use an old version of a
common tool. And at least in my Linux (Mint,
Maya - hmm, that seems already pretty old, I
should upgrade) swig 2.0.11 is the current.
But that's just me I guess.<br>
<br>
Ari<br>
<br>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex"> <br>
Even<br>
<br>
</blockquote>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>