从源安装时,laspy 找不到 laszip。 laszip 在路径中

laspy cannot find laszip when is installed from source. laszip is in path

我在 HPC 环境中工作,没有根访问权限。我从源代码安装了 laszip。

从源安装 laszip

module load git
git clone https://github.com/LASzip/LASzip.git
git checkout tags/2.0.2
cd LASzip

在构建目录中创建文件。

mkdir build
cd build
module load cmake
module load gcc
cmake .. -DCMAKE_INSTALL_PREFIX=/home/b.weinstein/LASzip/build 
make
make install

添加路径

export LD_LIBRARY_PATH="/home/b.weinstein/LASzip/build/lib:$LD_LIBRARY_PATH"
export PATH="/home/b.weinstein/LASzip/build/bin:$PATH"

确保它在本地工作

(pangeo) [b.weinstein@c30a-s26 bin]$ pwd
/home/b.weinstein/LASzip/build/bin
(pangeo) [b.weinstein@c30a-s26 bin]$ laszip-config --version
2.0.2

转到新目录以测试链接

cd ~
(pangeo) [b.weinstein@c30a-s26 ~]$ laszip-config --version
2.0.2

来自 python

的测试
(pangeo) [b.weinstein@c30a-s26 ~]$ python
Python 3.6.4 | packaged by conda-forge | (default, Dec 23 2017, 16:31:06) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import laspy
>>> test_file=laspy.file.File("/ufrc/ewhite/s.marconi/NeonData/2017_Campaign/D03/OSBS/L1/DiscreteLidar/ClassifiedPointCloud/NEON_D03_OSBS_DP1_412000_3283000_classified_point_cloud.laz")
Traceback (most recent call last):
  File "/home/b.weinstein/miniconda3/envs/pangeo/lib/python3.6/site-packages/laspy/base.py", line 204, in map
    self._mmap=FakeMmap(self.filename)
  File "/home/b.weinstein/miniconda3/envs/pangeo/lib/python3.6/site-packages/laspy/base.py", line 57, in __init__
    data = read_compressed(filename)
  File "/home/b.weinstein/miniconda3/envs/pangeo/lib/python3.6/site-packages/laspy/base.py", line 37, in read_compressed
    raise(laspy.util.LaspyException("Laszip was not found on the system"))
laspy.util.LaspyException: Laszip was not found on the system

如何告诉 laspy 到哪里寻找 laszip?这是 python路径问题吗?

您需要安装laszip-cli应用程序

git clone https://github.com/LASzip/LASzip.git
cd LASzip
git checkout 3.1.0
cmake .
make
sudo make install
cd ..
wget http://lastools.org/download/LAStools.zip
unzip LAStools.zip
cd LAStools
make
sudo cp bin/laszip /usr/local/bin
sudo ln -s /usr/local/bin/laszip /usr/local/bin/laszip-cli

Windows 用户:

  1. 从“https://rapidlasso.com/laszip/”下载 Laszip.exe
  2. 将 laszip.exe 的路径添加到 User_Variables 和 System_Variables
  3. 中的 %PATH%

具有root访问权限的构建过程仅供记录。

设置构建环境

sudo apt install  -y --fix-missing --no-install-recommends \
build-essential ca-certificates cmake git libboost-all-dev

构建并安装 LASzip

git clone https://github.com/LASzip/LASzip.git
mkdir LASzip/build && cd LASzip/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install

构建并安装 LAStools

git clone https://github.com/LAStools/LAStools.git
mkdir LAStools/build && cd LAStools/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install