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 speed up numerically intensive parts of the core |
SPIRIT_USE_OPENMP | Use OpenMP to speed up numerically intensive parts of the core |
SPIRIT_SCALAR_TYPE | Should be e.g. double or float . Sets the C++ type for scalar variables, arrays etc. |
SPIRIT_BUILD_TEST | Build unit tests for the core library |
SPIRIT_BUILD_FOR_CXX | Build the static library for C++ applications |
SPIRIT_BUILD_FOR_JULIA | Build the shared library for Julia |
SPIRIT_BUILD_FOR_PYTHON | Build the shared library for Python |
SPIRIT_BUILD_FOR_JS | Build the JavaScript library (uses a different toolchain!) |
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 | Build the shared library for python |
CORE_BUILD_TEST | Will build python unit tests if the shared lib for python is built |
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 |