1
The installation of Livox SDK on Linux 32 bit system and Mac cn
Livox-SDK edited this page 2020-10-26 20:44:45 +08:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

在32位Linux系统和Mac系统中安装Livox SDK(The installation of Livox SDK on Linux 32-bit system and Mac)

[TOC]

1. Livox SDK API

Livox SDK API 提供了一种C语言样式的函数,方便集成到C/C++程序中。如需更多信息,请查阅Livox SDK API Reference

1.1 安装

下面以在Ubuntu 16.04/14.04 32-bit和Mac系统中安装过程为例。

1.1.1 Ubuntu 16.04/14.04 32-bit LTS

安装依赖

Livox SDK需要以下依赖 CMake 3.0.0+, Apache Portable Runtime (APR) 1.61+Boost 1.54+。需要用apt来安装boost、cmake

sudo apt install cmake libboost-atomic-dev libboost-system-dev

Apache Portable Runtime (APR) 1.61+ 下载最新的apr linux源码:

tar -zxvf apr-1.X.X.tar.gz
cd apr-1.X.X
./configure --prefix=/usr/local/apr --disable-lfs
make && sudo make install

编译Livox SDK

在Livox SDK目录中,运行以下命令来编译工程:

git clone https://github.com/Livox-SDK/Livox-SDK.git
cd Livox-SDK/build
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/apr/lib/pkgconfig/ && export PKG_CONFIG_PATH
cmake ..
make
sudo make install

由于 PKG_CONFIG_PATH 只在当前终端窗口有效,所以每个新的窗口都需要运行PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/apr/lib/pkgconfig/ && export PKG_CONFIG_PATH ,除非在 .bashrc 文件中加入这一行作为环境变量。

1.1.2 Mac

安装依赖

Livox SDK需要以下依赖 CMake 3.0.0+, Apache Portable Runtime (APR) 1.61+Boost 1.54+。可以使用brew来安装这些依赖:

brew install cmake apr boost

然后运行以下命令:

brew info apr

可以看到以下信息并获取apr路径:

apr: stable 1.X.X (bottled) [keg-only]
Apache Portable Runtime library
https://apr.apache.org/
/usr/local/Cellar/apr/1.X.X (XX files, X.XMB)
  Poured from bottle on XXXX-XX-XX at XX:XX:XX
From: https://mirrors.ustc.edu.cn/homebrew-core.git/Formula/apr.rb
==> Caveats
apr is keg-only, which means it was not symlinked into /usr/local,
because Apple's CLT package contains apr.

If you need to have apr first in your PATH run:
  echo 'export PATH="/usr/local/opt/apr/bin:$PATH"' >> ~/.bash_profile

编译Livox SDK

在Livox SDK目录中,运行以下命令来编译工程:

git clone https://github.com/Livox-SDK/Livox-SDK.git
cd Livox-SDK/build
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/Cellar/apr/1.X.X/libexec/lib/pkgconfig
cmake ..
make
sudo make install

由于 PKG_CONFIG_PATH 只在当前终端窗口有效,所以每个新的窗口都需要运行以上的命令,除非在 .bash_profile 文件中加入这一行作为环境变量。