Skip to content

Commit bb9a473

Browse files
committed
add gs building instructions for MacOS system
1 parent a0d78fb commit bb9a473

File tree

1 file changed

+62
-1
lines changed

1 file changed

+62
-1
lines changed

README.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,68 @@ Take a look at `cmake/fw_build_options.cmake` to see the available build options
167167

168168
#### **Ground Station**
169169

170-
From the top-level directory, run the following to build the ground station. Currently, the ground station is only supported on Windows.
170+
From the top-level directory, run the following to build the ground station. Currently, the ground station has only been supported for Windows and may be subject to bugs on MacOS. If on a Linux or Windows system, skip the MacOS instructions.
171+
172+
<b>For MacOS users only</b>:\
173+
First, add the following to the top of file `./obc/CMakeLists.txt`, and should be placed as shown:
174+
```
175+
...
176+
cmake_minimum_required(VERSION 3.15)
177+
178+
# Add the following 4 lines
179+
if(APPLE)
180+
find_library(COREFOUNDATION CoreFoundation)
181+
find_library(IOKIT IOKit)
182+
endif()
183+
...
184+
```
185+
186+
Next, add the following to the file `./gs/backend/CMakeLists.txt` positioned as below:
187+
```
188+
...
189+
target_compile_options(gs.out PUBLIC -Wall -g)
190+
191+
# Add the following 6 lines
192+
if(APPLE)
193+
target_link_libraries(gs.out PUBLIC
194+
"-framework CoreFoundation"
195+
"-framework IOKit"
196+
)
197+
endif()
198+
...
199+
```
200+
201+
Next, comment out line in `./CMakeLists.txt` like as shown:
202+
```
203+
...
204+
#set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchain_ground_station_gcc.cmake)
205+
...
206+
```
207+
208+
Next, open `./gs/backend/main.c` and add and remove the following headers:
209+
```.c
210+
...
211+
<malloc.h> # Remove
212+
...
213+
<CoreFoundation/CoreFoundation.h> # Add
214+
...
215+
```
216+
217+
Next, open `./gs/interfaces/obc_gs_interface/__init__.py` and change the end of the path extension to `.dylib`, as shown:
218+
```py
219+
...
220+
path = (Path(__file__).parent / "../../build_gs/interfaces/libobc-gs-interface.dylib").resolve()
221+
# originally ...interface.so, change to ...interface.dylib
222+
...
223+
```
224+
225+
Lastly, run the following in the terminal:
226+
```sh
227+
pip install -e .
228+
```
229+
<b>End of MacOS instructions. Continue with the last step below.</b>
230+
231+
Then, run the following in the terminal from the top-level directory:
171232

172233
```sh
173234
mkdir -p build_gs && cd build_gs

0 commit comments

Comments
 (0)