MPS-Basic
|
There are three choices to make.
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)
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.
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 (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 (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.
There are mainly three build systems that Windows users can choose.
Ninja is easy to install and easy to use. We recommend beginners to use this build system.
Make
can be installed through various ways such as:
But most of them are old and not easy to use. So it's not recommended for beginners.
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.