Discussion:
[sword-devel] Best Windows compiler to use to make Python bindings to Sword?
rj_qgsous_sword
2014-02-24 22:33:36 UTC
Permalink
I would like to make Python bindings to Sword. From reading the
documentation that comes with Sword, I see that I need to build the
entire Sword library in order to do this. What would be the
recommended compiler to use?





I am running Windows 8.1. I don't have any experience with making
SWIG bindings, so I'm not sure whether or not I would need to use
the same version of Visual Studio that Python is compiled with
(which, for Python 2, is VC2008). If not, my guess would be that I
should use a newer version of Visual Studio, but I could also use
MinGW or anything else that works. Also, if I should use Visual Studio, would the Express edition work?





Thank you.





-- Timothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140224/cf2f99ef/attachment.html>
Greg Hellings
2014-02-25 04:00:43 UTC
Permalink
While it is possible to mix-and-match DLLs from Visual Studio with those
from MinGW or those from other compilers, it is not recommended as it
requires special work during the compiling and linking phase. It's rather
difficult. Thus, it would be easiest on you to build the bindings with the
same compiler and linker that Python is built with (and Python does not, as
yet, support building with MinGW although they are working towards that).

That said, I have no idea if Swig is compatible with Visual Studio, nor if
there is a version available for running on Windows, nor if it would
produce a DLL that would link happily on Windows against Python, nor how to
install a Python module on Windows, nor anything else related to the
building of the bindings on Windows. I am the "pumpkin holder" for the Swig
bindings, though, so if you come across any enhancement that need to be
made to the building of the Sword bindings on Windows, I'd be happy to work
with you to get it incorporated into the trunk. One thing to note - there
are currently only two ways to build the Swig bindings - through autotools
and through CMake. I have tried to build the CMake scripts such that they
will build the engine on Windows, but I don't believe I completely
succeeded from the sounds of it - the last report I heard was that it
didn't quite work. You could either tap into the existing vc++ project file
or work to update and edit the existing CMake scripts which already have
support for the Swig bindings as built-in as they can be.

Other than that, the best I can do is wish you Good Luck!

--Greg


On Mon, Feb 24, 2014 at 4:33 PM, rj_qgsous_sword <
rj_qgsous_sword at objectmail.com> wrote:

> I would like to make Python bindings to Sword. From reading the
> documentation that comes with Sword, I see that I need to build the entire
> Sword library in order to do this. What would be the recommended compiler
> to use?
>
> I am running Windows 8.1. I don't have any experience with making SWIG
> bindings, so I'm not sure whether or not I would need to use the same
> version of Visual Studio that Python is compiled with (which, for Python 2,
> is VC2008). If not, my guess would be that I should use a newer version of
> Visual Studio, but I could also use MinGW or anything else that works.
> Also, if I should use Visual Studio, would the Express edition work?
>
> Thank you.
>
> -- Timothy
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140224/b9407770/attachment.html>
Peter von Kaehne
2014-02-25 06:23:53 UTC
Permalink
On Mon, 2014-02-24 at 22:00 -0600, Greg Hellings wrote:
>
>
> That said, I have no idea if Swig is compatible with Visual Studio,
> nor if there is a version available for running on Windows, nor if it
> would produce a DLL that would link happily on Windows against Python,
> nor how to install a Python module on Windows, nor anything else
> related to the building of the bindings on Windows.

The Morgan brothers who wrote BpBible use the Swig Python bindings on
Windows. I do not know how they compile, but they will be able to help.

From what I remember the problems they had with the bindings (and raised
on the list) related always more to SWIG in general but less so to
Windows in particular.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140225/ca8846dd/attachment.sig>
Jonathan Morgan
2014-02-25 13:28:53 UTC
Permalink
Hi Timothy,

I haven't built SWORD for a few years, and don't 100% remember how to build
it.
However, in answer to your questions, I did use Visual Studio 2008 Express
Edition to build for Windows as it was always going to match best with the
standard Windows Python 2.6/2.7 build.
I think I used a modified project file based on the Visual Studio project
for C# in the bindings/swig/vstudio directory to build with.

Hope that helps!

Jon


On Tue, Feb 25, 2014 at 5:23 PM, Peter von Kaehne <refdoc at gmx.net> wrote:

> On Mon, 2014-02-24 at 22:00 -0600, Greg Hellings wrote:
> >
> >
> > That said, I have no idea if Swig is compatible with Visual Studio,
> > nor if there is a version available for running on Windows, nor if it
> > would produce a DLL that would link happily on Windows against Python,
> > nor how to install a Python module on Windows, nor anything else
> > related to the building of the bindings on Windows.
>
> The Morgan brothers who wrote BpBible use the Swig Python bindings on
> Windows. I do not know how they compile, but they will be able to help.
>
> From what I remember the problems they had with the bindings (and raised
> on the list) related always more to SWIG in general but less so to
> Windows in particular.
>
> Peter
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140226/45370976/attachment.html>
Peter Von Kaehne
2014-02-25 13:51:13 UTC
Permalink
> Von:?"Jonathan Morgan" <jonmmorgan at gmail.com>

