Installation Mac

We have 2 installation instruction sets:

  1. Pre-built binaries (recommended)

    • Dependencies are prebuilt and stored on a server and downloaded by cmake using FetchContent feature

    • To rebuild dependencies:

      cd Sensor-Stream-Pipe/3rdparty
      ./buid_mac_dep.sh
    • This will download/build/install dependencies in a tmp directory. The result is a *_macdep.tar.gz file.

    • We target macOS 10.11 and above by using MACOSX_DEPLOYMENT_TARGET="10.11"

      • ffmpeg 4.3 as shared libraries without the GPL option. Path in the dylib is changed to use @rpath for easier linking.

      • OpenCV 3.4.13 as a static library, only core, imgproc, imgcodecs and highgui modules are built.

      • Cereal 1.3.0, header only

      • spdlog 1.8.2, header only but built as static library for faster compile

      • Zdepth (commit 9b333d9aec520 which includes a patch to generate zdepthConfig.cmake)

      • yaml-cpp 0.6.3 as a static library

      • libzmq 4.3.4 as a static library

      • cppzmq 4.7.1, header only

  2. Downloading libraries and building

    • This will provide download instructions for each library

Note: You will not be able to stream a connected Kinect on macOS.

Installation instructions do not include the Azure Kinect SDK as macOS is not yet supported by Azure Kinect SDK .

Problems?! (shocker)

Reach out on our discord and we will get you going!

1.0 Pre-Installation Requirements

1.1 Install Xcode

1.2 Install Xcode command line tools

sudo xcode-select --install

1.3 Install cmake

brew install cmake

2.0 Download and Install SSP

2.1 Download and make SSP

git clone https://github.com/moetsi/Sensor-Stream-Pipe.git
cd Sensor-Stream-Pipe
mkdir build && cd build
cmake ..
make -j12

h264_videotoolbox codec is used for hardware codec on macOS

3.0 Use it!

Now checkout Streaming a Video or Streaming a Dataset to see how you can stream local files with Sensor Stream Server to Sensor Stream Client.

Downloading libraries and building (manual)

Mac installation process was performed using vcpkg to install most dependencies. Tested on MacOS 11.01, Visual Studio Code 1.53.0.

1.0 Install vcpkg

1.1 Follow vcpkg installation instructions available here . The main vcpkg folder we will refer to as vcpkg root directory.

1.2 In your terminal window, change directories to the vcpkg root directory. Then run ./vcpkg integrate install to configure Visual Studio Code as well as automatically link.

The response should be something similar to:

Adams-MBP-2:vcpkg adammac$ ./vcpkg integrate install
Applied user-wide integration for this vcpkg root.

CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=/Users/adammac/dev/vcpkg-macos/vcpkg/scripts/buildsystems/vcpkg.cmake"

2.0 Install dependencies

2.1 Install required packages for vcpkg to be able to install its dependencies

brew install libtool brew install nasm brew install pkg-config

(there may be more packages that you are requested to install with brew in addition to those listed above, vcpkg will let you know)

2.2 Install package to pull data for streaming datasets and videos

brew install wget

2.3 Install vcpkg dependencies

In your vcpkg root directory run the following:

./vcpkg install cereal cppzmq ffmpeg opencv3 spdlog yaml-cpp zeromq matroska libyuv libusb

(Again, you might be prompted to install packages with homebrew)

3.0 Build and install remaining dependencies

3.1 In the code snippet below we install cmake (not necessary if already installed)

brew install cmake

Zdepth

Zdepth is an encoder for depth frames. This library can be used to compress depth data.

3.2 Clone the Zdepth repo (in the snippet below it has been cloned to the home folder but it can be cloned anywhere).

cd ~
git clone https://github.com/catid/Zdepth.git
cd Zdepth

3.3 Open CMakeLists.txt in Visual Studio Code and configure and build according to your desired profile (x64; Debug or Release) using CMake Tools then build.

Example of output of configuring Cmake in VSCode for Debug and building:

/usr/local/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++ -H/Users/adammac/dev/Zdepth -B/Users/adammac/dev/Zdepth/build -G "Unix Makefiles"(^ the paths above would change depending on where you cloned Zdepth, where you installed cmake, what compiler you chose, how you configured building, etc)

In VS Code, the above outputs to /build.

3.4 We now change to the build directory (or wherever cmake was pointed to), runmake and make install.

cd build
make
make install

Example output of running make and make install:

