-
Notifications
You must be signed in to change notification settings - Fork 10
API: C API: Compilation And Linking
Samuel Li edited this page Oct 7, 2023
·
2 revisions
SPERR is written in C++, so its C++ API should be used when other C++ projects want to integrate SPERR. However, a C API is easier to integrate with projects in other programming languages, for example, C, Fortran, and Python. As a result, SPERR provides a C API as well.
This is a 3-step process:
- SPERR can be compiled as usual, and it should be configured to:
- with option
BUILD_SHARED_LIBS=ON
to produce a dynamic library, and - install to a custom destination by specifying the
CMAKE_INSTALL_PREFIX
field of CMake.
- with option
- When compiling your project, you should include header
SPERR_C_API.h
which provides a set of C functions. - Finally, your project should be dynamically linked against
libSPERR.so
(orlibSPERR.dylib
) to make use of SPERR compression.
This example Makefile demonstrates this usage.
Lossy Scientific data compression with SPERR