|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
CMSDK is the core library providing OS dependent functionality and lots and lots of the base code. It builds on Windows x64 (Visual Studio 2022), Linux and macOS.
The kotlin/ directory holds the Kotlin/JVM DataMessage codec for Android apps and JVM tools (no C++ needed at runtime). Build and test it with make kotlin (Linux/macOS, JDK 17+); it regenerates its reference data from the C++ library first. See kotlin/README.md.
The CMSDKPY3 project (Windows) and make python3 (Linux, macOS) build the SWIG binding that gives Python 3 programs and Python cranks access to CMSDK. Python 2 (CMSDKPY2, make python2) is end-of-life and kept only as legacy.
From the top directory:
Run make clean when switching between release, debug and SSL builds, and after updating the library: the Makefiles do not track header dependencies, and shared-memory struct layouts must match across every binary in a running system (see Going Deeper). Build the Python binding with the same SSL setting as the library (make ssl python3), because some classes change layout with _USE_SSL_.
OpenSSL is found with pkg-config, else (macOS) Homebrew's openssl@3. The Python 3 headers and library are those of the python3 on your path (sysconfig); edit Makefile.sys for other locations.
To link a third-party source project with the CMSDK library one needs to add the CMSDK binary library files to your project and include the appropriate header files needed. Depending on which additional libraries you may need (such as SSL) you may need to link to these as well.
The easiest way to set up a project to use CMSDK is to look at the Psyclone project as it does this already.
The project needs to link with the CMSDK library of the same configuration from CMSDK/lib/x64: CMSDK2022.lib (Release), CMSDKDebug2022.lib (Debug), and the SSL builds with SSL in their names (CMSDKSSL2022.lib, CMSDKSSLDebug2022.lib, plus the OpenSSL 3.5.9 static libraries, crypt32.lib and ws2_32.lib).
The include header files are located in CMSDK/include.
Lastly, the project needs to be compiled with the code generation flag / runtime library Multi-threaded DLL.
The easiest way to set up a project to use CMSDK is to look at the Examples project or Examples/Makefile as they do this already.
Link with the static library CMSDK/lib/<arch>/libCMSDK.a (debug builds: libCMSDKDebug.a), where <arch> is linux64 or macosx64, and with -pthread -ldl -lrt on Linux; add -lssl -lcrypto when the library was built with make ssl. Include Makefile.sys to get the same compiler flags. CMSDK classes live in namespace cmlabs.
The include header files are located in CMSDK/include.