JuliaMath / openlibm

High quality system independent, portable, open source libm implementation
https://openlibm.org
Other
507 stars 139 forks source link

Possible issues with Copyright. #264

Closed kargl closed 1 year ago

kargl commented 1 year ago

The Copyright notice at the top of s_sincos.c, s_sincosf.c, and s_sincosl.c is

 * ====================================================
 * Copyright (C) 2013 Elliot Saba. All rights reserved.
 *
 * Developed at the University of Washington.
 * Permission to use, copy, modify, and distribute this
 * software is freely granted, provided that this notice
 * is preserved.
 * ====================================================

The above files are a simple merging of files for the implementations of sin, sinf, sinl, cos, cosf, cosl, and their respective kernels into the files s_sincos.c, s_sincosf.c, and s_sincosl.c. All of these files include a Sun Microsystem Copyright , e.g.,

/* @(#)s_sin.c 5.1 93/09/24 */
/*
 * ====================================================
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
 *
 * Developed at SunPro, a Sun Microsystems, Inc. business.
 * Permission to use, copy, modify, and distribute this
 * software is freely granted, provided that this notice
 * is preserved.
 * ====================================================
 */

Yes, I know Sun Microsystem was bought out by Oracle decades ago. Simply re-arranging the original code should not affect the original Copyright. See the tops of FreeBSD's libm implementations of sincos[fl] for one way to possibly fix this.

kargl commented 1 year ago

Just checked s_sincosl.c more closely. This one is fine with Elliot Saba Copyright. However, the implementation details are poor. The current implementation make a call to both sinl(x) and cosl(x); thereby missing the benefit of doing argument reduction once instead of twice. One might learn something by looking at https://cgit.freebsd.org/src/tree/lib/msun/src/s_sincosl.c.

kargl commented 1 year ago

Unfortunately, github will not allow me to push a diff to address the Copyright. Here's the diff

diff --git a/src/s_sincos.c b/src/s_sincos.c
index 44a4a24..7ba5ce9 100644
--- a/src/s_sincos.c
+++ b/src/s_sincos.c
@@ -1,3 +1,21 @@
+/* @(#)s_sin.c 5.1 93/09/24 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * The above restores the original Copyright on the source code.
+ * This file combines and re-arranges the code form k_sin.c, k_cos.c,
+ * s_sin.c and s_cos.c.
+ */
+
 /* @(#)s_sincos.c 5.1 13/07/15 */
 /*
  * ====================================================
diff --git a/src/s_sincosf.c b/src/s_sincosf.c
index 09f35af..3bc0ec1 100644
--- a/src/s_sincosf.c
+++ b/src/s_sincosf.c
@@ -1,3 +1,41 @@
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/* k_cosf.c -- float version of k_cos.c
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ * Debugged and optimized by Bruce D. Evans.
+ */
+
+/* k_sinf.c -- float version of k_sin.c
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ * Optimized by Bruce D. Evans.
+ */
+
+/* s_sinf.c -- float version of s_sin.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ * Optimized by Bruce D. Evans.
+ */
+
+/* s_cosf.c -- float version of s_cos.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ * Optimized by Bruce D. Evans.
+ */
+
+/*
+ * The above restores the original Copyright on the source code, and the
+ * comments about the original conversions to float.
+ * This file combines and re-arranges the code form k_sinf.c, k_cosf.c,
+ * s_sinf.c and s_cosf.c.
+ */
+
 /* s_sincosf.c -- float version of s_sincos.c
  *
  * Copyright (C) 2013 Elliot Saba
ararslan commented 1 year ago

Unfortunately, github will not allow me to push a diff to address the Copyright. Here's the diff

Perhaps you already know but in case it's helpful, you can fork the repository to your account then push your change to your fork, then GitHub will automatically suggest that you open a pull request.

Using command line git, you can do:

git clone https://github.com/JuliaMath/openlibm.git
cd openlibm
git remote add kargl https://github.com/kargl/openlibm.git
git checkout -b fix-license
# apply your change
git push kargl fix-license

On push, a direct link for creating a pull request will be printed to the terminal. GitHub also provides their own command line wrapper atop git called gh that streamlines some of this process.

kargl commented 1 year ago

@ararslan, Thanks for the git pointers. I'm not a git user; other than I figured out how to use git clone, git diff, and git restore to remove my changes if I screw up. A proposed patch is in the audit trail here. More importantly, a Julia Computing sponsored piece of software seems to have a Copyright issue that needs to be addressed.

vtjnash commented 1 year ago

The copyright for all code here is at https://github.com/JuliaMath/openlibm/blob/master/LICENSE.md, and is already correct. Though it may still be helpful to make this accurate (vis-a-vis this issue), so that someone does not accidentally copy this file to their own repo without respecting the toplevel file, and thus incorrectly drop the required license text in the process.

kargl commented 1 year ago

@vtjnash. Well, no. LICENSE.md does not cover s_sincos.c and s_sincosf.c. These files have a Copyright that is not contained within LICENSE.md. Merging a few files with a Sun Microsystem Copyright into a new file and slightly re-arranging the contents likely does not amount to new work. See the diff I posted.

kargl commented 1 year ago

Well, after a bit of goggling, it seem that the individual claiming Copyright on the code is an employee of Julia Computing. Unfortunately, the only email address I can find is sales@juliacomputing.com. Not a good look to not fix this.