有关在计算机上安装PCL的问题 [英] Issues about installing PCL in my computer

查看:148
本文介绍了有关在计算机上安装PCL的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试安装python-pcl(PCL是用于演示的点云库,例如激光雷达数据。我按照 https://github.com/strawlab/python-pcl ,并且我已经将travis / pcl-2d-1.8.pc文件复制到/ usr / local / lib / pkgconfig文件夹)在我的电脑上。我在终端中输入 AppledeMacBook-Pro-3:python-pcl-0.3.0rc1 apple $ python setup.py install ,然后遇到以下问题:

When I try to install python-pcl(PCL is the point cloud library for presentation like laser radar data. I followed the instruction on https://github.com/strawlab/python-pcl ,and I have already copied travis/pcl-2d-1.8.pc file to /usr/local/lib/pkgconfig folder) in my computer. I typed AppledeMacBook-Pro-3:python-pcl-0.3.0rc1 apple$ python setup.py install in my terminal.Then I encountered a problem below:

running install
running bdist_egg
running egg_info
writing requirements to python_pcl.egg-info/requires.txt
writing python_pcl.egg-info/PKG-INFO
writing top-level names to python_pcl.egg-info/top_level.txt
writing dependency_links to python_pcl.egg-info/dependency_links.txt
reading manifest file 'python_pcl.egg-info/SOURCES.txt'
writing manifest file 'python_pcl.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-x86_64/egg
running install_lib
running build_py
running build_ext
skipping 'pcl/_pcl_180.cpp' Cython extension (up-to-date)
building 'pcl._pcl' extension
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/apple/miniconda3/include -I/Users/apple/miniconda3/include -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET=1 -I/Users/apple/miniconda3/pkgs/python-3.5.4-h8f450c2_22/lib/python3.5/site-packages/numpy/core/include -I/usr/local/include/pcl-1.8 -I/usr/local/Cellar/openni/1.5.7.10/include/ni -I/usr/local/include/pcl-1.8 -I/usr/local/Cellar/flann/1.9.1_6/include -I/usr/local/include/pcl-1.8 -I/opt/local/include/eigen3 -I/usr/include/ni -I/usr/include/vtk-5.8 -I/usr/local/include/vtk-8.0 -I/usr/local/Cellar/vtk/8.0.1/include -I/Users/apple/miniconda3/pkgs/python-3.5.4-h8f450c2_22/include/python3.5m -c pcl/_pcl_180.cpp -o build/temp.macosx-10.6-x86_64-3.5/pcl/_pcl_180.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the
      command line to use the libc++ standard library instead
      [-Wstdlibcxx-not-found]
pcl/_pcl_180.cpp:447:10: fatal error: 'vector' file not found
#include <vector>
         ^~~~~~~~

有人说这与我有关系Cython版本。但是我已经将Cython切换到0.25.2版本,仍然无法正常工作。有人有同样的问题吗?非常感谢。顺便说一句,我的python版本是3.5.4,我的Mac版本是macOS Mojave 10.14.1

Somebody says it has something to do with my Cython version. But I have already switched Cython to version 0.25.2, still not working. Does anyone have the same problem? Many thanks. By the way, my python version is 3.5.4 and my Mac Version is macOS Mojave 10.14.1

推荐答案

当前MacOS安装的问题。您可以调整 setup.py ,并按照警告提示将 -std = libc ++ 添加到编译选项中,即

This is a special issue with current MacOS-installations. You could tweak setup.py and add, as the warning suggest, -std=libc++ to the compile-options, i.e.

from distutils.core import setup
from Cython.Build import cythonize

...  some stuff

#passing `-stdlib=libc++` to compiler and linker:
ext_modules = [Extension(...,
                         language='c++',
                         extra_compile_args=["-stdlib=libc++"], # + anything else you need
                         extra_link_args= ["-stdlib=libc++"] # + anything else you need]

... some more stuff

我还添加了 -stdlib = libc ++ 到链接器选项,因为这可能是您将遇到的下一个问题。

I have also added -stdlib=libc++ to the linker options, because it will be probably the next problem you will run into.

更多背景:在MacOS世界中,长期存在其中c ++标准库的两种不同实现: -libstdc ++ gcc libc ++ 相关联code >与 clang 关联。开始时, -libstdc ++ 也默认使用 clang -compiler。但是,情况不再如此-甚至现在都没有安装,这就是找不到标头的原因。我不确定为什么您的 clang 版本不会默认使用 libc ++ -因此您必须通过它手动添加到编译器/链接器。

More background: In the MacOS world, for long time, there where two different implementations of c++'s standard library: -libstdc++ associated with gcc and libc++ associated with clang. At the beginning-libstdc++ was also used per default with clang-compiler. However, this is no longer the case - it is not even installed now and that is the reason why the headers cannot be found. I'm not sure why your clang-version doesn't take libc++ per default - so you have to pass it manually to compiler/linker.

这篇关于有关在计算机上安装PCL的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