Building librealsense for Intel RealSense T265 for rPi Raspbian( stretch or buster )

if building on the rPi 3B+ or 1GB rPi 4B you will need to enable a 1-2GB swapfile on a USB dongle. I created the swap file like this:
mount the ext4 partitioned USB device, here I labeled mine DataXfer:
sudo fallocate -l 2G /media/dlarue/DataXfer/swapfile
sudo chmod 600 /media/dlarue/DataXfer/swapfile
sudo mkswap /media/dlarue/DataXfer/swapfile

On your rPi, you want to mount the USB drive and enable swapfile:
mkdir ~/mnt
sudo mount /dev/sda1 ~/mnt
sudo swapon ~/mnt/swapfile

For building librealsense:
/#~/bin/bash
/# built on rPi4 2GB with no added swapfile
cd
sudo apt update
sudo apt-get install -y cmake python3-dev raspberrypi-kernel-headers libusb-1.0-0-dev
git clone https://github.com/IntelRealSense/librealsense
cd librealsense/
git checkout master
git pull
mkdir build
cd build/
cmake -D CMAKE_BUILD_TYPE=“Release” -D FORCE_LIBUVC=ON \
-D BUILD_PYTHON_BINDINGS=ON -D BUILD_EXAMPLES=ON
-D BUILD_GRAPHICAL_EXAMPLES=OFF -D BUILD_EASYLOGGINGPP=OFF
-D BUILD_GLSL_EXTENSIONS=OFF …
make -j3