Compiling Poisson_surface_reconstruction_3 example - undefined reference to boost::system::generic_category()

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Compiling Poisson_surface_reconstruction_3 example - undefined reference to boost::system::generic_category()

Oliver Arend
I downloaded the CGAL-4.10 tarball, untarred it and could successfully
compile CGAL without any modifications to the CMakeLists.txt. I'm using
Linux Mint 18.

Similarly, some examples like the Convex_hull_2 compile just fine.

The Poisson_surface_reconstruction_3 example does not compile (cmake is
successful), the underlying error seems to be in

CMakeFiles/poisson_reconstruction.dir/poisson_reconstruction.cpp.o: In
function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:221: undefined reference to
`boost::system::generic_category()'

I saw several posts related to this or a similar error such as
https://stackoverflow.com/questions/9723793/undefined-reference-to-boostsyst
emsystem-category-when-compiling
https://stackoverflow.com/questions/18200300/undefined-reference-to-boostsys
temgeneric-category
https://stackoverflow.com/questions/21782275/undefined-reference-to-boostsys
temgeneric-category
but looking at the error messages I now seem to be at the same point as
kevnull was on Oct 4, 2014:
http://cgal-discuss.949826.n4.nabble.com/Surface-reconstruction-points-3-com
pilation-error-td4659915.html
but without a posted solution.

I would like to know how I need to modify the
/examples/Poisson_surface_reconstruction_3/CMakeLists.txt or any other file
that requires modification to resolve the error.

Thanks in advance
Oliver


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compiling Poisson_surface_reconstruction_3 example - undefined reference to boost::system::generic_category()

Sebastien Loriot (GeometryFactory)
One possible reason is that the CGAL library was compiled with c++11
features but the example is compiled without c++11.

Sebastien.

On 06/09/2017 07:05 PM, Oliver Arend wrote:

> I downloaded the CGAL-4.10 tarball, untarred it and could successfully
> compile CGAL without any modifications to the CMakeLists.txt. I'm using
> Linux Mint 18.
>
> Similarly, some examples like the Convex_hull_2 compile just fine.
>
> The Poisson_surface_reconstruction_3 example does not compile (cmake is
> successful), the underlying error seems to be in
>
> CMakeFiles/poisson_reconstruction.dir/poisson_reconstruction.cpp.o: In
> function `__static_initialization_and_destruction_0':
> /usr/include/boost/system/error_code.hpp:221: undefined reference to
> `boost::system::generic_category()'
>
> I saw several posts related to this or a similar error such as
> https://stackoverflow.com/questions/9723793/undefined-reference-to-boostsyst
> emsystem-category-when-compiling
> https://stackoverflow.com/questions/18200300/undefined-reference-to-boostsys
> temgeneric-category
> https://stackoverflow.com/questions/21782275/undefined-reference-to-boostsys
> temgeneric-category
> but looking at the error messages I now seem to be at the same point as
> kevnull was on Oct 4, 2014:
> http://cgal-discuss.949826.n4.nabble.com/Surface-reconstruction-points-3-com
> pilation-error-td4659915.html
> but without a posted solution.
>
> I would like to know how I need to modify the
> /examples/Poisson_surface_reconstruction_3/CMakeLists.txt or any other file
> that requires modification to resolve the error.
>
> Thanks in advance
> Oliver
>
>


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Compiling Poisson_surface_reconstruction_3 example - undefined reference to boost::system::generic_category()

Oliver Arend
> One possible reason is that the CGAL library was compiled with c++11
features but the example is compiled without c++11.

I cannot find any indication for which C++ standard should be used in either
the CMakeLists.txt for CGAL-4.10 nor in the Poisson example, so I have to
assume they were compiled using the same standard.

Other ideas?

Oliver


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compiling Poisson_surface_reconstruction_3 example - undefined reference to boost::system::generic_category()

Sebastien Loriot (GeometryFactory)
On 06/12/2017 09:26 AM, Oliver Arend wrote:
>> One possible reason is that the CGAL library was compiled with c++11
> features but the example is compiled without c++11.
>
> I cannot find any indication for which C++ standard should be used in either
> the CMakeLists.txt for CGAL-4.10 nor in the Poisson example, so I have to
> assume they were compiled using the same standard.
>
> Other ideas?
>

I'm pretty sure I'm on the right track here. Boost thread (that uses
boost system) is only used to get thread local. It is replaced by
std thread local if the compiler provides them.
Try "ldd libCGAL.so" and look if libboost_thread.so and
libboost_system.so are present. If not then c++11 have been used
to compile the library (you should see in the CMakeCache.txt, most
probably in CMAKE_CXX_FLAGS).

To fix the issue add to CMAKE_CXX_FLAGS in the CMakeCache.txt of the
example -std=c++11

Sebastien.


> Oliver
>
>


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Compiling Poisson_surface_reconstruction_3 example - undefined reference to boost::system::generic_category()

Oliver Arend
> Try "ldd libCGAL.so" and look if libboost_thread.so and libboost_system.so
are present. If not then c++11 have been used to compile the library (you
should see in the CMakeCache.txt, most probably in CMAKE_CXX_FLAGS).
> To fix the issue add to CMAKE_CXX_FLAGS in the CMakeCache.txt of the
example -std=c++11

Thanks, that fixed it!

I noticed the "1 Introduction" section at
http://doc.cgal.org/latest/Manual/installation.html#title0 is slightly
misleading, because even though CGAL works great out of the box on a Linux
system, a simple "make" won't suffice, "make install" is still required --
at least it was in my case.
It is in fact mentioned in section "12 Installing CGAL".

Oliver



--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compiling Poisson_surface_reconstruction_3 example - undefined reference to boost::system::generic_category()

Sebastien Loriot (GeometryFactory)
On 06/12/2017 11:30 AM, Oliver Arend wrote:

>> Try "ldd libCGAL.so" and look if libboost_thread.so and libboost_system.so
> are present. If not then c++11 have been used to compile the library (you
> should see in the CMakeCache.txt, most probably in CMAKE_CXX_FLAGS).
>> To fix the issue add to CMAKE_CXX_FLAGS in the CMakeCache.txt of the
> example -std=c++11
>
> Thanks, that fixed it!
>
> I noticed the "1 Introduction" section at
> http://doc.cgal.org/latest/Manual/installation.html#title0 is slightly
> misleading, because even though CGAL works great out of the box on a Linux
> system, a simple "make" won't suffice, "make install" is still required --
> at least it was in my case.
> It is in fact mentioned in section "12 Installing CGAL".
>
> Oliver
>
>
>
I confirm that you don't need to install CGAL.
Setting CGAL_DIR at the cmake level is sufficient.

Sebastien.

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Loading...