strawlab / python-pcl

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

error running build_ext #140

Open rybandrei2014 opened 6 years ago

rybandrei2014 commented 6 years ago

Hello, i have an issue while installing python-pcl, specifically while building it. How can i solve an issue? Thanks in advance.

ros@rosthink:~/python-pcl$ sudo -H python setup.py build_ext -i running build_ext skipping 'pcl/_pcl_172.cpp' Cython extension (up-to-date) building 'pcl._pcl' extension i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET=1 -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/pcl-1.7 -I/usr/include/ni -I/usr/include/eigen3 -I/usr/include/ni -I/usr/include/python2.7 -c pcl/_pcl_172.cpp -o build/temp.linux-i686-2.7/pcl/_pcl_172.o cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1809:0, from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:18, from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4, from pcl/_pcl_172.cpp:526: /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it by " \

^ pcl/_pcl_172.cpp: In function ‘int pyx_pf_3pcl_4_pcl18ConditionalRemovalcinit(pyx_obj_3pcl_4_pcl_ConditionalRemoval, __pyx_obj_3pcl_4_pcl_ConditionAnd)’: pcl/_pcl_172.cpp:46070:145: warning: ‘pcl::ConditionalRemoval::ConditionalRemoval(pcl::ConditionalRemoval::ConditionBasePtr, bool) [with PointT = pcl::PointXYZ; pcl::ConditionalRemoval::ConditionBasePtr = boost::shared_ptr<pcl::ConditionBase >]’ is deprecated: ConditionalRemoval(ConditionBasePtr condition, bool extract_removed_indices = false) is deprecated, please use the setCondition (ConditionBasePtr condition) function instead. [-Wdeprecated-declarations] val_t(((pyx_t_3pcl_11pcl_filters_ConditionBasePtr_t)pyx_v_cond->me), NULL); ^ In file included from pcl/_pcl_172.cpp:531:0: /usr/include/pcl-1.7/pcl/filters/conditional_removal.h:632:7: note: declared here ConditionalRemoval (ConditionBasePtr condition, bool extract_removed_indi ^ pcl/_pcl_172.cpp: In function ‘PyObject pyx_pf_3pcl_4_pcl_32GeneralizedIterativeClosestPoint_4gicp(pyx_obj_3pcl_4_pcl_GeneralizedIterativeClosestPoint, pyx_obj_3pcl_4_pcl_PointCloud, __pyx_obj_3pcl_4_pcl_PointCloud, PyObject)’: pcl/_pcl_172.cpp:48346:60: warning: ‘void pcl::GeneralizedIterativeClosestPoint<PointSource, PointTarget>::setInputCloud(const PointCloudSourceConstPtr&) [with PointSource = pcl::PointXYZ; PointTarget = pcl::PointXYZ; pcl::GeneralizedIterativeClosestPoint<PointSource, PointTarget>::PointCloudSourceConstPtr = boost::shared_ptr<const pcl::PointCloud >]’ is deprecated: [pcl::registration::GeneralizedIterativeClosestPoint::setInputCloud] setInputCloud is deprecated. Please use setInputSource instead. [-Wdeprecated-declarations] pyx_v_gicp.setInputCloud(pyx_v_source->thisptr_shared); ^ In file included from /usr/include/pcl-1.7/pcl/registration/gicp.h:351:0, from pcl/_pcl_172.cpp:580: /usr/include/pcl-1.7/pcl/registration/impl/gicp.hpp:48:1: note: declared here pcl::GeneralizedIterativeClosestPoint<PointSource, PointTarget>::setInputCloud ^ pcl/_pcl_172.cpp: In function ‘PyObject pyx_pf_3pcl_4_pcl_21IterativeClosestPoint_6icp(pyx_obj_3pcl_4_pcl_IterativeClosestPoint, __pyx_obj_3pcl_4_pcl_PointCloud, pyx_obj_3pcl_4_pcl_PointCloud, PyObject)’: pcl/_pcl_172.cpp:48951:59: warning: ‘void pcl::Registration<PointSource, PointTarget, Scalar>::setInputCloud(const PointCloudSourceConstPtr&) [with PointSource = pcl::PointXYZ; PointTarget = pcl::PointXYZ; Scalar = float; pcl::Registration<PointSource, PointTarget, Scalar>::PointCloudSourceConstPtr = boost::shared_ptr<const pcl::PointCloud >]’ is deprecated: [pcl::registration::Registration::setInputCloud] setInputCloud is deprecated. Please use setInputSource instead. [-Wdeprecated-declarations] pyx_v_icp.setInputCloud(pyx_v_source->thisptr_shared); ^ In file included from /usr/include/pcl-1.7/pcl/registration/registration.h:607:0, from pcl/_pcl_172.cpp:575: /usr/include/pcl-1.7/pcl/registration/impl/registration.hpp:43:1: note: declared here pcl::Registration<PointSource, PointTarget, Scalar>::setInputCloud ( ^ pcl/_pcl_172.cpp: In function ‘PyObject __pyx_pf_3pcl_4_pcl_30IterativeClosestPointNonLinear_4icp_nl(__pyx_obj_3pcl_4_pcl_IterativeClosestPointNonLinear, pyx_obj_3pcl_4_pcl_PointCloud, __pyx_obj_3pcl_4_pcl_PointCloud, PyObject*)’: pcl/_pcl_172.cpp:49500:62: warning: ‘void pcl::Registration<PointSource, PointTarget, Scalar>::setInputCloud(const PointCloudSourceConstPtr&) [with PointSource = pcl::PointXYZ; PointTarget = pcl::PointXYZ; Scalar = float; pcl::Registration<PointSource, PointTarget, Scalar>::PointCloudSourceConstPtr = boost::shared_ptr<const pcl::PointCloud >]’ is deprecated: [pcl::registration::Registration::setInputCloud] setInputCloud is deprecated. Please use setInputSource instead. [-Wdeprecated-declarations] __pyx_v_icp_nl.setInputCloud(pyx_v_source->thisptr_shared); ^ In file included from /usr/include/pcl-1.7/pcl/registration/registration.h:607:0, from pcl/_pcl_172.cpp:575: /usr/include/pcl-1.7/pcl/registration/impl/registration.hpp:43:1: note: declared here pcl::Registration<PointSource, PointTarget, Scalar>::setInputCloud ( ^ pcl/_pcl_172.cpp: In function ‘PyObject __pyx_pf_3pcl_4_pcl_10PointCloud_88make_GeneralizedIterativeClosestPoint(__pyx_obj_3pcl_4_pcl_PointCloud)’: pcl/_pcl_172.cpp:59456:150: warning: ‘void pcl::GeneralizedIterativeClosestPoint<PointSource, PointTarget>::setInputCloud(const PointCloudSourceConstPtr&) [with PointSource = pcl::PointXYZ; PointTarget = pcl::PointXYZ; pcl::GeneralizedIterativeClosestPoint<PointSource, PointTarget>::PointCloudSourceConstPtr = boost::shared_ptr<const pcl::PointCloud >]’ is deprecated: [pcl::registration::GeneralizedIterativeClosestPoint::setInputCloud] setInputCloud is deprecated. Please use setInputSource instead. [-Wdeprecated-declarations] ed_ptr<pcl::PointCloud > )pyx_v_self->thisptr_shared)); ^ In file included from /usr/include/pcl-1.7/pcl/registration/gicp.h:351:0, from pcl/_pcl_172.cpp:580: /usr/include/pcl-1.7/pcl/registration/impl/gicp.hpp:48:1: note: declared here pcl::GeneralizedIterativeClosestPoint<PointSource, PointTarget>::setInputCloud ^ pcl/_pcl_172.cpp: In function ‘PyObject* __pyx_pf_3pcl_4_pcl_10PointCloud_90make_IterativeClosestPointNonLinear(pyx_obj_3pcl_4_pcl_PointCloud)’: pcl/_pcl_172.cpp:59556:148: warning: ‘void pcl::Registration<PointSource, PointTarget, Scalar>::setInputCloud(const PointCloudSourceConstPtr&) [with PointSource = pcl::PointXYZ; PointTarget = pcl::PointXYZ; Scalar = float; pcl::Registration<PointSource, PointTarget, Scalar>::PointCloudSourceConstPtr = boost::shared_ptr<const pcl::PointCloud >]’ is deprecated: [pcl::registration::Registration::setInputCloud] setInputCloud is deprecated. Please use setInputSource instead. [-Wdeprecated-declarations] ed_ptr<pcl::PointCloud > )__pyx_v_self->thisptr_shared)); ^ In file included from /usr/include/pcl-1.7/pcl/registration/registration.h:607:0, from pcl/_pcl_172.cpp:575: /usr/include/pcl-1.7/pcl/registration/impl/registration.hpp:43:1: note: declared here pcl::Registration<PointSource, PointTarget, Scalar>::setInputCloud ( ^ pcl/_pcl_172.cpp: In function ‘PyObject pyx_pf_3pcl_4_pcl_10PointCloud_92make_IterativeClosestPoint(__pyx_obj_3pcl_4_pcl_PointCloud*)’: pcl/_pcl_172.cpp:59656:139: warning: ‘void pcl::Registration<PointSource, PointTarget, Scalar>::setInputCloud(const PointCloudSourceConstPtr&) [with PointSource = pcl::PointXYZ; PointTarget = pcl::PointXYZ; Scalar = float; pcl::Registration<PointSource, PointTarget, Scalar>::PointCloudSourceConstPtr = boost::shared_ptr<const pcl::PointCloud >]’ is deprecated: [pcl::registration::Registration::setInputCloud] setInputCloud is deprecated. Please use setInputSource instead. [-Wdeprecated-declarations] ed_ptr<pcl::PointCloud > )pyx_v_self->thisptr_shared)); ^ In file included from /usr/include/pcl-1.7/pcl/registration/registration.h:607:0, from pcl/_pcl_172.cpp:575: /usr/include/pcl-1.7/pcl/registration/impl/registration.hpp:43:1: note: declared here pcl::Registration<PointSource, PointTarget, Scalar>::setInputCloud ( ^ pcl/_pcl_172.cpp: In function ‘PyObject pyx_pf_3pcl_4_pcl_29PointCloud_PointWithViewpoint_12from_list(pyx_obj_3pcl_4_pcl_PointCloud_PointWithViewpoint, PyObject*)’: pcl/_pcl_172.cpp:75042:77: warning: variable ‘pyx_t_9’ set but not used [-Wunused-but-set-variable] _ctuple_floatand_floatand_float__and_floatand_float__and_float __pyx_t_9; ^ virtual memory exhausted: Cannot allocate memory error: command 'i686-linux-gnu-gcc' failed with exit status 1

niranjanreddy891 commented 6 years ago

@dragoon000320, You do not have enough memory to compile the source code. Have you configured swap? If you want to know how to create a swap you can look here. I hope that will work. :)

mortlind commented 5 years ago

I too have memory problems. My python3 setup.py build_ext dies with the following message:

cc1plus: out of memory allocating 1461608 bytes after a total of 64675840 bytes
error: command 'i686-linux-gnu-gcc' failed with exit status 1

I have plenty of memory free. I am on a 32-bit Debian and use the -pae-kernel, so the compiler process is limited to 4GB memory. However, that seems far beyond what is complained about, which is around some 64MB of allocated memory when it drops dead.

Have anyone of you experienced that?

Update: I trusted the reported memory allocation from cc1plus, shown above. When I monitor the memory used by the process during building, I see that it grows up to around 4GB and then dies. How is it possible that it can use so vast amount of memory, and is there a sparse memory option I can use for the setup.py-script?

Update2: I tested on a 64-bit machine and it compiles fine, but it is still a tremendous memory usage ...