Repository navigation
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·88 lines (74 loc) · 2.26 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·88 lines (74 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
set -e # Exit on any error
echo "=============================================="
echo " LiDAR Odometry Build Script"
echo "=============================================="
# Get number of CPU cores for parallel compilation (use half of available cores)
NPROC=$(($(nproc) / 2))
if [ $NPROC -lt 1 ]; then
NPROC=1
fi
echo "Using $NPROC cores for compilation (half of available)"
# Install system dependencies
echo ""
echo "Step 0: Installing system dependencies..."
echo "========================================"
# Check if running in Docker container
if [ -n "$DOCKER_CONTAINER" ]; then
echo "Running in Docker container - skipping apt updates (dependencies pre-installed)"
else
sudo apt update
sudo apt install -y \
cmake \
build-essential \
libeigen3-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libglew-dev \
libgflags-dev \
libgoogle-glog-dev \
libatlas-base-dev \
libsuitesparse-dev \
libyaml-cpp-dev \
libopencv-dev \
libboost-all-dev
echo "System dependencies installed successfully!"
fi
# Build third-party dependencies
echo ""
echo "Step 1: Checking third-party dependencies..."
echo "=============================================="
# Check if thirdparty directory exists
if [ ! -d "thirdparty" ]; then
echo "Error: thirdparty directory not found!"
echo "Please ensure the thirdparty directory with dependencies exists."
exit 1
fi
# Pangolin, Sophus, spdlog are built via CMake add_subdirectory
echo "Third-party libraries will be built automatically via CMake"
# Build main project
echo ""
echo "Step 2: Building main project..."
echo "================================="
# Create build directory for main project
if [ ! -d "build" ]; then
mkdir build
fi
cd build
# Configure and build main project
cmake ..
make -j$NPROC
echo ""
echo "=============================================="
echo " Build completed successfully!"
echo "=============================================="
echo ""
echo "To run the LiDAR odometry system:"
echo " cd build"
echo ""
echo "For KITTI dataset:"
echo " ./kitti_lidar_odometry ../config/kitti.yaml"
echo ""
echo "For PLY files (MID360, OS128, etc):"
echo " ./lidar_odometry ../config/mid360.yaml"
echo ""