You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PREREQUISITES.md
+118-43
Original file line number
Diff line number
Diff line change
@@ -1,43 +1,103 @@
1
1
# PREREQUISITES
2
2
3
-
## C++ 11 or higher
4
-
Checkout [C++ Compiler](#C++-Compiler)
3
+
## C++ 11 Compiler
4
+
5
+
To build the SDK, you will need a compiler that can compile C++ 11 code or higher. C++ compilers vary based on platform, but listed below are a few of the most common and the minimum version required:
6
+
7
+
* Clang: 3.9 or higher
8
+
* GCC: 4.8 or higher
9
+
* MSVC: 2015 or higher
10
+
11
+
Listed below are ways to install C++ 11 compilers on [Windows](#windows-c-compilers), [MacOS](#macos-c-compiler), and [Linux](#linux-c-compilers).
5
12
6
13
## CMake 3.1+
7
-
1. Download CMake3.1+ for your platform: https://cmake.org/download/
8
14
9
-
2. Run the Cmake Installer. Make sure you add CMake into **PATH**.
15
+
You will also need CMake to build the SDK. The minimum required version is CMake 3.1.
16
+
17
+
Below are the instructions to install CMake in a non-platform specific way:
10
18
19
+
1. Download CMake3.1+ for your platform: https://cmake.org/download/
20
+
2. Run the Cmake Installer. Make sure you add CMake into **PATH**.
11
21
3. Restart the command prompt / terminal.
12
22
13
-
## C++ Compiler (Clang 3.9+ or GCC 4.8+ or MSVC 2015+)
14
-
1. Check if Clang or GCC is installed
15
-
```sh
16
-
g++ --version
17
-
```
18
-
```
19
-
clang --version
20
-
```
23
+
Listed below are also instructions to install CMake on [Windows](#windows-cmake), [MacOS](#macos-cmake), and [Linux](#linux-cmake).
24
+
25
+
## Windows Instructions
26
+
27
+
### Windows C++ Compilers
28
+
29
+
#### MinGW-w64
30
+
31
+
MinGW-w64 is a project that allows for `GCC` compiler support on Windows. There are several ways to install MinGW-w64, and this document will explain the workflow for adding MinGW-w64 using MSYS2, a software distribution and building platform for Windows.
32
+
33
+
MinGW-w64 is fully supported on [Visual Studio Code](https://code.visualstudio.com/), a programming IDE that is a lightweight alternative to Visual Studio that supports many programming languages. The steps below are loosely based on the documentation for [installing MinGW-w64 for Visual Studio code](https://code.visualstudio.com/docs/cpp/config-mingw).
34
+
35
+
1. Download and run the MSYS2 installer from the [MSYS2 website](https://www.msys2.org/).
36
+
2. Follow the install instructions on the [MSYS2 website](https://www.msys2.org/).
37
+
* Make sure to follow the instructions on the website for updating the database and base packages!
38
+
* Installing MinGW-w64 may be part of these instructions. If so, install MinGW-w64 using the instructions there.
39
+
3. If MinGW-w64 was not part of the install instructions for MSYS2, run `pacman -S --needed base-devel mingw-w64-x85_64-toolchain`.
40
+
4. Next you need to add MinGW to your windows `PATH` environment variables so you can run it from the terminal.
41
+
5. Open the Windows Settings. You can do this by typing `settings` into the search bar or by opening the Windows start menu and navigating to the Windows Settings (should be called "Settings") application.
42
+
6. Once the Windows Settings window is open, search for `Edit environment variables for your account`.
43
+
7. Select the `Path` variable in the `User variables` property and press the `Edit` button.
44
+
8. Select `New` and then add the MinGW-w64 `bin` folder to this path. If you used the command in step 3, it should be located in `C:\msys64\mingw64\bin`. If you installed using a different method, you will need to find the `mingw64/bin` folder on your computer.
45
+
9. Once you have added the path to the `Path` variable in the `User variables` property, select `OK` and save.
46
+
10. Close any console/terminal windows you have open. This is because the console/terminal will not see the updated `PATH` variable unless it is restarted by closing and reopening.
47
+
11. Confirm that MingW-w64 is installed by running either `g++ --version` or `gdb --version`. You should get a print out showing the installed version of the C++ compiler.
21
48
22
-
### Windows
23
49
#### MSVC
24
-
Install Visual Studio with MSVC
25
-
1. Download **Visual Studio Installer**
26
-
https://visualstudio.microsoft.com/downloads/
27
50
51
+
Microsoft Visual C++ (MSVC) is a C++ compiler that is supported and maintained by Microsoft, and is supported by the C++ SDK. To install MSVC, you will need to install Visual Studio using the instructions below.
28
52
53
+
Install Visual Studio with MSVC
54
+
1. Download **Visual Studio Installer**https://visualstudio.microsoft.com/downloads/
29
55
2. Run the installer, check the **Desktop development with C++** workload and select Install.
30
-
31
56
3. Verify your MSVC installation
32
-
* In Windows Start up Menu, try open "Developer Command Prompt for VS"
57
+
* In Windows Start up Menu, try open "Developer Command Prompt for VS".
58
+
* In the opened terminal/console window, type `cl.exe` and it *should* output the compiler version.
59
+
* You can also find the compiler version by opening Visual Studio by selecting `help` and then `about`.
60
+
61
+
If using MSVC, you will need to use the Developer Command Prompt instead of the standard terminal when compiling the SDK and samples.
62
+
63
+
### Windows CMake
64
+
65
+
#### MinGW-w64
33
66
34
-
Continue with the Developer Command Prompt to install the SDK and samples.
67
+
If you installed MinGW-w64 via `MSYS32` in the steps above, you can easily install CMake using the following:
35
68
36
-
### MacOS
37
-
#### C++ Compiler
38
-
##### XCode Command Line Tools using `brew`
69
+
1. Run `pacman -S mingw-w64-x86_64-cmake`.
70
+
2. You will also need to install a build tool. You can install `ninja` or `make`.
71
+
3. To install `ninja` run `pacman -S mingw-w64-x86_64-ninja`.
72
+
4. To install `make` run `pacman -S mingw-w64-x86_64-make`.
73
+
5. Run `cmake --version` to check that CMake is properly installed.
39
74
40
-
[Brew](https://brew.sh/) is a command line package manager that makes it easy to install packages and software dependencies.
75
+
#### Manual Install
76
+
77
+
You can also install CMake manually by following the install instructions on the CMake website:
78
+
79
+
1. Download CMake3.1+ for Windows: https://cmake.org/download/
80
+
2. Run the Cmake Installer.
81
+
4. Next you need to add CMake to your windows `PATH` environment variables so you can run it from the terminal.
82
+
* Note: The installer should include an option to add CMake to the system path for all users. If you have checked this box, you can skip steps `5` through `9`.
83
+
5. Open the Windows Settings. You can do this by typing `settings` into the search bar or by opening the Windows start menu and navigating to the Windows Settings (should be called "Settings") application.
84
+
6. Once the Windows Settings window is open, search for `Edit environment variables for your account`.
85
+
7. Select the `Path` variable in the `User variables` property and press the `Edit` button.
86
+
8. Select `New` and then add the CMake `bin` folder to this path. If you do not modify the install path, it should be located around `C:\Program Files (x86)\CMake.x.x` where `x.x` is the version. If you installed CMake to a different directory, then you will need to modify the path accordingly.
87
+
9. Once you have added the path to the `Path` variable in the `User variables` property, select `OK` and save.
88
+
10. Close any console/terminal windows you have open. This is because the console/terminal will not see the updated `PATH` variable unless it is restarted by closing and reopening.
89
+
11. Run `cmake --version` to check that CMake is properly installed.
90
+
91
+
92
+
## MacOS Instructions
93
+
94
+
### MacOS C++ Compiler
95
+
96
+
#### XCode Command Line Tools using `brew`
97
+
98
+
XCode Command Line Tools is the easiest way to install C++ compilers on MacOS, as it is officially supported and maintained by Apple. By installing the XCode Command Line tools, you will automatically install `clang`, which can compile C++ 11 code. One way to install XCode Command Line Tools is using `brew`.
99
+
100
+
[Brew](https://brew.sh/) is a command line package manager that makes it easy to install packages and software dependencies. The instructions to install through `brew` are below:
41
101
42
102
1. Open a new terminal and input the following command:
3. Wait for `brew` to install the XCode Command Line Tools. This make take some time.
48
108
4. Once `brew` is finished, confirm the XCode Command Line Tools have installed by opening a new terminal and inputting `clang --version`.
49
109
50
-
If stuck waiting for `brew` to install XCode Command Line Tools for over 15-20 minutes, you many need to cancel the installation (`CTRL-C` in the terminal)
51
-
and install XCode Command Line Tools though the installer.
110
+
If stuck waiting for `brew` to install XCode Command Line Tools for over 15-20 minutes, you many need to cancel the installation (`CTRL-C` in the terminal) and install XCode Command Line Tools though the installer.
52
111
53
112
##### XCode Command Line Tools using installer
54
113
114
+
You can also install XCode Command Line Tools manually through an installer download on Apple's website. The instructions to install through the installer are below:
115
+
55
116
1. Go to [developer.apple.com/downloads](https://developer.apple.com/download/all/).
56
117
2. Input your AppleID to access the developer downloads.
57
118
3. From the presented list, scroll until you find `Command Line Tools for Xcode <version>`.
58
119
4. Select `view more details` and then select `Additionals Tools for Xcode <version>.dmg`.
59
120
5. Once downloaded, double click the `.dmg` and follow the installer instructions.
60
121
6. Confirm XCode Command Line Tools have installed by opening a new terminal and inputting `clang --version`.
61
122
62
-
#### CMake
63
-
##### CMake using `brew`
123
+
### MacOS CMake
124
+
#### CMake using `brew`
125
+
126
+
CMake can easily be installed using `brew`, so if you installed `brew` for XCode Command Line Tools, you can run the following to install CMake:
64
127
65
128
1. Confirm you have `brew` installed:
66
129
```sh
67
130
brew --version
68
131
```
69
132
2. Install CMake by running `brew install cmake`.
70
-
3.Once the install is finished, close the terminal and reopen it.
133
+
3.Close any console/terminal windows you have open. This is to refresh the console/terminal so it uses the latest changes.
71
134
4. Confirm CMake is installed by running `cmake --version`.
72
135
73
-
##### CMake using official precompiled download
136
+
#### Manual Install
137
+
138
+
You can also install CMake manually by following the install instructions on the CMake website:
74
139
75
140
1. Go to [cmake.org/install](https://cmake.org/install/).
76
141
2. Follow the install instructions for MacOS on the website page.
77
-
3. Once CMake is installed and added to the path, confirm it's working by running `cmake --version`.
142
+
3. Drag and drop the CMake application from the downloaded installer into your Applications folder. A window should open once you have mounted the CMake installer that easily allows you to do this via drag-and-drop.
143
+
4. You may need to manually add CMake to your `path` so you can run it in the terminal. To do this, run the following command:
5. This will create the symlinks so you can run CMake from the terminal.
148
+
6. Close any console/terminal windows you have open. This is to refresh the console/terminal so it uses the latest changes.
149
+
150
+
## Linux
78
151
79
-
### Linux
80
-
#### C++ Compiler (Clang or GCC)
152
+
### Linux C++ Compilers
81
153
82
154
Many Linux operating systems have C++ compilers installed by default, so you might already `clang` or `gcc` preinstalled.
83
155
To test, try running the following in a new terminal:
156
+
84
157
```sh
85
158
clang --version
86
159
```
87
160
```sh
88
161
gcc --version
89
162
```
90
163
91
-
##### Install GCC or Clang on Ubuntu
164
+
If these commands fail, then please follow the instructions below for installing a C++ compiler on your Linux operating system.
165
+
166
+
If your Linux operating system is not in the list, please use a search engine to find out how to install either `clang` or `gcc` on your Linux operating system.
167
+
168
+
#### Install GCC or Clang on Ubuntu
92
169
93
170
1. Open a new terminal
94
171
2. (optional) Run `sudo apt-get update` to get latest package updates.
@@ -97,16 +174,20 @@ gcc --version
97
174
5. Once the install is finished, close the terminal and reopen it.
98
175
6. Confirm GCC is installed by running `gcc --version` or Clang is installed by running `clang --version`.
99
176
100
-
#####Install GCC or Clang on Arch Linux
177
+
#### Install GCC or Clang on Arch Linux
101
178
102
179
1. Open a new terminal.
103
180
2. Run `sudo pacman -S gcc` to install GCC or `sudo pacman -S clang` to install Clang.
104
181
3. Once the install is finished, close the terminal and reopen it.
105
182
4. Confirm Clang is installed by running `gcc --version`.
106
183
107
-
####CMake
184
+
###Linux CMake
108
185
109
-
##### Install CMake on Ubuntu
186
+
There are several ways to install CMake depending on the Linux operating system. Several Linux operating systems include CMake in their software repository applications, like the Ubuntu Software Center for example, so you may want to check there first. Below are the instructions to install CMake for Ubuntu and Arch Linux.
187
+
188
+
If your Linux operating system is not in the list below, please use a search engine to find out how to install CMake on your Linux operating system. You can also always try to install CMake manually using the generic install instructions at the top of this page.
189
+
190
+
#### Install CMake on Ubuntu
110
191
111
192
1. Open the Ubuntu Software Center
112
193
2. In the search bar enter `cmake` and select `CMake - cross-platform build system` from the list
@@ -121,15 +202,9 @@ Or using the command line:
121
202
3. After CMake has installed, close the terminal and reopen it
122
203
4. Type `cmake --version` to confirm CMake is installed
123
204
124
-
#####Install CMake on Arch Linux
205
+
#### Install CMake on Arch Linux
125
206
126
207
1. Open a new terminal.
127
208
2. Run `sudo pacman -S cmake` to install Cmake
128
209
3. After CMake has installed, close the terminal and reopen it
129
210
4. Type `cmake --version` to confirm CMake is installed.
130
-
131
-
132
-
## FAQ
133
-
134
-
1. CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
135
-
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
0 commit comments