Creating SWIG Python bindings for CGAL function

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating SWIG Python bindings for CGAL function

rahulverma88
Hi, I'm trying to build a python interface to a custom CGAL function. The
function works just fine on its own, but I get errors when I try to do the
linking with Python using SWIG.

I have been using 'cgal_create_cmake_lists' to create the CMakeLists.txt for
the CGAL part, doing cmake and make, and then using the generated .o files
to link with SWIG, but I think I am not linking the required boost and GMP
libraries properly with the SWIG-generated shared object ".so" file.

SWIG generates the shared object files for me, but then when I try to import
my module, I get an error:

Symbol not found: __ZN4CGAL11NULL_VECTORE

I am using the command "ld -bundle -flat_namespace -undefined suppress -o
cgal_executable.so *.o"  to generate the shared object file. Should I be
linking boost and GMP libraries in this step? If so, how do I do that? I am
on a Mac OS. I can share my full code if needed.

I know there is a project for Python-SWIG bindings, but I really don't need
all of it, and also it seems to be missing a lot of useful CGAL features. I
would like to work in C++, and just interface my functions with Python as
needed.



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
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
|

Re: Creating SWIG Python bindings for CGAL function

Sebastien Loriot (GeometryFactory)
Duplicated SO post (with an answer):

https://stackoverflow.com/questions/57824076/building-python-interface-to-custom-cgal-function

Sebastien.

On 9/6/19 4:35 PM, rahulverma88 wrote:

> Hi, I'm trying to build a python interface to a custom CGAL function. The
> function works just fine on its own, but I get errors when I try to do the
> linking with Python using SWIG.
>
> I have been using 'cgal_create_cmake_lists' to create the CMakeLists.txt for
> the CGAL part, doing cmake and make, and then using the generated .o files
> to link with SWIG, but I think I am not linking the required boost and GMP
> libraries properly with the SWIG-generated shared object ".so" file.
>
> SWIG generates the shared object files for me, but then when I try to import
> my module, I get an error:
>
> Symbol not found: __ZN4CGAL11NULL_VECTORE
>
> I am using the command "ld -bundle -flat_namespace -undefined suppress -o
> cgal_executable.so *.o"  to generate the shared object file. Should I be
> linking boost and GMP libraries in this step? If so, how do I do that? I am
> on a Mac OS. I can share my full code if needed.
>
> I know there is a project for Python-SWIG bindings, but I really don't need
> all of it, and also it seems to be missing a lot of useful CGAL features. I
> would like to work in C++, and just interface my functions with Python as
> needed.
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

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