[Gdal-dev] OGR SWIG wrapper for Linux

Paul, Michael michael.paul at tao.es
Mon Oct 31 11:25:20 EST 2005


Hi Howard,

the C# files compile in Mono (1.1.9.2) without any problems. 
We have done a little test with the Shapelib on Linux/Mono and monoGIS and
finally we get it working without SWIG (see below). The Shapelib does not
need any additional C-based wrapper, but the SWIG wrappers of GDAL do need
this C-based wrapper. 
For the C# stuff one may catch directly the .Net assemblies generated on
Windows (called gdal_ogr_csharp.dll) and that will work in Mono. But one
still needs the native wrapper library, apart from the GDAL library, in
order to run this code in Linux (in Linux: gdal_ogr_wrap.so). It is possible
to compile the .cpp files generated by SWIG in Linux and the system is more
or less stable with this approach. But my question is if someone managed to
do the same thing and if he/she encountered some problems with this
approach.

GDAL in Linux is not a problem any more and most people are able to use the
pre-compiled binaries. The are no pre-compiled binaries yet for C# wrappers
in Linux. A configure option to automatically generate these wrappers on
build time would be fantastic, as time for being able to play around with
GDAL in Mono/Linux on different distribs will be greatly reduced. 

As far as I know SuSe Linux already ships with Mono pre-installed, at least
my own one shipped with it ;-) I think for the rest of the Linux distribs,
Mono installation also has become pretty easy.

I think you have already posted the typemap issues several times on this
list. I will check-out the latest SWIG version and we will see what we can
do on this topic.


Best Regards,
 
Michael

P.D.: bugfix to the Shapelib wrapper for .Net:
Change the following line:
public static extern string DBFReadStringAttribute (IntPtr hDBF, int iShape,
int iField);
To:
public static extern IntPtr DBFReadStringAttribute (IntPtr hDBF, int iShape,
int iField);

-----Mensaje original-----
De: Howard Butler [mailto:hobu at iastate.edu] 
Enviado el: lunes, 31 de octubre de 2005 16:38
Para: Paul, Michael; gdal-dev at lists.maptools.org
Asunto: Re: [Gdal-dev] OGR SWIG wrapper for Linux

Michael,

In theory the wrappers would work in Mono, but I have never attempted to
build them with it.  The issue about typemaps for the C# bindings still
stands.  Someone will have to step forward who is willing to do some SWIG
and has some knowledge (or is willing to learn) about the PINVOKE mechanism.
With that regard, the C# bindings are a bit immature.

Is Mono a common installation on most Linux machines yet?  I don't see any
reason why we couldn't add a configure option and a GNUMakefile to the
swig/csharp directory if someone submitted patches and can get a build setup
going.

On windows, the swig bindings build process is still manual for all
languages except Python.  If someone knows how to do compiler version
detection (vc6 vs. vc7.1 and above) and has some ideas on how to smoothly
integrate things with the rest of GDAL's build setup, that'd be great.

Howard

At 09:22 AM 10/31/2005, Paul, Michael wrote:
>Hi list,
>
>thanks to the mail of Johan Hallgren (Read/Write Oracle Spatial) I have 
>been able to compile successfuly the SWIG based C# wrappers for GDAL. 
>Thanks to the VC makefiles I do also have the SWIG generated C++ lib
>(gdal_ogr_wrap.dll) compiled on Windows. My questions:
>- does anyone have successfully compiled this wrapper library on Linux?
>- are there any plans to integrate the generation of the SWIG wrappers 
>in the GDAL build process?
>
>Best Regards,
>
>Michael
>
>_______________________________________________
>Gdal-dev mailing list
>Gdal-dev at lists.maptools.org
>http://lists.maptools.org/mailman/listinfo/gdal-dev



More information about the Gdal-dev mailing list