> I haven't built SWORD for a few years,
?
?
Dear Jonathan

Just a short question - and this is a complete aside for this thread - is BpBible still maintained or not?

Also will BpBible at any time support av11n - even if there is no mapping? We have more and more modules which are av11n and not just weird and wonderful ones, but the bulk of United Bible Society and Wycliffe produced texts e.g. conforms to NRSV rather than KJV. Absence of full av11n compliance will mean that a verse in the NT is inaccessible (something in letters of John, IIRC)

I am thinking of revamping part of our application list page to ensure it is all up to date and it would be good to know

Peter
Jonathan Morgan
2014-02-25 14:04:01 UTC
Permalink
Hi Peter,

Honest answer: I don't know. More details below.

On Wed, Feb 26, 2014 at 12:51 AM, Peter Von Kaehne <refdoc at gmx.net> wrote:

> > Von: "Jonathan Morgan" <jonmmorgan at gmail.com>
>
> > I haven't built SWORD for a few years,
>
>
> Dear Jonathan
>
> Just a short question - and this is a complete aside for this thread - is
> BpBible still maintained or not?
>
> Also will BpBible at any time support av11n - even if there is no mapping?
> We have more and more modules which are av11n and not just weird and
> wonderful ones, but the bulk of United Bible Society and Wycliffe produced
> texts e.g. conforms to NRSV rather than KJV. Absence of full av11n
> compliance will mean that a verse in the NT is inaccessible (something in
> letters of John, IIRC)
>

Understood. I have been aware of the move to other versifications for a
few years now, and that has made me more certain that av11n *should* be
supported by BPBible. Unfortunately, that doesn't magic up time to work on
it :(.

I did start work on av11n early last year, but got side-lined with other
things.
I actually tried to pick it up again last weekend, but found that I had
broken my entire development environment in non-trivial ways I'll have to
work through.

Probably what I said to Greg recently sums it up: "BPBible does not support
av11n. It has been hovering very close to the top of the list for a number
of years, but is an unknown amount of work."


> I am thinking of revamping part of our application list page to ensure it
> is all up to date and it would be good to know
>

My statement would be something like:
Usable: Yes (though unfortunately with the KJV v11n only).
Maintained: Not much.
Abandoned/Dead: No (though closer to it than I would like).

Jon


>
> Peter
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140226/078c5a96/attachment.html>
rj_qgsous_sword
2014-02-25 19:24:56 UTC
Permalink
Thank you for your helpful answers. I had been attempting to use
CMake to build a Visual Studio 2008 project and make the SWIG
bindings. Now I understand why that didn't work.





Also, I now have some more questions:



@Jon You mentioned that you used the Visual Studio project for
C# in the bindings/swig/vstudio directory.. Does this mean that I
need to use Visual Studio C# instead of Visual Studio C++? I'm
somewhat confused about this, since I thought that SWIG and
Python would need Visual Studio C++ rather than C#.I am thinking that I might be switching soon from Python 2 to
Python 3. So I was also wondering if it is possible to build the
SWIG bindings for Python 3? If I understand correctly, SWIG
claims to have Python 3 support. If I were to switch to Python
3, I suppose I would then want to use Visual Studio 2010, since
that is what Python 3 is built with.


Thank you.




-- Timothy




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140225/4ca772c0/attachment-0001.html>
Jonathan Morgan
2014-02-26 02:01:17 UTC
Permalink
Hi Timothy,

On Wed, Feb 26, 2014 at 6:24 AM, rj_qgsous_sword <
rj_qgsous_sword at objectmail.com> wrote:

> Thank you for your helpful answers. I had been attempting to use CMake to
> build a Visual Studio 2008 project and make the SWIG bindings. Now I
> understand why that didn't work.
>
> Also, I now have some more questions:
>
> 1. @Jon You mentioned that you used the Visual Studio project for C#
> in the bindings/swig/vstudio directory. Does this mean that I need to use
> Visual Studio C# instead of Visual Studio C++? I'm somewhat confused about
> this, since I thought that SWIG and Python would need Visual Studio C++
> rather than C#.
>
> This is going from memory, but I think I would have modified it to work
with Python rather than C#, and I think as a result it would only have
needed VC++, not VC#.

>
> 1. I am thinking that I might be switching soon from Python 2 to
> Python 3. So I was also wondering if it is possible to build the SWIG
> bindings for Python 3? If I understand correctly, SWIG claims to have
> Python 3 support. If I were to switch to Python 3, I suppose I would then
> want to use Visual Studio 2010, since that is what Python 3 is built with.
>
> I don't know if anyone has used SWORD with Python 3. I certainly haven't.
But yes, I would always recommend using the same compiler as was used to
build the Python runtime.

Jon

> Thank you.
>
> -- Timothy
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140226/93424eef/attachment-0001.html>
Continue reading on narkive:
Loading...