Building the sm_calculator (SM Calculator) solution 0.0.1.1

Description of sources, structure, third-party tools, and assembling the Multi-Platform Open-Source sm_calculator (SM Calculator) solution 0.0.1.1.

Downloading the SM Calculator source files:
—————-

Source files of the sm_calculator (SM Calculator)
can be found here:
SM Calculator – 0.0.1.1
sm_calculator-0.0.1.1-Source.zip
sm_calculator-0.0.1.1-Source.tar.gz

Also, you can find source files here:
sm_calculator on GitHub

You can use the command:
git clone https://github.com/smansoft/sm_calculator.git
to get sources from the GitHub repository.

Install.txt
—————-
Here is a detailed description of the solution, sources, necessary tools, and ways, how the sm_calculator (SM Calculator) solution 0.0.1.1 can be built and tested:
Install.txt.

Third-party libraries and tools
—————-
You can find a suite of third-party libraries and tools here (SM Calculator – 0.0.1.1): cmocka, getopt, safestringlib, win_flex_bison (Install.txt). Here are:

  • win_flex_bison – windows port of Flex and Bison tools
  • getopt – library (adopted for Visual Studio) for parsing of command-line aruments
  • safestringlib – a multi-platform library, that contains API for safe control of memory and strings
  • cmocka – unit test library

You can download win_flex_bison for assembling the sm_calculator (SM Calculator) solution 0.0.1.1 on Windows and you don’t need other third-party libraries for assembling the sm_calculator (SM Calculator) solution 0.0.1.1 as they are already included in sources (/deps).

Tools necessary for assembling of the project:
—————-

Windows platform:

  • Visual Studio 2019 (including NMake tool);
  • CMake;
  • flex;
  • bison;
  • diff (optionally);
  • Python 3 (optionally);

Linux platform:

  • GCC;
  • Make tool;
  • CMake;
  • flex;
  • bison;
  • bash;
  • diff (optionally);
  • Python 3 (optionally);

Some issue of assembling on the Linux platform, using synchronized log (definition: SM_SYNC_LOG):
—————-

The sm_calculator (SM Calculator) solution 0.0.1.1 contains project log_lib, which contains the support of synchronized print (definition: SM_SYNC_LOG). As a rule, there is no necessity of usage of synchronizing print, as every log print is executed by one call of runtime the function fprintf  of synchronized C-runtime API. But there are some cases when this synchronizing can de used (Install.txt). Windows tree of sources uses standard critical section objects in synchronizing API. Linux tree of sources uses thread API, defined by C11 (ISO/IEC 9899:2011) standard, using #include <threads.h>. But not all packages of GCC contain the support of the thread API, defined by C11 (threads.h), though GCC supports the C11 standard. This problem can be resolved after updating of usage of the thread API, defined by C11 (#include <threads.h>) to the usage of the POSIX thread API (#include <pthread.h>).

Build of the sm_calculator (SM Calculator) solution 0.0.1.1 (Windows):
—————-

Here is a build screenshot, using
/_cmake/cmake_build.nmake.bat
See Install.txt for more details about the way of a build of the solution, using /_cmake/cmake_build.nmake.bat. /_cmake – means subdirectory _cmake of the root of sources of the sm_calculator (SM Calculator) solution 0.0.1.1.

Build of the sm_calculator (SM Calculator) solution 0.0.1.1 includes following steps:

  • creating of the subdirectory /_cmake/_build
  • cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE="Release" "..\.." – generating of necessary project/build files, including Makefile for the NMake tool
  • nmake clean – clean target in Makefile (generated by CMake)
  • nmake – build of the solution
  • nmake test – launching unit tests
  • cpack -G "ZIP" – generating pack archive, that contains binaries (.zip)
  • cpack -G "ZIP" --config CPackSourceConfig.cmake – generating pack archive, that contains sources (.zip)

sm_calc.win.01.jpeg

Build of the sm_calculator (SM Calculator) solution 0.0.1.1 (Linux):
—————-

Here is a build screenshot, using
/_cmake/cmake_build.sh
See Install.txt for more details about the way of a build of the solution, using /_cmake/cmake_build.sh.

Build of the sm_calculator (SM Calculator) solution 0.0.1.1 includes following steps:

  • creating of the subdirectory /_cmake/_build
  • cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" "../.."" – generating of necessary project/build files, including Makefile for the Make tool
  • make clean – clean target in Makefile (generated by CMake)
  • make all test – build of the solution and launching unit tests
  • cpack -G "TGZ" – generating pack archive, that contains binaries (.tar.gz)
  • cpack -G "TGZ" --config CPackSourceConfig.cmake – generating pack archive, that contains sources (.tar.gz)

sm_calc.lnx.01.jpeg

License.txt
—————-
Sources of the sm_calculator (SM Calculator) solution 0.0.1.1 are distributed under MIT License. Read License.txt for more information about the license.

Please, send your notes and questions to info@smansoft.com.

sm_calculator (SM Calculator) tool 0.0.1.1 ® Copyright © 2020 by SManSoft.