QCTOOL requires the following external libraries which must be installed (with headers) before compilation:
- zlib (http://zlib.net/)
Zlib is already installed on most systems.
QCTOOL also uses the following libraries which are included in the qctool repository and don't need to be installed beforehand:
- the boost libraries (http://www.boost.org)
- sqlite3 (http://www.sqlite.org),
- the Eigen library (http://eigen.tuxfamily.org)
- the SNPHWE code from Wigginton et al (http://www.sph.umich.edu/csg/abecasis/Exact)
- the Zstandard library(http://www.zstd.net).
See the page on downloading QCTOOL for download instructions.
QCTOOL compilation is done in two parts: the
configure step, which tries to find any needed prerequisites or optionally used libraries, and the build step which compiles qctool. A basic sequence goes like this:
$ ./waf-1.5.18 configure $ ./waf-1.5.18
Note: the build process currently works best if you are using python version 2. See Issue #74 for what might happen if not.
Note: the configure step may report some libraries can't be found. That's generally ok as long as the
'configure' finished successfully message appears.
You may need to tweak the configuration step in order to successfully compile qctool. Here are some tips on this.
Setting install location: adding
--prefix to the configure step:
You can then run
./waf-1.5.18 configure --prefix=/my/favourite/path
./waf-1.5.18 installafter the build, which will copy qctool to
Specifying the compiler: A C++ compiler can be specified by setting the CXX environment variable to the configure step, e.g.
The specified compiler will be used throughout. Some components used by qctool (e.g. sqlite) use a C compiler instead; to specify that set the
CXX=/path/to/c++/compiler/g++ ./waf-1.5.18 configure
** Specifying compiler and linker flags **: To specify specific flags to be used during compilation or linking, use the
LINKFLAGS environment variables. E.g.:
CXXFLAGS="-march native" ./waf-1.5.18 configure
By default the
build step compiles all files twice - once in release mode (output in
build/release/) which are optimised builds that you should use for most tasks, and once in debug mode (output in
build/default/) which is useful if you want to run QCTOOL in a debugger. For example, you can run qctool in
gdb like so:
QCTOOL tries to give useful error messages in case of problems, but it's not perfect and the debugger can help in these situations.
$ gdb ./build/default/qctool-<version> (gdb) run
If you're still having problems compiling QCTOOL, please check for related issues on the QCTOOL issue tracker. If all else fails, please raise a new issue there.