strawlab / python-pcl

Python bindings to the pointcloud library (pcl)
http://strawlab.github.com/python-pcl/
Other
2k stars 701 forks source link

Failed install with MacOS 10.14.3 #273

Open mcmessina opened 5 years ago

mcmessina commented 5 years ago

Hi,

I am following the guide to install on MacOS with version 10.14.3. The install is having trouble finding one of the standard libraries and I am unable to find a solution. Could this be an issue with Xcode 10 that is related to this thread?

I installed PCL from homebrew with:

brew tap brewsci/science
brew install pcl

My error occurs here (running Python 3.5.4):

(venv) ~/p/r/python-pcl ❯❯❯ pip freeze
Cython==0.25.2
numpy==1.16.2
(venv) ~/p/r/python-pcl ❯❯❯ python setup.py install
running install
running bdist_egg
running egg_info
writing top-level names to python_pcl.egg-info/top_level.txt
writing python_pcl.egg-info/PKG-INFO
writing dependency_links to python_pcl.egg-info/dependency_links.txt
writing requirements to python_pcl.egg-info/requires.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-intel/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 -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET=1 -I/Users/a/projects/r/.venv/venv/lib/python3.5/site-packages/numpy/core/include -I/usr/local/Cellar/pcl/1.9.1_3/include/pcl-1.9 -I/usr/local/Cellar/flann/1.9.1_7/include -I/usr/local/Cellar/pcl/1.9.1_3/include/pcl-1.9 -I/usr/local/Cellar/eigen/3.3.7/include/eigen3 -I/usr/include/ni -I/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c pcl/_pcl_180.cpp -o build/temp.macosx-10.6-intel-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>
         ^~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
(venv) ~/p/r/python-pcl ❯❯❯

Thank you!

mcmessina commented 5 years ago

Took a little while, but I found a workaround:

In setup.py, add the following lines for extra compile arguments (at roughly line 580) and extra linker arguments (at roughly line 610).

ext_args['extra_compile_args'].append("-stdlib=libc++")
ext_args['extra_link_args'].append("-stdlib=libc++")

Then, in terminal:

export MACOSX_DEPLOYMENT_TARGET=10.10

I will not close the issue myself in case this inspires changes to the setup.py file or build instructions for Mac.

Cheers!