Now Cminor is ready for compiling your projects.
On Linux you have to compile Cminor from sources.
My gcc version is rather old, but it compiles C++11 code, so it sufficies:
To install zlib from sources download zlib-1.2.11.tar.gz (or newer), extract it to some directory here called zlib-1.2.11 and change to zlib-1.2.11 directory. Then run make and then [sudo] make install:
To install boost from sources download boost_1_64_0.tar.bz2 (or newer), extract it to some directory here called boost_1_64_0 and change to boost_1_64_0 directory. At minimum you will need to install filesystem, iostreams and system libraries:
To install cmake you can either build it from sources or download a binary distribution on Linux x86_64: cmake-3.8.0-Linux-x86_64.tar.gz. To install the binary distribution, extract it to some directory here called cmake-3.8.0 and insert the cmake-3.8.0/bin directory to the PATH environment variable. Then run cmake --version to ensure it is of the right version.
LLVM and Clang must be built from sources because by default exceptions and RTTI needed by Cminor are not enabled in binary distributions as far as I know. Download LLVM: llvm-4.0.0.src.tar.xz (or newer), extract it to some directory here called llvm-4.0.0.src. Then download Clang: cfe-4.0.0.src.tar.xz (or newer), extract it to some directory here called cfe-4.0.0.src. Then move cfe-4.0.0.src directory under the llvm-4.0.0.src/tools directory under the name "clang".
Change to directory llvm-4.0.0.src and create a build directory under it. Then change to the build directory and run cmake command from there by giving it path to the llvm-4.0.0.src directory. Cminor uses exceptions and RTTI so we need to enable them by setting LLVM_ENABLE_EH and LLVM_ENABLE_RTTI variables to ON. By entering commands llc -version and clang --version we can ensure that the LLVM and Clang found are of the right versions.
To build Cminor from sources download cminor-0.2.0.tar.bz2 or cminor-0.2.0.tar.gz, and extract it to some directory here called cminor-0.2.0. Change to the cminor-0.2.0/cminor directory, run make and then [sudo] make install from there. By default executables are installed to /usr/bin and the virtual machine library to /usr/lib. You can install them to different location by setting the prefix in the install command: [sudo] make prefix=/where/to/install install.
Make a new environment variable named CMINOR_ROOT and set its value to path to the cminor-0.2.0/cminor directory. (You need to insert it to your shell script (.bashrc or equivalent) to make it permanent.) Insert /usr/lib (or your prefix/lib) directory to your LD_LIBRARY_PATH environment variable, so that the dynamic virtual machine library cminormachine.so.0.2.0 is found. Then give command "cminor" to ensure that found cminor program is of the right version.
Now that Cminor commander is working, you need to build the system library for the debug and release configurations:
Now Cminor is ready for compiling your projects.