MPS-Basic
Loading...
Searching...
No Matches
Windows

There are three choices to make.

  • Compiler
  • Libraries
  • Build system

Simple Answer

Note
WSL (Windows Subsystem for Linux) that allows you to run a Linux environment on Windows computer is always a good solution for a programmer. It's also recommended.

Steps to Build Environment

First, install Visual Studio Build Tools.

Then open Visual Studio Installer, and add Clang in Visual Studio Build Tools. Sorry it's in Japanese (I couldn't find language setting). I think Visual Studio Installer should be installed with Visual Studio Build Tools. But if not, make it work by yourself and update this document.

Next, install Ninja

(If you're using VSCode,) add the following to .vscode/settings.json. Create one if you don't have. This will make CMake to use Ninja as a generator (meaning VSCode will add -G "Ninja" to the command)

"cmake.generator": "Ninja",
"cmake.configureSettings": {
"CMAKE_MAKE_PROGRAM": "C:/ninja/ninja.exe",
}

Now you can build and execute following Execution page. Make sure you choose Clang for MSVC as a compiler in the CMake tab in Visual Studio Code.

Detailed Explanations for Compiler and Libraries

  • Clang: Recommended
  • GCC
  • MSVC: Currently not eligible with this project

Clang

Clang is easy to install, and recommended in this MPS-Basic project. There are two ways to install Clang.

Since Clang does not come with libraries, Visual Studio Build Tools is required even if you install Clang from the official site. Plus, Clang outside the Visual Studio Build Tools (meaning installed from the official site) doesn't seem to work well with libraries in Visual Studio Build Tools. (Clang didn't recognize OpenMP libraries in Visual Studio Build Tools in my environment. Maybe there is a way to make it work, but why should we when we have Clang that works fine?) Therefore we recommend you to use Clang provided in Visual Studio Build Tools.

Visual Studio Build Tools doesn't include Clang by default, so you have to add it using Visual Studio Installer.

GCC

GCC (GNU Compiler Collection) is originally built for Linux system, but there has been some projects to migrate it into Windows. MinGW (Minimalist GNU for Windows) is the most well-known, but it's now outdated. So if you prefer to use GCC to Clang, we recommend using MinGW-w64, which is derived from original MinGW.

MinGW-w64 comes with libraries. You can manage libraries using MSYS2.

MSVC

MSVC (Microsoft Visual C++ Compiler) is a compiler developed and provided by Microsoft through Visual Studio Build Tools. MSVC cannot be used in this MPS-Basic project, because currently it only supports OpenMP 2.0, while this project requires OpenMP 5.0.

Detailed Explanations for Build System

There are mainly three build systems that Windows users can choose.

  • Ninja: Recommended
  • Make: NOT Recommended
  • MSBuild: NOT Recommended

Ninja

Ninja is easy to install and easy to use. We recommend beginners to use this build system.

Make

Make can be installed through various ways such as:

  • (Original) MinGW (old and not recommended)
  • MSYS2
  • GnuWin32 (old and not recommended)
  • And more...

But most of them are old and not easy to use. So it's not recommended for beginners.

MSBuild

MSBuild is provided through Visual Studio Build Tools. It's mainly used in Visual Studio (IDE), but it's independent from Visual Studio, so you don't have to have Visual Studio to use it. In that case, you can activate it through command-line. It's not bad, but there is a problem. By default, it creates an exe file under build/Debug or build/Release, not under build. But the script that we provide assume that the exe file is in build directory, so it doesn't work well in this project.