Cmaker and Libunistd Presented to Academy Software Foundation

Open source software leader Robin Rowe presents Linux-to-Windows porting library and cmake code generator to Motion Picture Academy and Linux Foundation

Robin Rowe with Cmaker in VC++ and gitbash

Robin Rowe with Cmaker in VC++ and gitbash

HOLLYWOOD, CA (goshrobin.com) 2022/11/30 – I gave an invited presentation to the Academy Software Foundation (ASWF) today demonstrating some useful but little known open source software projects I lead and to answer any questions about cmaker and libunistd. ASWF is a collaboration between the Motion Picture Academy and the Linux Foundation to support open source software in the motion picture and game industry. The audience for today’s meeting included technology executives from Amazon AWS, Animal Logic, Apple, Autodesk, Disney, DreamWorks Animation, Intel, Microsoft, NVIDIA, Netflix, Sony Pictures and Weta Digital.

I’m the architect and programmer of both of Cmaker and Libunistd. Open source projects not widely publicized. Free and open source with liberal MIT license. Use as you wish. Created because I needed for my open source and proprietary  C/C++ projects.

  • Cmaker: automated cmake and C++ files generator
  • Libunistd: Linux-compatible, lightweight POSIX and pthreads API on Windows

Cmaker

Cmaker (gitlab repo) is a set bash scripts that read text from code template files, replace some fields in them such as <DATE> with appropriate content, and write boilerplate CMakelists.txt, *.h, *.cpp files along with a ctest test harness for each class. If you wish to customize, Cmaker text templates may be easily modified in a text editor to any preferred format layout.

Cmaker ctest

Cmaker ctests deliberately fail by default, programmer must add valid tests for each class to pass.

 

A feature I didn’t demonstrate today, cmaker with one command can also generate a cmake recursive build system for a large legacy codebase. Great for rapidly replacing autotools, make or missing build systems.

I created cmaker becuase when creating a new cmake project, I found it annoying and error-prone copying old source files as rough boilerplate from my last project, and too much typing to write such boilerplate content from scratch.

Libunistd

Libunistd (github repo) is an API wrapper for Windows that maps POSIX/pthreads/BSD/System V *nix system calls to call into their Windows conterparts. Port Linux-style C/C++ programs to Windows rapidly. Simply set build include path to point to magic Windows headers that have the same names as unistd.h and other common Linux header files.

I originally developed libunistd in 2002 while porting CinePaint to Windows, and have continually improved it since. Using libunistd makes it much easier to maintain the same C/C++ codebase for Linux/MacOS/Windows. Another benefit of libunistd, building *nix code in Visual Studio is access to the excellent static code checker in that IDE. Detect buffer overruns and pointer issues at compile time. Great for legacy code clean-up.

Besides CinePaint, I’ve used libunistd in other systems. For example, to build a Windows version of a Linux traffic controller. Sequences U.S. traffic lights upon which lives depend, a safety-critical, real-time, Linux embedded system that’s national critical infrastructure. Although the controller would only ship with the embedded version using the DOT-certified version of gcc, I built the same code in gcc, clang and VC++. Each compiler reports slightly different warnings and errors. Achieving a clean compile in all 3 compilers, with no warnings or errors, made for better code.

About Robin Rowe

Robin Rowe

I’m Robin Rowe. People call me Robin or Rob, sometimes professor. I work in advanced product design and innovation management. AI, metaverse, robotics, safety-critical real-time systems, visual effects software for major motion pictures, animation software for a hit cartoon series and guide other engineering projects.