how to build Xapian project on windows?

Olly Betts olly at survex.com
Wed Jan 24 00:01:22 GMT 2018


On Mon, Sep 04, 2017 at 09:50:50AM +0100, Charlie Hull wrote:
> Chipping in after rather a long time away....I would advise that updating
> the nmake files will be a long and painful process if it works at all. The
> nmake method was always a hack, required lots of hoop-jumping to work around
> both Windows nmake and Visual C++ compiler idiosyncracies.

I've since dropped the nmake files from the git repo.

> If it's possible to compile Xapian for Windows using another method, do
> that.

With current git master, xapian-core can be successfully built and its
tests all pass for:

* mingw
* mingw64
* cygwin
* MSVS 2015
* MSVS 2017

Older MSVS versions likely lack the level of C++11 support we need.

I have set up CI on appveyor to help ensure these stay working:

https://ci.appveyor.com/project/ojwb/xapian

I'd encourage those interested to help extend this to cover omega,
the bindings and xapian-letor.  That's mostly a matter of figuring out
how to install the required dependencies for each platform, updating
".appveyor.yml" in the top level of the git tree, fixing any problems
this uncovers, and then submitting a patch.  If you do that as a github
PR then it ought to automatically get CI tested by appveyor.

It would also be useful to extend this to do 64-bit builds as well.
You'll probably need to disable the remote backend for that as currently
that assumes sizeof(HANDLE) <= sizeof(int).

If you're wanting to build with MSVC by hand, see ".appveyor.yml" for
the commands needed:

https://git.xapian.org/?p=xapian;a=blob;f=.appveyor.yml;h=8d5de56832084411dd8e1d9fd7c51296ce0d1e8d;hb=HEAD

tl;dr, install MSYS2 and then something like this should work to build
xapian-core from a release tarball (once the changes to get this
building appear in a release):

./configure CC="cl -nologo" CXX="compile cl -nologo" CXXFLAGS="-EHsc" AR=lib
make

Cheers,
    Olly



More information about the Xapian-discuss mailing list