Skip to content

Commit b52772b

Browse files
author
Gin
committed
improve mac guide
1 parent bb9ead7 commit b52772b

File tree

1 file changed

+67
-30
lines changed

1 file changed

+67
-30
lines changed

Wiki/Developer/MacInstallationGuide.md

Lines changed: 67 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -113,62 +113,83 @@ OpenCV is a software package for various computer vision algorithms. We need it
113113
brew install opencv
114114
```
115115

116+
### Verify Clang Version
117+
118+
Before building the code of the automation program, make sure the software that builds the code into program is up-to-date. This software is called compilers by programmers. Apple provides a compiler called Clang on macOS. Verify its version by executing the command in Terminal:
119+
```
120+
g++ --version
121+
```
122+
You should see the output like
123+
```
124+
Apple clang version 14.0.0 (clang-1400.0.29.102)
125+
Target: arm64-apple-darwin21.6.0
126+
Thread model: posix
127+
InstalledDir: /Library/Developer/CommandLineTools
128+
```
129+
The exact version, target and installed directory may be different on your machine.
130+
But as long as your Clang version is higher than 13.0.0, you should be fine to proceed.
131+
132+
If you find your Clang version is too low, check this [tutorial](UpdateClang.md) to address it.
133+
116134
### Download Codebase
117135

118136
Go to **SerialPrograms** Github [webpage](https://github.com/PokemonAutomation/Arduino-Source).
119137
There's a green button "Code". Click it to show download options.
120138

121-
If you know how to use Git to download it, you can use Git. Otherwise, download it as a ZIP file.
139+
#### Use Git:
140+
If you know how to use Git to download code from Github, you can use Git and pick a release version based on Git branch names.
141+
142+
#### Download directly as a zip file:
143+
Otherwise, download code directly as follows.
144+
By default, when you visit this webpage, it lets you download the newest under-development version.
145+
The version may contain automation programs that are not fully developed or have major bugs.
146+
To use one of our stable release versions, first check the version numbers by pressing the dropdown menu currently shown as "main" on the webpage,
147+
on the same row as the green "Code" button.
148+
The dropdown menu shows recent version numbers.
149+
As the time of updating this guide (Nov 1, 2022), the newest version is "v0.18". You can pick the latest version you find.
150+
Once you select a version, the text of the dropdown menu will be changed from "main" to that version,
151+
and the code you download from the "Code" button will be from that version.
152+
Pick "Download ZIP" when clicking the "Code" button to download the code as a ZIP file.
153+
The default ZIP filename will be "Arduino-Source-<VERSION_NUMBER>.zip"
154+
122155
Place the code into a suitable folder you like. But avoid placing it in a "remote/cloud" folder like in OneDrive. Cloud folders may give some trouble for programs running on those folders.
123156
If you download as a ZIP, unzip it to a suitable folder.
124157

125158
The downloaded code should be in a folder called "Arduino-Source".
126159

127-
Click the folder to select it in Finder App. Command-C to copy the folder, then go to Terminal, type `cd`, followed by a Space key, then Command-V to paste the folder. It actually paste the folder path in macOS file system to the Terminal. So you would have
128-
```
129-
cd <YOUR_PATH_TO_ARDUINO-SOURCE_FOLDER>
130-
```
131-
in your Terminal. Press Enter to execute it.
132-
133-
`cd` command moves the current active folder in Terminal to a new folder. Now your Terminal are running on "Arduino-Source" folder. Verify this by executing
134-
```
135-
ls
136-
```
137-
in Terminal. It will list the files and folders in "Arduino-Source" folder.
138-
139-
### Download Program data
160+
### Download Program Data
140161

141162
**SerialPrograms** need some extra data to run.
142163
Go to our [Packages Github webpage](https://github.com/PokemonAutomation/Packages) and download the data same as before.
143164

144165
The downloaded data will be inside a folder called "Packages". Inside it there is a sub-folder called "SerialPrograms". Further inside is a sub-sub-folder "Resources". Move this "Resources" folder into the "Arduino-Source" folder you downloaded before. Make sure it is placed directly inside "Arduino-Source", not deeper into the folder hierarchy.
145166

146-
### Verify Clang Version
167+
### Configure Program
147168

148-
Before building the code of the automation program, make sure the software that builds the code into program is up-to-date. This software is called compilers by programmers. Apple provides a compiler called Clang on macOS. Verify its version by executing the command in Terminal:
169+
#### Enter source-code folder:
170+
171+
Click the "Arduino-Source" folder to select it in Finder App. Command-C to copy the folder, then go to Terminal, type `cd`, followed by a Space key, then Command-V to paste the folder. It actually paste the folder path in macOS file system to the Terminal. So you would have
149172
```
150-
g++ --version
173+
cd <YOUR_PATH_TO_ARDUINO-SOURCE_FOLDER>
151174
```
152-
You should see the output like
175+
in your Terminal. Press Enter to execute it.
176+
177+
`cd` command moves the current active folder in Terminal to a new folder. Now your Terminal are running on "Arduino-Source" folder. Verify this by executing
153178
```
154-
Apple clang version 14.0.0 (clang-1400.0.29.102)
155-
Target: arm64-apple-darwin21.6.0
156-
Thread model: posix
157-
InstalledDir: /Library/Developer/CommandLineTools
179+
ls
158180
```
159-
The exact version, target and installed directory may be different on your machine.
160-
But as long as your Clang version is higher than 13.0.0, you should be fine to proceed.
161-
162-
If you find your Clang version is too low, check this [tutorial](UpdateClang.md) to address it.
181+
in Terminal. It will list the files and folders in "Arduino-Source" folder.
163182

164-
### Configure Program
183+
#### Create a folder to host compiled program:
165184

166-
Execute the command in Terminal:
185+
Make sure the current active folder in Terminal is the "Arduino-Source" folder, then execute the command in Terminal:
167186
```
168-
mkdir build_mac; cd build_mac
187+
mkdir -p build_mac; cd build_mac
169188
```
170189
This makes a new folder called "build_mac" in "Arduino-Source" and move the Terminal's current active folder to the new folder.
171190

191+
#### Use CMake to Configure Program:
192+
172193
Execute the command in Terminal:
173194
```
174195
cmake ../SerialPrograms/ -DUNIX_LINK_TESSERACT:BOOL=true -DCMAKE_BUILD_TYPE:STRING=Release -Wall
@@ -183,7 +204,7 @@ This command uses CMake to configure our code to prepare for compilation. If suc
183204

184205
### Compile Program
185206

186-
Execute the command in Terminal:
207+
Make sure the current active folder in Terminal is "build_mac", then execute the command in Terminal:
187208
```
188209
cmake --build . -j 10
189210
```
@@ -209,3 +230,19 @@ Now **SerialPrograms** is built! Run the program in Terminal by the command
209230
```
210231

211232
Enjoy shiny hunting!
233+
234+
---------------------
235+
236+
### Upgrade to Newest Version
237+
238+
To upgrade, in most cases you just need to repeat the process starting at [Download Codebase](#download-codebase).
239+
240+
In rare cases when we add new software library dependencies, just follow the guide to install those new libraries.
241+
If we upgrade our Qt dependency to a higher Qt version, use Homebrew to upgrade it by running
242+
```
243+
brew upgrade qt6
244+
```
245+
in Terminal.
246+
247+
248+
[<img src="https://canary.discordapp.com/api/guilds/695809740428673034/widget.png?style=banner2">](https://discord.gg/cQ4gWxN)

0 commit comments

Comments
 (0)