tuwien-cms / xprec

Full quadruple precision (double-double) data type for numpy
MIT License
12 stars 4 forks source link

dd license clarification #12

Closed carlkl closed 5 months ago

carlkl commented 1 year ago

AFAIK the library for double-double arithmetic calculation isn't BSD licensed, see

https://www.davidhbailey.com/dhbsoftware/


IMPORTANT NOTE: David H. Bailey offers this software on this site as a convenience, 
but does NOT assume any responsibility for maintenance or managing appropriate usage. 
Please read this license document carefully before using:
[ LBNL-BSD-License.docx](https://www.davidhbailey.com/dhbsoftware/LBNL-BSD-License.docx). 
By downloading or using this software you are agreeing to the modified BSD license 
that is in this file. If you wish to use this software for any commercial purpose, please contact 
the Intellectual Property Office at the Lawrence Berkeley National Laboratory, ipo@lbl.gov.
mwallerb commented 1 year ago

Thanks a lot for catching this!

Since you seem to be more knowledgeable than me about this, would you mind looking at PR #13?

carlkl commented 1 year ago

Sorry for the late reply, quoting the modified LBNL-BSD licence is fine. However, if this;

If you wish to use this software for any commercial purpose, please contact the 
Intellectual Property Office at the Lawrence Berkeley National Laboratory, ipo@lbl.gov

is or is not a further restriction of the LBNL BSD license is unclear (I am not a lawyer). This should be clarified in any case IMHO.

Some years ago I sent this question to David Bailey per email but got no reply unfortunately.

mwallerb commented 1 year ago

Thanks for your reply and excellent question!

To my mind, what counts here is the license, but again, IANAL. The first part of the text seems to bear this out:

By downloading or using this software you are agreeing to the modified BSD license that is in this file.

But I agree that text is weird:

If you wish to use this software for any commercial purpose, please contact the Intellectual Property Office at the Lawrence Berkeley National Laboratory, ipo@lbl.gov

What is strange about this is that it does not actually specify any further restrictions. That, at least to me, suggests that he means if one wants some terms of the license waived, then one can write to that email address. Which, on the other hand, is also weird because BSD is not very strict in what it requires. I am confused ...

Which clarification do you have in mind? Some comment in the README?

mwallerb commented 1 year ago

OK, so I've also written an email, let's see if I am luckier in getting a reply ...

carlkl commented 1 year ago

I found that:

https://github.com/scibuilder/QD/blob/master/ChangeLog

commit bc70ea1f3c1fbbfc8cde28aa9f3b3fc75da13af4
Author: Yozo Hida <yozo@cs.berkeley.edu>
Date:   Fri Jan 6 20:41:28 2006 +0000

    Fix discrepancy in license.

    * The license is a modified BSD license, but some source had
      the "commercial use requires a license" blurb.  Removed.

As Yozo Hida is one of the authors of the qd library you may ask him as well.

carlkl commented 1 year ago

I just noticed, that Bailey' code is also included in scipy via the cephes code: https://github.com/scipy/scipy/tree/main/scipy/special/cephes The "commercial use requires a license" blurb is not mentioned here.

mwallerb commented 1 year ago

Hm, thanks for the research!

That's all a bit unsatisfactory, but if scipy is fine with not including the blurb, I think I am too ...

I am inclined to close this.

carlkl commented 1 year ago

I dig into this further. Unfortunately in every qd archive I could found there is a 'COPYING' file included with the commercial blurb.

rgommers commented 1 year ago

The Changelog file in https://github.com/scibuilder/QD has the full commit history. The C++ rewrite had the license updated to modified BSD in 2006 according to that changelog, and David Bailey committed to that same repo after that. So the older original F90 source having a non-commercial clause attached to it should not be relevant I'd think.

carlkl commented 1 year ago

I had also thought of this interpretation https://github.com/tuwien-cms/xprec/issues/12#issuecomment-1337253858, but I was not really sure if it happened that way. Anyway, they didn't use a clear way to define the license for the qd library.

mwallerb commented 1 year ago

@rgommers @carlkl Thanks a lot guys for digging into this!

I got a reply from David Bailey. From his remarks, he does seem to consider the non-commercial clause part of the license, so it seems we cannot simply "gloss over" that part :-(

He suggested we do a clean-room reimplementation of the library or contact the IPO office for clarification. He offered to help with reimplementing by digging up some old fortran library of his.

carlkl commented 1 year ago

This would be a really great help. Hopefully it is possible to convert the old Fortran sources to C++ with the forpy tool without too much effort.

carlkl commented 1 year ago

BTW: I wasn't able to contact Yozo Hida per email.

carlkl commented 1 year ago

@mwallerb, anything new about this?

BTW: I was able to compile Sleef (Sleef is boost licensed) locally on windows and create among other things an include file for inlinable scalar quad math functions. See Quad-precision math library reference and Using header files of inlinable functions. With the help of this include file I could compile some trivial test programs with mingw-w64 gcc (32-bit and 64-bit).

I guess the performance of the sleef quad-prec functions are considerable lower compared to double-double arithmetik though.

mwallerb commented 1 year ago

@carlkl No news from David Bailey.

I've started a clean-room re-implementation of QD in the cleanroom branch, but did not get very far yet.

Quad precision emulation is too slow, unfortunately :(

mwallerb commented 11 months ago

I have now completed the clean-room reimplementation of QD in the tuwien-cms/libxprec repository. What remains is to wire this up now to the python package.

carlkl commented 11 months ago

@mwallerb , thank you very much! I will test it as soon as I can on windows!