2. Installation

2.1. Installing pre-built binaries (Win32 platform)
2.2. Building and installing MiST Engine with CMake
2.3. Building and installing MiST Engine on Linux without CMake
2.4. Building and installing MiST Engine on Microsoft Windows without CMake

2.1. Installing pre-built binaries (Win32 platform)

For Win32 platform, there are pre-built binaries of MiST Engine available. The archive containing these is usually named as follows: mist_engine-<version>-win32.7z, where <version> is the version of MiST Engine (for example, 1.0.0_final).

To install MiST Engine, simply unpack the archive to the directory of your choice. This can be done, for example, with 7-Zip file archiver or any other packer application that understands 7-zip format.

The distribution package contains the following directories:

  • bin - contains MiST Engine command line tool.

  • include - contains header files necessary to use MiST Engine API in the applications written in C or C++. Typically, such applications would have the following directive:

    #include <mist_engine/mist_engine.h>
    

    and the path to the include directory is usually added to the list of the include-directories for the chosen compiler.

  • lib - contains the shared library implementing MiST Engine API (mist_engine.dll) as well as import libraries, libmist_engine.a and mist_engine.lib. If an application using MiST Engine API is to be built with GCC, it should link with the former input library. The latter library should be used if the application is to be built with Microsoft Visual C++ 2003, 2005 or 2008 (may work with other versions as well).

2.2. Building and installing MiST Engine with CMake

If you would like to to build MiST Engine from source on Linux or Microsoft Windows, probably the easiest way to go is to use CMake build system. Unless specifically stated, the following instructions apply to both Linux and Microsoft Windows operating systems.

To build MiST Engine, you need the following.

  1. The sources of MiST Engine. They are usually distributed in a .tar.bz2 archive (mist_engine-<version>.tar.bz2).

  2. CMake version 2.6 or newer. It is assumed below that cmake executable is somewhere in PATH.

  3. GNU C compiler. GCC version 4.0 or newer is recommended. GCC 3.x would do as well although the code of the MiST Engine shared library could be less optimized in this case.

    On Windows, you should install MinGW. Among other things, MinGW provides GCC and windres.exe, the latter is also necessary to build the shared library. bin directory of your MinGW installation should be included in PATH.

    On Windows, if you plan to use MiST Engine shared library (mist_engine.dll) not only in the applications built with GCC but also in the applications built with Microsoft Visual Studio, please make sure lib.exe is also available (is somewhere in PATH). lib.exe is provided, for example, with Microsoft Visual Studio.

MiST Engine can be set up as follows.

  1. Unpack the archive with the distribution (<version> is the version of MiST Engine, like 1.0.0_final). The archive should contain one directory, mist_engine-<version>. It is recommended not to build MiST Engine in that very directory, it is usually more convenient to build in another directory (out-of-source build). This keeps the contents of mist_engine-<version> unchanged.

    So, create another directory, say, build in the same directory as mist_engine-<version>. All files created during the build process will be placed into that build directory.

  2. To configure the package and prepare necessary makefiles, run cmake from build directory created at the previous step.

    On Linux:

    cmake ../mist_engine-<version>/
    

    On Windows:

    cmake -G "MinGW Makefiles" ..\mist_engine-<version>\
    

    The package will be configured to install MiST Engine to the default installation directory. It is usually something like /usr/local/ on Linux and C:\Program Files\mist_engine\ on Windows. If you want to install MiST Engine to some other location (<install_directory>), configure the package as follows:

    On Linux:

    cmake -DCMAKE_INSTALL_PREFIX=<install_directory> ../mist_engine-<version>/
    

    On Windows:

    cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=<install_directory> ..\mist_engine-<version>\
    
  3. If configuration process has completed successfully, you can now build MiST Engine.

    On Linux:

    make
    

    On Windows:

    mingw32-make
    

    Then you can install MiST Engine as follows.

    On Linux:

    make install
    

    On Windows:

    mingw32-make install
    

    You may need to execute the last command as root user (on Windows - as a user with administrative privileges) if your current user does not have appropriate permissions on the installation directory.

The following should now be installed:

  • MiST Engine command line tool (mist_engine on Linux, mist_engine.exe on Windows) – to <install_directory>/bin

  • MiST Engine shared library (libmist_engine.so.1 on Linux, mist_engine.dll on Windows) and other related stuff – to <install_directory>/lib. On Windows, import libraries to be used when linking applications with GNU linker and Microsoft linker (libmist_engine.a and mist_engine.lib, respectively) are also placed there.

  • MiST Engine header files – to <install_directory>/include/mist_engine

  • man page for mist_engine tool – to <install_directory>/share/man

  • HTML docs  – to <install_directory>/share/doc

Note

