I'm developing a small closed source library in C++ for a small company using gcc. For the numerics part I need 128bit floating point arithmetics. This leads gcc to pull in libquadmath. As far as I know libquadmath is LGPL, which means that it should be distributed as source code along with my binary package. This leads to the following questions:

  1. Where do I get the sources from libquadmath? It seems that it is developed in the gcc project, which I would not consider to be a reasonable source package for this library.
  2. I'm using the library that is provided by the MinGW-w64 compiler of my linux distribution. How do I ensure to get the right sources?
  3. Are there alternatives that are easier to handle?
  • Libquadmath is in a subdirectory of gcc called 'libquadmath'. Is there a reason you can't just distribute that? I don't understand why you say "I would not consider to be a reasonable source package for this library." Note to comply with the source distribution, you must distribute the same version of the library you used (i.e. copying a libquadmath from elsewhere and trying to distribute that is not correct, if in fact you are distributing and using the libquadmath from GCC in your binary). – Brandin Mar 26 '18 at 11:19
  • It is hard to maintain. Actually I don't care which exact version of gcc I am using. For every machine there are different c compilers available and each of them has its own libquadmath. – Tobias Schlemmer Mar 26 '18 at 13:03
  • BTW. I don't compile GCC myself, and Debian doesn't provide the sources of libquadmath in a way that makes it easy to recompile the exactly same version as in the system. Strictly speaking it is GCC who is using libquadmath in order to implement a language feature. And this breaks the statement that you can distribute and license the binaries produced by GCC independently from the compiler. The are rare sources about the consequences of using 128bit floating point numbers in GCC. – Tobias Schlemmer Mar 26 '18 at 13:32
  • When you compile your program, copy the libquadmath sources into the destination distribution as part of the build process. Then you'll know its the same version that was used to compile that binary. There is a GCC Runtime Library exception that generally lets you release your binary without making it subject to GPL, but I have not seen the statement that this exception applies to libquadmath. It seems if you decide to supply libquadmath (in binary form, as part of your application), you'll need to adhere to its license. The fact that Debian does not make it easy could be seen as a Debian bug. – Brandin Mar 26 '18 at 13:56
  • It is not possible to simply copy the libquadmath sources for several reasons. One is that there is no source distribution that allows to copy easily. The other it has no independent build system. Actually if this is considered a bug, then it is a GCC bug. – Tobias Schlemmer Mar 27 '18 at 14:14

Your Answer

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

Browse other questions tagged or ask your own question.