Building the KQP library

We assume that there are two directories:
- $KQP_SRCDIR that contains the sources
- $KQP_BUILDDIR that will contain the compiled code

Pre-requisites

Options

The following options can be given to the initial cmake command

Working with KQP

To build an optimized version of the library

cd $KQP_BUILDDIR
cmake [options] $KQP_SRCDIR
make kqp run-tests 

Building for C++

If all the tests pass, then you can type
make install
to install the library

Building with JAVA (with maven)

If you have maven, just type
make kqp_jni_maven

This will build kqp, the jar and nar packages, and install them in your local repository. You can then start to code in Java by adding (and adapting) the following in you pom.xml file:

<project ...>
    ...
    <pluginRepositories>
        <pluginRepository>
            <id>duns</id>
            <name>Duns nar plugin repository</name>
            <url>http://duns.github.com/maven-snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
    ...
    <build>
        <plugins>
            <!-- NAR plugin -->
            <plugin>
                <artifactId>maven-nar-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <classifiers>
                        <!--<classifier>x86-Windows-msvc</classifier>-->
                        <classifier>x86_64-MacOSX-g++</classifier>
                        <!--<classifier>i386-Linux-g++</classifier>-->
                    </classifiers>
                </configuration>

                <executions>
                    <execution>
                        <goals>
                            <goal>nar-download</goal>
                            <goal>nar-unpack</goal>
                            <!--<goal>nar-assembly</goal>-->
                        </goals>
                    </execution>
                </executions>
            </plugin>
        ...
        </plugins>
        ...
    </build>
    ...
    <dependencies>
        <!-- Kernel Quantum Library -->
        <dependency>
            <groupId>net.bpiwowar</groupId>
            <artifactId>kqp</artifactId>
            <version>1.0.0</version>
            <type>nar</type>
        </dependency>
        ...
    </dependencies>
</project>

Working with Python

make _kqp_python

Note that when configuring the build with cmake, in order to force the use of a given Python version, you might need to to set the variables: PYTHON_EXECUTABLE, PYTHON_INCLUDE_DIR and PYTHON_LIBRARY.

Developping KQP

If you want to contribute to the development of the library, you should follow these steps:

cd $KQP_BUILDIR
cmake -DCMAKE_BUILD_TYPE=Debug $KQP_SRCDIR
cmake -DCMAKE_XCODE_ATTRIBUTE_GCC_VERSION=com.apple.compilers.llvm.clang.1_0 -GXcode $KQP_SRCDIR
CC=PATH_TO_CC CXX=PATH_TO_CXX cmake -DCMAKE_BUILD_TYPE=Debug $KQP_SRCDIR