There is currently no such thing as make uninstall with this type of build.

2.3. Building and installing MiST Engine on Linux without CMake

Note

Please note that the recommended way to build MiST Engine on Linux is to use CMake (see above). Support for Autotools-style builds can be dropped in the future versions of MiST Engine package. If you still want to build MiST Engine without using CMake for some reason, please follow the instructions below.

To build MiST Engine, you need GNU C compiler, version 4.0 or newer is recommended. GCC 3.x would do as well although the code of the MiST Engine shared library could be less optimized in this case.

MiST Engine can be set up as follows.

  1. Unpack the archive with the distribution (<version> is the version of MiST Engine, like 1.0.0_final):

    tar xfj mist_engine-<version>.tar.bz2
    

    and change current directory to mist_engine-<version>

    Note

    VPATH (out-of-source-tree) build is also supported. See the Autotools tutorial for details about the configure – make – make install process and VPATH builds in particular.

  2. Configure the package:

    ./configure
    

    The package will be configured to install MiST Engine to the default installation directory (on Linux, it is usually /usr/local/). If you want to install MiST Engine to some other location (<install_directory>), configure the package as follows:

    ./configure --prefix <install_directory>
    

    You can also specify which compiler should be used to build MiST Engine. To do so, set the path to the compiler as the value of CC variable when calling configure. CFLAGS variable can be used in a similar way to provide specific compiler options. Example:

    ./configure --prefix /home/user/ CC=/opt/lsb/bin/lsbcc CFLAGS="-O3 -DNDEBUG"
    

    Note

    If MiST Engine tools are compiled with -DNDEBUG option, assert() checks in the source code of the tools are not performed (they are no-ops in this case). It is often reasonable to turn them off in the release builds. As usual, assert() calls are used there only to check for the errors in the implementation of MiST Engine itself.

  3. If configuration process has completed successfully, you can now build MiST Engine:

    make
    

    and then install it with

    make install
    

    You may need to execute the last command as root user if your current user does not have appropriate permissions on the installation directory.

The following files should now be installed:

  • mist_engine (MiST Engine command line tool) – to <install_directory>/bin

  • MiST Engine shared library (libmist_engine.so.1) and other related stuff – to <install_directory>/lib

  • MiST Engine header files – to <install_directory>/include/mist_engine

  • man page for mist_engine tool – to <install_directory>/share/man

If you later want to uninstall MiST Engine, execute make uninstall from the same directory where you called make install before.

Note

It is recommended to use MiST Engine API implementation built as a shared library rather than a static library. The shared library is built by default.

2.4. Building and installing MiST Engine on Microsoft Windows without CMake

Note

Note that the easiest way to install MiST Engine on Microsoft Windows XP or a newer Microsoft Windows system is usually to get the pre-built binaries and deploy them as described in Section 2.1, “Installing pre-built binaries (Win32 platform)”. The second prerefable option would be to use CMake (see Section 2.2, “Building and installing MiST Engine with CMake”) because in that case, you would not need MSYS environment at all, only MinGW, so less actions were required.

If you want to build MiST Engine from source using MSYS, please follow the instructions below.

To build MiST Engine on Microsoft Windows systems, you need MinGW (preferably, with GCC 4.0 or newer) and MSYS.

Before building MiST Engine, please make sure windres.exe tool is available (is somewhere in PATH) when you are in MSYS environment. This tool is necessary to build the shared library (mist_engine.dll) and is usually included in MinGW.

If you plan to use MiST Engine shared library (mist_engine.dll) not only in the applications built with GCC but also in the applications built with Microsoft Visual Studio, please make sure lib.exe is also available (is somewhere in PATH) when you are in MSYS environment. lib.exe is provided with Microsoft Visual Studio.

After that, the process of building and installing MiST Engine in MSYS environment is quite the same as on Linux (see Section 2.3, “Building and installing MiST Engine on Linux without CMake”). Unpack the archive with MiST Engine source distribution and then execute the following commands:

./configure --prefix <install_directory>
make
make install

At least the following files should now be installed:

  • mist_engine.exe (MiST Engine command line tool) – to <install_directory>/bin

  • MiST Engine shared library (mist_engine.dll), import libraries (libmist_engine.a and mist_engine.lib), and other related stuff – to <install_directory>/lib

  • MiST Engine header files – to <install_directory>/include/mist_engine

Note

As a result of build process, two import libraries can be built:

  • libmist_engine.a (built always) - the applications built with GCC should link with this library if they use MiST Engine API (mist_engine.dll).

  • mist_engine.lib (built if lib.exe is available) - the applications built with Microsoft Visual C++ should link with this library if they use MiST Engine API (mist_engine.dll).

To uninstall MiST Engine, execute make uninstall from the same directory where you called make install before.