BUILD THE SPIRIT LIBRARY¶
C/C++ Library¶
Dependencies | Versions |
---|---|
gcc | >= 5.1 (C++11 stdlib) or any modern compiler |
CMake | >= 3.1 |
This is pretty much a standalone library and should be easy to implement
into existing projects in which CMake is already used. It can be built
as shared or static and API headers are located in
path/to/Spirit/core/include/Spirit
CMake Options | Use |
---|---|
SPIRIT_USE_CUDA | Use CUDA to spee d up nume rica lly inte nsiv e part s of the core |
SPIRIT_USE_OPENMP | Use Open MP to spee d up nume rica lly inte nsiv e part s of the core |
SPIRIT_SCALAR_TYPE | Shou ld be e.g. ``do uble `` or ``fl oat` `. Sets the C++ type for scal ar vari able s, arra ys etc. |
SPIRIT_BUILD_TEST | Buil d unit test s for the core libr ary |
SPIRIT_BUILD_FOR_CXX | Buil d the stat ic libr ary for C++ appl icat ions |
SPIRIT_BUILD_FOR_JULI A | Buil d the shar ed libr ary for Juli a |
SPIRIT_BUILD_FOR_PYTH ON | Buil d the shar ed libr ary for Pyth on |
SPIRIT_BUILD_FOR_JS | Buil d the Java Scri pt libr ary (use s a diff eren t tool chai n!) |
Note that the CMake Options for the core library are also set in the root CMakeLists.txt.
Integrating into other CMake Projects¶
This is currently untested, but you should be able to use Spirit
either via ExternalProject
or AddSubdirectory
. You should thus
be able to simply copy the core
directory as Spirit
into the
thirdparty folder of your Project and use it as is done commonly.
Note that setting qhull_LIBS
and qhull_INCLUDE_DIRS
if qhull is
present on your disk removes the need for Spirit to clone and build it
separately.
A set of CMake variables is pushed to the parent scope by the core CMakeLists. These include: - SPIRIT_LIBRARIES - SPIRIT_LIBRARIES_STATIC - SPIRIT_INCLUDE_DIRS
Unit Tests¶
Dependencies | Versions |
---|---|
gcc | >= 4.8.1 (C++11 stdlib) or any modern compiler |
CMake | >= 2.8.12 |
Python | >= 2.7 or >= 3.5 (for the python tests) |
The core library includes a set of unit tests in order to make sure
certain conditions are fulfilled by the librarys functions. We use
CMake
s CTest
for unit testing. You can run
cd build && ctest --output-on-failure && cd ..
or execute any of the test executables manually. To execute the tests
from the Visual Studio IDE, simply rebuild the RUN_TESTS
project.
CMake Options | Use |
---|---|
CORE_BUILD_TEST | Build unit tests for the core library |
BUILD_UI_PYTHON | Python tests are only built if this is ON |
Python Package¶
Dependencies | Versions |
---|---|
Python | >= 2.7 or >= 3.5 |
CMake Options | Use |
---|---|
BUILD_UI_PYTHON | Buil d the shar ed libr ary for pyth on |
CORE_BUILD_TEST | Will buil d pyth on unit test s if the shar ed lib for pyth on is buil t |
You may use the python package simply by adding a
path/to/Spirit/core/python
to your PYTHONPATH.
To build a proper python package including binary wheel, you need to build the shared library for Python and then execute
cd path/to/Spirit/core/python
python setup.py sdist bdist_wheel
The resulting package can then be installed with e.g.
pip install -e /path/to/package/dist/spirit-<tags>.whl
Julia Package¶
These bindings are currently completely experimental. However, it seems it would be easy to create Julia bindings analogous to the Python Bindings.
Dependencies | Versions |
---|---|
None |
CMake Options | Use |
---|---|
BUILD_UI_JULIA | Build the shared library for julia |