From b3b31cc9621508a63ed96ae1aeeecb2bdbcb3da8 Mon Sep 17 00:00:00 2001 From: Alexis Durgnat <alexis.durgnat@hesge.ch> Date: Fri, 21 Jun 2024 09:25:06 +0200 Subject: [PATCH] Add instructions for build --- BUILD_INSTRUCTIONS.md | 50 +++++++++++++++++++++++++++++++++++++++++++ Prereqs.sh | 4 ++++ prepare_build.sh | 32 +++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 BUILD_INSTRUCTIONS.md create mode 100644 Prereqs.sh create mode 100755 prepare_build.sh diff --git a/BUILD_INSTRUCTIONS.md b/BUILD_INSTRUCTIONS.md new file mode 100644 index 0000000..a284f5e --- /dev/null +++ b/BUILD_INSTRUCTIONS.md @@ -0,0 +1,50 @@ +# Building the lib + +The following procedure has been written for Ubuntu 22.04 OS. + + +Install the dependencies : + +``` +./prepare_build.sh +``` + +## Building librealsense + +Clone the repository : + +``` +git clone https://github.com/IntelRealSense/librealsense.git +``` + + +Create the build directory and prepare the build + +``` +cd librealsense +mkdir build && cd build +cmake ../ +make +``` + +Once built, install the lib : + +``` +make install +``` + + +## Building lib sandbox + +Clone the repository (and checkout to the opencv4 branch) + +``` +git clone ssh://git@ssh.hesge.ch:10572/ar_sandbox/ar_sandbox_lib.git +git checkout opencv4 +``` + +Build the lib: + +``` +make all +``` \ No newline at end of file diff --git a/Prereqs.sh b/Prereqs.sh new file mode 100644 index 0000000..796d6bb --- /dev/null +++ b/Prereqs.sh @@ -0,0 +1,4 @@ + +ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2 +cd /usr/lib/x86_64-linux-gnu/pkgconfig +ln -s opencv4.pc opencv.pc \ No newline at end of file diff --git a/prepare_build.sh b/prepare_build.sh new file mode 100755 index 0000000..9bcd681 --- /dev/null +++ b/prepare_build.sh @@ -0,0 +1,32 @@ +NC='\033[0m' # No Color +GRE='\033[0;32m' +BLU='\033[0;34m' +YEL='\033[0;33m' + + +echo "${BLU}========================================" +echo "= libsandbox requirements install =" +echo "========================================${NC}" + +echo "${YEL}Updating APT cache${NC}" +apt update + +echo "${BLU}========================================" +echo "= librealsense build requirements =" +echo "========================================${NC}" +apt install -y git wget cmake build-essential libssl-dev libusb-1.0-0-dev libudev-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev at v4l-utils + +echo "${BLU}========================================" +echo "= libsandbox build requirements =" +echo "========================================${NC}" +apt install -y libyaml-cpp-dev libopencv-dev qtbase5-dev qttools5-dev + +echo "${BLU}========================================" +echo "= Linking opencv4/opencv2 to opencv2 =" +echo "========================================${NC}" +ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2 +echo "${BLU}========================================" +echo "= Linking opencv4.pc to opencv.pc =" +echo "========================================${NC}" +ln -s /usr/lib/x86_64-linux-gnu/pkgconfig/opencv4.pc /usr/lib/x86_64-linux-gnu/pkgconfig/opencv.pc +echo "${GRE}Successfuly prepared environment${NC}" \ No newline at end of file -- GitLab