2

If I understand correctly, the LGPL v2.1 (and the subsequent licenses) allow an user to link a proprietary program to the LGPL licensed library as long as the open source library can be modified and re-linked.

However, what happens if one wishes to link an LGPL software to a proprietary library? I am also confused about why LGPL treats everything as a library.

For example, there is a scientific software routinely used in my field, which is released under the LGPL v2.1. When compiled, the source code produces an executable (and also a library that other softwares can link to). Now, the software needs a BLAS and LAPACK routines, which can be provided by Intel MKL a.k.a. Math Kernel Library. However, Intel MKL is proprietary code. Their simplified software license does allow redistribution of everything (headers, static libraries, dynamic libraries).

Now the thing is that the scientific software does not provide precompiled binaries and only provides source code, which I think causes a lot of problems to beginners in the field. So, I want to distribute precompiled binaries of the software linked to Intel MKL (for free of course). The linking can be static or dynamic.

Am I allowed to do this? I am new to open source, so an explanation in simple words would be the most helpful.

There is another post here that is similar, but I do not understand how linking to the library and from the library are different. I have tried reading the LGPL v2.1 license, but there does not seem to be anything distinguishing them.

3

However, what happens if one wishes to link an LGPL software to a proprietary library?

The aim of the GPL (and to a slightly lesser extent the LGPL) is that a recipient of the (L)GPL-licensed code has the right to make changes to any part of the code. For that reason, the GPL stipulates that the entire project must conform to the terms and conditions of the GPL.

The LGPLv3 is an extension to the GPLv3 (and the LGPLv2.1 is a separate license with a similar change compared to the GPLv2) that adds an exception to the requirement that all code must follow the GPL terms and conditions. That exception is carefully written such that it is unidirectional and only gives the code that has a dependency on the LGPL code permission to remain non-free. The permission does not extend to dependencies of the LGPL code itself.

So, I want to distribute precompiled binaries of the software linked to Intel MKL (for free of course). The linking can be static or dynamic.

Am I allowed to do this?

It is not simple.

Without an additional exception to the LGPL license, you are not allowed to distribute a binary version of the software that depends on the Intel MKL. Such an exception is a change in the license and can only be given when all copyright holders agree with it. That might be a problem if the software depends on a third-party LGPL component.

However, if you use dynamic linking and your binary can work with a number of dynamically loaded/linked libraries providing the needed BLAS/LAPACK routines, and you provide multiple versions of that library (where some are under a GPL-compatible open-source license and some are not), then it is less clear-cut that your binary depends on code with a GPL-incompatible license.

As a side benefit, you can also serve people that don't use Intel hardware and thus can't benefit from the Intel MKL.


I am also confused about why LGPL treats everything as a library.

The LGPL license is intended to be used for software that is used as a sub-component in a larger software application. Those sub-components are typically libraries.

If your software is not intended to be used in a larger application, then the exception granted by the LGPL license does not have added value and you could just as easily use the GPL license.

1
  • 1
    We used a similar definition for OpenCL software in Debian -- there are free software implementations, which form a complete stack and can be distributed, so there is no dependency as such on closed source components. The user still needs a license for the required run-time linking, but that is usually handled by the rather liberal licensing of software using OpenCL. Aug 27 at 10:32
0

Probably yes. LGPL allows linking to a program with an incompatible license, and the keyword is "linking". If you are the copyright holder of your program, you can even publish it under the ordinary GPL with a written exception (https://www.gnu.org/licenses/gpl-faq.en.html#GPLIncompatibleLibs).

For the question of why LGPL is treating everything as library, I believe that's because of it was originally called "Library GPL" (now "Lesser GPL"), and was designed to be used on certain libraries. (https://www.gnu.org/licenses/why-not-lgpl.html)

However, if you are writing a very important program, that will be better to ask a lawyer.

3
  • Thank you!. I don't own the LGPL program, nor the library I am linking to. But the main issue I see is that once I link the program statically/dynamically, the source code of the LGPL program cannot be modified and relinked by the end-user. One of the things that LGPL mention is that the LGPL part of the executable has to be modifiable.
    – S R Maiti
    Aug 15 at 3:10
  • 1
    @SRMaiti If users cannot use your source code to modify and relink, that will not be acceptable by LGPL. But I'm just curious about why can't they redo your process of linking?
    – Moebie Wu
    Aug 15 at 10:34
  • Because for relinking, the header files(.h) and static libraries(.lib) of Intel MKL would be required. I believe the Intel's license allows distribution of those, but I would rather not go into that much trouble. Is it enough if I point to the link to download those libraries, headers etc. ? Intel MKL is completely free.
    – S R Maiti
    Aug 15 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.