Installation

1 Installation on Windows
    1.1 Prerequisites
    1.2 Cmajor installation
    1.3 LLVM installation
    1.4 Mingw-w64 installation
    1.5 System library compilation
    1.6 Optional: Installing Cmajor Visual Studio extension
    1.7 Uninstalling Cmajor
2 Installation on Linux
    2.1 Installing LLVM and Clang version 11.0.0
    2.2 Installation on x86_64 Ubuntu Linux 20.04 using prebuilt binaries
    2.3 Installation from sources
    2.4 Installation on x86_64 Ubuntu Linux 20.04 running on Windows Subsystem for Linux

1 Installation on Windows

1.1 Prerequisites

1.2 Cmajor installation

Note: If you have a previous Cmajor version installed, you should uninstall it before installing this version. Also in this case check also from the task manager, if you have "cmpms" process running. If you have, you should stop it before running the installation. The "cmpms" process is the Cmajor port map server that is normally left running when cmcode IDE has been run.

Download the setup program and run it. You can specify installation directory that is by default C:\cmajor. Note: the compiler needs write access to installation directory and its subdirectories, so C:\Program Files\ is not a good place to install. The setup creates an environment variable CMAJOR_ROOT that points to the installation directory and adds the CMAJOR_ROOT\bin directory to PATH. The setup adds a shortcut to the Cmajor Code (IDE) to the desktop. The CMAJOR_ROOT environment variable is used by the Cmajor tools to locate Cmajor Unicode database and system library source and binary files.

The 'Containing directory' is a directory that will contain the installation directory. You can change it by clicking the '...' button on the right and selecting a directory from a folder dialog, or by typing a directory path to the 'Containing directory' text box. The installation directory is changed appropriately when changing the containing directory. The name of the installation directory is by default 'cmajor' but can be changed to any name.

Important: After the installer has been run, you should install prerequisites (LLVM and Mingw-w64) if you have not done so yet and then compile the system libraries (System library compilation).

1.3 LLVM installation

1.4 Mingw-w64 installation

1.5 System library compilation

The system library must be compiled using the Cmajor C++ backend compiler, cppcmc, before user program compilations can succeed.
Here's how to do this:

Now the system is ready for compiling user programs.

1.6 Optional: Installing Cmajor Visual Studio extension

It's assumed that you have a working Visual Studio version installed.

1.6.1 Step 1: Installing Visual Studio extension

1.6.2 Step 2: Installing Cmajor project system files

1.6.3 Tour of Cmajor Visual Studio extension

Here's a tour of features of the extension.

1.6.4 Uninstalling Cmajor Visual Studio extension

1.7 Uninstalling Cmajor

Cmajor can be uninstalled from the Windows Control Panel | Add/Remove Programs section:

When clicking the remove installation button, the Cmajor uninstaller program is started:

The uninstaller:

2 Installation on Linux

The Cmajor tools need the following libraries to be installed:

These libraries can be installed by using the package manager of your distro (for example apt-get on Ubuntu) or built and installed from sources.

2.1 Installing LLVM and Clang version 11.0.0

The Cmajor compiler is now built using clang++ (cmajor/build library requires -std=c++20), so you need to install LLVM and Clang 11.0.0 to compile the compiler.

I have Ubuntu 20.04, so I downloaded the Pre-Built Binaries package. I extracted the package to the ~/llvm-11.0.0 directory and inserted ~/llvm-11.0.0/bin directory to the front of my PATH environment variable. After I ran the following command:

            which clang++
        
It prints
        /home/slaakko/llvm-11.0.0/bin/clang++
        
so it is found from the right place.

Sections 2.2, 2.3 and 2.4 describe alternative ways of installing Cmajor under Linux.

2.2 Installation on x86_64 Ubuntu Linux 20.04 using prebuilt binaries

2.3 Installation from sources

2.4 Installation on x86_64 Ubuntu Linux 20.04 running on Windows Subsystem for Linux

2.4.1 Installing LLVM, LLD and Clang from sources

You may alternatively use a LLVM Pre-built Binaries package so this may not be required.

2.4.2 Installing Cmajor prerequisites

            sudo apt-get install zlib1g-dev libbz2-dev libgnutls28-dev libboost-all-dev libtinfo-dev
    

2.4.3 Installing Cmajor