Pcl: Fails to build against Boost 1.67

Created on 18 Apr 2018  路  9Comments  路  Source: PointCloudLibrary/pcl

Regressed by https://github.com/boostorg/uuid/commit/a8a1ec3d826b. Found downstream. CC @yurivict

$ cmake -GNinja .
$ ninja
[...]
In file included from outofcore/tools/outofcore_print.cpp:53:
In file included from outofcore/include/pcl/outofcore/outofcore_impl.h:50:
outofcore/include/pcl/outofcore/impl/octree_disk_container.hpp:77:74: error: no matching constructor for initialization of 'boost::uuids::random_generator' (aka 'boost::uuids::random_generator_pure')
    boost::uuids::random_generator OutofcoreOctreeDiskContainer<PointT>::uuid_gen_ (&rand_gen_);
                                                                         ^          ~~~~~~~~~~
/usr/local/include/boost/uuid/random_generator.hpp:149:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'boost::mt19937 *' (aka 'mersenne_twister_engine<unsigned int, 32, 624, 397, 31, 2567483615U, 11, 4294967295U, 7, 2636928640U, 15, 4022730752U, 18, 1812433253> *') to 'const boost::uuids::random_generator_pure' for 1st argument
class random_generator_pure
      ^
/usr/local/include/boost/uuid/random_generator.hpp:149:7: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided
1 error generated.

Error logs:

Most helpful comment

@jbeich defining -DBOOST_UUID_RANDOM_GENERATOR_COMPAT in CXXFLAGS works around the build failure :)

All 9 comments

Same failures seen in Homebrew: https://gist.github.com/commitay/b29d35ff45c429a42acd8f095b039eae (https://github.com/Homebrew/homebrew-core/issues/26769)

@jbeich defining -DBOOST_UUID_RANDOM_GENERATOR_COMPAT in CXXFLAGS works around the build failure :)

Also vcpkg installation is failing as reported here https://github.com/Microsoft/vcpkg/issues/3289.

I created a patch to add add_definitions(-DBOOST_UUID_RANDOM_GENERATOR_COMPAT) in the root CMakeLists.txt, as suggeste by @jasjuang.
Not sure if this is the cleanest solution, but it's a good workaround.

I think the breaking change of Bore.Uuid is related this problem.
Please see this release note of Boost 1.67.0.

Uuid:
Breaking change: random_generator is no longer copyable (#61)

pcl1.8 make error
[ 17%] Built target pcl_sample_consensus
[ 17%] Building CXX object io/CMakeFiles/pcl_io.dir/src/openni_camera/openni_image_rgb24.cpp.o
Scanning dependencies of target pcl_stereo
[ 17%] Building CXX object stereo/CMakeFiles/pcl_stereo.dir/src/stereo_grabber.cpp.o
[ 17%] Building CXX object io/CMakeFiles/pcl_io.dir/src/openni_grabber.cpp.o
/home/cc/software/pcl-1.8-master/stereo/src/stereo_grabber.cpp:44:32: internal compiler error: Segmentation fault
struct pcl::StereoGrabberBase::StereoGrabberImpl
^
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
stereo/CMakeFiles/pcl_stereo.dir/build.make:62: recipe for target 'stereo/CMakeFiles/pcl_stereo.dir/src/stereo_grabber.cpp.o' failed
make[2]: * [stereo/CMakeFiles/pcl_stereo.dir/src/stereo_grabber.cpp.o] Error 1
CMakeFiles/Makefile2:6068: recipe for target 'stereo/CMakeFiles/pcl_stereo.dir/all' failed
make[1]:
[stereo/CMakeFiles/pcl_stereo.dir/all] Error 2
make[1]:
Waiting for unfinished jobs....
[ 18%] Building CXX object io/CMakeFiles/pcl_io.dir/src/oni_grabber.cpp.o
[ 18%] Building CXX object io/CMakeFiles/pcl_io.dir/src/dinast_grabber.cpp.o
[ 18%] Building CXX object io/CMakeFiles/pcl_io.dir/src/libpng_wrapper.cpp.o
[ 18%] Linking CXX shared library ../lib/libpcl_io.so
[ 18%] Built target pcl_io
Makefile:160: recipe for target 'all' failed
make: *
[all] Error 2

@cumtchenchang one possible source of internal compiler error is you ran out of memory. Try just make instead of make -j or find a better machine to compile it.

It is actually caused by a change of the default random UUID generator. The new one uses OS provided randomness and doesn't take a PRNG as argument anymore in the constructor. See also #2338.

I also have this problem when I build PCL lirbrary on Mac Mojave. What would be the solution?

The solution is to use up-to-date version of PCL (1.9.0), it incorporates the fix to this problem.

Was this page helpful?
0 / 5 - 0 ratings