CGAL, Maya, & Conflicting libgmp-10.dll's

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

CGAL, Maya, & Conflicting libgmp-10.dll's

Benjamin_Slack
Greetings,

I'm attempting to use CGAL to implement Schlomer's MaxMinDistance point sets
as part of a Maya Deformer plugin I'm working on. The algorithm uses nD
Delaunay Triangulation. I'm able to compile and execute the example code for
this package without issue. However, when attempting to incorporate the
Triangulation into my plugin classes, I ran into a problem.

It appears that Maya has its own copy of libgmp-10.dll and that copy isn't
compatible with the one supplied with CGAL. If I point the debugger at the
DLLs from Maya, the Triangulation dies with a memory access error after the
fourth point insertion. If I obfuscate Maya's DLL and use the CGAL supplied
one, I get ordinal errors as dependencies in the plugin DLLs load and fail.
I'm able to test my code successfully if I separate it from the Maya project
and compile it independently, just with CGAL.

Ideally, I would simply statically link GMP and CGAL into the plugin to
avoid the conflict. However, GMP is only supplied by the CGAL dev team on
Windows (the platform I'm working on) as a DLL. In addition, the GMP project
doesn't support an easy (CMAKE) based build of the library. The questions I
have for the group are two-fold: first, has anyone else in group done any
work with Maya and CGAL that could give me some pointers; and last, does
anyone in the group know a way to get static libraries for GMP (and likely
MPRI as that it's the other DLL dependency)?

Thanks in advance for your attention and time.

StackOverflow of issue:
https://stackoverflow.com/questions/52684803/memory-access-error-inserting-point-into-nd-delaunay-triangulation



--
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: CGAL, Maya, & Conflicting libgmp-10.dll's

andreas.fabri

Hello,

As GMP/Mpfr are a C libraries the CGAL project built them with gcc on Windows.

Note that GMP/Mpfr is under the LGPL, so static linkage is not an option
in case you distribute binaries of your plugin.

Note also that CGAL is under the GPL, so if you distribute binary you must also  
distribute your source code under the GPL.

Best,
Andreas

On 10/8/2018 4:26 AM, Benjamin_Slack wrote:
Greetings,

I'm attempting to use CGAL to implement Schlomer's MaxMinDistance point sets
as part of a Maya Deformer plugin I'm working on. The algorithm uses nD
Delaunay Triangulation. I'm able to compile and execute the example code for
this package without issue. However, when attempting to incorporate the
Triangulation into my plugin classes, I ran into a problem. 

It appears that Maya has its own copy of libgmp-10.dll and that copy isn't
compatible with the one supplied with CGAL. If I point the debugger at the
DLLs from Maya, the Triangulation dies with a memory access error after the
fourth point insertion. If I obfuscate Maya's DLL and use the CGAL supplied
one, I get ordinal errors as dependencies in the plugin DLLs load and fail.
I'm able to test my code successfully if I separate it from the Maya project
and compile it independently, just with CGAL. 

Ideally, I would simply statically link GMP and CGAL into the plugin to
avoid the conflict. However, GMP is only supplied by the CGAL dev team on
Windows (the platform I'm working on) as a DLL. In addition, the GMP project
doesn't support an easy (CMAKE) based build of the library. The questions I
have for the group are two-fold: first, has anyone else in group done any
work with Maya and CGAL that could give me some pointers; and last, does
anyone in the group know a way to get static libraries for GMP (and likely
MPRI as that it's the other DLL dependency)?

Thanks in advance for your attention and time.

StackOverflow of issue:
https://stackoverflow.com/questions/52684803/memory-access-error-inserting-point-into-nd-delaunay-triangulation



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


-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri
Reply | Threaded
Open this post in threaded view
|

Re: CGAL, Maya, & Conflicting libgmp-10.dll's

Benjamin_Slack
Andreas:

Releasing my source won't be an issue. It's a school project, not a
commercial one, so it'll release publicly on Github when I'm done with it. I
didn't intend to offer binaries, at least not immediately. I wasn't aware of
that facet of the LGPL though (no static linking). That's a bummer. I know
that other's have managed to use CGAL in Maya projects, so there must be
workarounds to deal with the conflicts. I'll keep looking. If anyone out
there has ideas, I'd appreciate the help.

-B



--
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: CGAL, Maya, & Conflicting libgmp-10.dll's

andreas.fabri



On 10/9/2018 2:51 AM, Benjamin_Slack wrote:
Andreas:

Releasing my source won't be an issue. It's a school project, not a
commercial one, so it'll release publicly on Github when I'm done with it. 
Great.
I
didn't intend to offer binaries, at least not immediately. I wasn't aware of
that facet of the LGPL though (no static linking). That's a bummer. I know
that other's have managed to use CGAL in Maya projects, so there must be
workarounds to deal with the conflicts. I'll keep looking. If anyone out
there has ideas, I'd appreciate the help.
I just discussed this with Laurent.  In order to use the gmp.dll coming with Maya
your plugin has to link with the gmp.lib (probably not) coming with Maya.

Best,
Andreas

-B



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


-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri
Reply | Threaded
Open this post in threaded view
|

Re: CGAL, Maya, & Conflicting libgmp-10.dll's

Benjamin_Slack
Andreas:

I had that thought as well. Unfortunately, as you surmised, Autodesk didn't
see fit to supply their lib stub for the DLLs in question in the devkit.
Thanks for the suggestion though.

-B



--
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: CGAL, Maya, & Conflicting libgmp-10.dll's

Sebastien Loriot (GeometryFactory)
Alternatively, you can try to disable the use of GMP in CGAL
by configuring CGAL with the cmake option  -DCGAL_DISABLE_GMP=ON

Sebastien.

On 10/09/2018 05:40 PM, Benjamin_Slack wrote:

> Andreas:
>
> I had that thought as well. Unfortunately, as you surmised, Autodesk didn't
> see fit to supply their lib stub for the DLLs in question in the devkit.
> Thanks for the suggestion though.
>
> -B
>
>
>
> --
> 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