Adams-MBP-2:build adammac$ make
Scanning dependencies of target zstd
[  3%] Building C object zstd/CMakeFiles/zstd.dir/src/debug.c.o
[  6%] Building C object zstd/CMakeFiles/zstd.dir/src/entropy_common.c.o
[ 10%] Building C object zstd/CMakeFiles/zstd.dir/src/error_private.c.o
[ 13%] Building C object zstd/CMakeFiles/zstd.dir/src/fse_compress.c.o
[ 17%] Building C object zstd/CMakeFiles/zstd.dir/src/fse_decompress.c.o
[ 20%] Building C object zstd/CMakeFiles/zstd.dir/src/hist.c.o
[ 24%] Building C object zstd/CMakeFiles/zstd.dir/src/huf_compress.c.o
[ 27%] Building C object zstd/CMakeFiles/zstd.dir/src/huf_decompress.c.o
[ 31%] Building C object zstd/CMakeFiles/zstd.dir/src/pool.c.o
[ 34%] Building C object zstd/CMakeFiles/zstd.dir/src/threading.c.o
[ 37%] Building C object zstd/CMakeFiles/zstd.dir/src/xxhash.c.o
[ 41%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_common.c.o
[ 44%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_compress.c.o
[ 48%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_compress_literals.c.o
[ 51%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_compress_sequences.c.o
[ 55%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_ddict.c.o
[ 58%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_decompress.c.o
[ 62%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_decompress_block.c.o
[ 65%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_double_fast.c.o
[ 68%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_fast.c.o
[ 72%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_lazy.c.o
[ 75%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_ldm.c.o
[ 79%] Building C object zstd/CMakeFiles/zstd.dir/src/zstd_opt.c.o
[ 82%] Building C object zstd/CMakeFiles/zstd.dir/src/zstdmt_compress.c.o
[ 86%] Linking C static library libzstd.a
[ 86%] Built target zstd
Scanning dependencies of target zdepth
[ 89%] Building CXX object CMakeFiles/zdepth.dir/src/zdepth.cpp.o
[ 93%] Linking CXX static library libzdepth.a
[ 93%] Built target zdepth
Scanning dependencies of target zdepth_test
[ 96%] Building CXX object CMakeFiles/zdepth_test.dir/tests/zdepth_test.cpp.o
/Users/adammac/dev/Zdepth/tests/zdepth_test.cpp:179:10: warning: unused variable 'buffer' [-Wunused-variable]
    int *buffer = pBuffer = (int*)input;
         ^
/Users/adammac/dev/Zdepth/tests/zdepth_test.cpp:245:23: warning: comparison of integers of different signs: 'int' and
      'std::__1::vector<unsigned short, std::__1::allocator<unsigned short> >::size_type' (aka 'unsigned long')
      [-Wsign-compare]
    for (int i = 0; i < depth.size(); ++i) {
                    ~ ^ ~~~~~~~~~~~~
/Users/adammac/dev/Zdepth/tests/zdepth_test.cpp:282:23: warning: comparison of integers of different signs: 'int' and
      'std::__1::vector<unsigned short, std::__1::allocator<unsigned short> >::size_type' (aka 'unsigned long')
      [-Wsign-compare]
    for (int i = 0; i < depth.size(); ++i) {
                    ~ ^ ~~~~~~~~~~~~
3 warnings generated.
[100%] Linking CXX executable zdepth_test
[100%] Built target zdepth_test
Adams-MBP-2:build adammac$ make install
[ 86%] Built target zstd
[ 93%] Built target zdepth
[100%] Built target zdepth_test
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/LICENSE
CMake Error at cmake_install.cmake:49 (file):
  file INSTALL cannot copy file "/Users/adammac/dev/Zdepth/LICENSE" to
  "/usr/local/LICENSE": Permission denied.


make: *** [install] Error 1
Adams-MBP-2:build adammac$ sudo make install
Password:
[ 86%] Built target zstd
[ 93%] Built target zdepth
[100%] Built target zdepth_test
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/LICENSE
-- Installing: /usr/local/README.md
-- Installing: /usr/local/cmake
-- Installing: /usr/local/cmake/zdepth-config.cmake
-- Installing: /usr/local/cmake/zdepth-config-version.cmake
-- Up-to-date: /usr/local/include
-- Installing: /usr/local/include/zdepth.hpp
-- Installing: /usr/local/lib/libzdepth.a
-- Installing: /usr/local/lib/libzstd.a

4.0 Building Sensor Stream Pipe

4.1 Clone the SSP repo

git clone https://github.com/moetsi/Sensor-Stream-Pipe.git

Due to the differences in the build process, the MacOS CMake file is named CMakeListsMacOS.txt at the root of the SSP repo. Thus, you should:

  • 4.2 Delete CMakeLists.txt

  • 4.3 Rename CMakeListsMacOS.txt to CMakeLists.txt.

  • 4.4 Open CMakeLists.txt in VS

  • 4.5 Update

    • the include ("C://Users//Andre//source//repos//vcpkg//installed//x64-windows//include")

    • and link paths ("C://Users//Andre//source//repos//vcpkg//installed//x64-windows//lib")

    • To follow the same path of where you cloned vcpkg in Step 1

4.6 Now we can build Sensor Stream Pipe. In /Sensor-Stream-Pipe run the following commands in terminal:

mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=/Users/adammac/dev/vcpkg-macos/vcpkg/scripts/buildsystems/vcpkg.cmake -DSSP_WITH_KINECT_SUPPORT=OFF -DSSP_WITH_K4A_BODYTRACK=OFF -DSSP_WITH_NVPIPE_SUPPORT=OFF
make

5.0 Use it!

Now checkout Streaming a Video or Streaming a Dataset to see how you can stream local files with Sensor Stream Server to Sensor Stream Client.

Last updated