CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
Compiling and linking with the CMSDK library

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.

Windows: Visual Studio 2022, x64

  • Build Psyclone.vs2022.sln (or CMSDK.vs2022.sln) in the x64 configurations: Release, Debug, Release SSL, Debug SSL.
  • The SSL configurations link OpenSSL 3.5.9 (LTS, supported to April 2030) as static libraries from ..\..\_libs\OpenSSL\openssl-3.5.9-vs2022\{include,release-static\lib,debug-static\lib}. tools\windows\build-openssl-3.5.9.bat in the Psyclone tree downloads, checks and builds it there (perl Configure VC-WIN64A [--debug] no-shared no-tests + nmake install_sw; needs Strawberry Perl and NASM). Both CMSDK and Psyclone define _USE_SSL_ in the SSL configurations; they must match, because several CMSDK classes change layout with it.
  • The CMSDKPY3 project expects Python 3.11 at C:\Python311; other versions and locations by editing the project file.
  • 32-bit Windows (Win32) is retired as of 16 Nov 2026. The Win32 configurations are still in the project files but are not built, tested or maintained.

Linux and macOS: make

From the top directory:

make build everything for release
make debug build everything for debug
make ssl release with SSL support (OpenSSL 3: libssl/libcrypto development files)
make ssldebug debug with SSL support
make python3 the Python 3 binding (release; "make python3 debug" for debug)
make kotlin the Kotlin DataMessage codec and its conformance tests
make clean

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.

Linking with the CMSDK library

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.

Visual Studio 2022 (Windows)

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.

Make (Linux, macOS)

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.