Skip to content

Ensure shared library using MSYS2 for a commercial code #223

@a-jp

Description

@a-jp

Hi,

I'd like to use (unmodified) CppAD within a commercial closed source code that I distribute. To comply with EPL2.0 I must (for practical purposes) link to a shared library, as static libraries require me to provide a mechanism for the person at the other end to link to a different version of the cppad libraries if they wish, which is practically very challenging while keeping the source closed.

There is a section in the cmakelists:

IF( is_msys OR is_cygwin OR is_windows )
   IF( NOT cppad_static_lib )
      MESSAGE(WARNING
"This systems uses windows dynamic libraries.
The cppad library must be static for this case.
Ignoring fact that cppad_static_lib is FALSE.
"
      )
   ENDIF( )
   SET(is_cppad_lib_dynamic 0)
ELSE( )
   IF( cppad_static_lib )
      SET(is_cppad_lib_dynamic 0)
   ELSE( )
      SET(is_cppad_lib_dynamic 1)
   ENDIF( )
ENDIF( )

If I'm on MSYS2 and request cppad_static_lib to be false, it will be ignored. Is this something that can be reworked, to allow all cppad libs (including the bindings to ipopt also which I use) to be dynamic rather than static?

On a related note, I see on linux that a shared object will be built, but that libcppad_ipopt seems to always be a static library. Again, is this something that could be changed to always be dynamic?

Many thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions