Building Xapian Library
Edit pageTo build xapian from the sources, first you’ll need to fork and clone the repository from GitHub or from Kronuz Fork. Once you have a local copy, proceed with the building process.
Requirements
Section titled “Requirements”Xapian is written in C++11 and it has the following build requirements:
- Clang or GCC
- pkg-config
- automake
- libtool
- tcl86
Dependencies
Section titled “Dependencies”The only external dependencies for building it are:
- zlib
Building process
Section titled “Building process”Get the Sources
Section titled “Get the Sources”First download and untar the xapian official distribution or clone the repository from https://github.com/xapian/xapian.git
~/ $ git clone -b master --single-branch --depth 1 \ "https://github.com/xapian/xapian.git"Prepare the Build
Section titled “Prepare the Build”~/ $ cd xapian/xapian-core~/xapian/xapian-core $ ./preautoreconf~/xapian/xapian-core $ autoreconf --force --install -Im4 -I/usr/local/share/aclocalConfigure the Build
Section titled “Configure the Build”~/xapian/xapian-core $ ./configure \ --disable-dependency-tracking \ --disable-documentation \ --enable-maintainer-mode \ --program-suffix='' \ --prefix="$([ -d '/usr/local/Cellar' ] && echo '/usr/local/Cellar/xapian/1.5' || echo '/usr/local')" \ CXXFLAGS="-O3 -DFLINTLOCK_USE_FLOCK $CXXFLAGS" \ LDFLAGS="-O3 $LDFLAGS"Build, Test and Install
Section titled “Build, Test and Install”~/xapian/xapian-core $ make~/xapian/xapian-core $ make check~/xapian/xapian-core $ make installDebug mode
Section titled “Debug mode”~/xapian/xapian-core $ ./configure \ --disable-dependency-tracking \ --disable-documentation \ --enable-maintainer-mode \ --enable-assertions \ --program-suffix="" \ --prefix="$([ -d '/usr/local/Cellar' ] && echo '/usr/local/Cellar/xapian/1.5' || echo '/usr/local')" \ CXXFLAGS="-O3 -g -DFLINTLOCK_USE_FLOCK $CXXFLAGS" \ LDFLAGS="-O3 -g $LDFLAGS"Address Sanitizer (ASAN)
Section titled “Address Sanitizer (ASAN)”~/xapian/xapian-core $ ./configure \ --disable-dependency-tracking \ --disable-documentation \ --enable-maintainer-mode \ --enable-assertions \ --program-suffix="" \ --prefix="$([ -d '/usr/local/Cellar' ] && echo '/usr/local/Cellar/xapian/1.5-asan' || echo '/usr/local')" \ CXXFLAGS="-O3 -g -fno-omit-frame-pointer -fsanitize=address -DFLINTLOCK_USE_FLOCK $CXXFLAGS" \ LDFLAGS="-O3 -g -fno-omit-frame-pointer -fsanitize=address $LDFLAGS"UndefinedBehavior Sanitizer (ASAN + UBSAN)
Section titled “UndefinedBehavior Sanitizer (ASAN + UBSAN)”~/xapian/xapian-core $ ./configure \ --disable-dependency-tracking \ --disable-documentation \ --enable-maintainer-mode \ --enable-assertions \ --program-suffix="" \ --prefix="$([ -d '/usr/local/Cellar' ] && echo '/usr/local/Cellar/xapian/1.5-ubsan' || echo '/usr/local')" \ CXXFLAGS="-O3 -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all -DFLINTLOCK_USE_FLOCK $CXXFLAGS" \ LDFLAGS="-O3 -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all $LDFLAGS"Memory Sanitizer (MSAN)
Section titled “Memory Sanitizer (MSAN)”~/xapian/xapian-core $ ./configure \ --disable-dependency-tracking \ --disable-documentation \ --enable-maintainer-mode \ --enable-assertions \ --program-suffix="" \ --prefix="$([ -d '/usr/local/Cellar' ] && echo '/usr/local/Cellar/xapian/1.5-msan' || echo '/usr/local')" \ CXXFLAGS="-O3 -g -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins -DFLINTLOCK_USE_FLOCK $CXXFLAGS" \ LDFLAGS="-O3 -g -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins $LDFLAGS"Thread Sanitizer (TSAN)
Section titled “Thread Sanitizer (TSAN)”~/xapian/xapian-core $ ./configure \ --disable-dependency-tracking \ --disable-documentation \ --enable-maintainer-mode \ --enable-assertions \ --program-suffix="" \ --prefix="$([ -d '/usr/local/Cellar' ] && echo '/usr/local/Cellar/xapian/1.5-tsan' || echo '/usr/local')" \ CXXFLAGS="-O3 -g -fno-omit-frame-pointer -fsanitize=thread -DFLINTLOCK_USE_FLOCK $CXXFLAGS" \ LDFLAGS="-O3 -g -fno-omit-frame-pointer -fsanitize=thread $LDFLAGS"