1From e63a6950dbebf4dd95e5c74c423c06fd65df5182 Mon Sep 17 00:00:00 2001 2From: =?UTF-8?q?Antonio=20S=C3=A1nchez?= <cantonios@google.com> 3Date: Wed, 8 Feb 2023 01:25:06 +0000 4Subject: [PATCH] Remove LGPL Code and references. 5 6Upstream-Status: Backport [https://gitlab.com/libeigen/eigen/-/commit/e256ad1823c2eddd6954241ddc99bfeb7bb29cb3] 7--- 8 COPYING.LGPL | 502 ------------------ 9 COPYING.README | 16 +- 10 Eigen/src/Core/util/NonMPL2.h | 3 - 11 .../IncompleteCholesky.h | 3 +- 12 bench/tensors/eigen_sycl_bench.sh | 1 - 13 bench/tensors/eigen_sycl_bench_contract.sh | 2 +- 14 doc/PreprocessorDirectives.dox | 3 - 15 test/CMakeLists.txt | 1 - 16 test/mpl2only.cpp | 24 - 17 unsupported/Eigen/IterativeSolvers | 6 - 18 .../IterativeSolvers/ConstrainedConjGrad.h | 187 ------- 19 .../IterativeSolvers/IterationController.h | 154 ------ 20 12 files changed, 4 insertions(+), 898 deletions(-) 21 delete mode 100644 COPYING.LGPL 22 delete mode 100644 Eigen/src/Core/util/NonMPL2.h 23 delete mode 100644 test/mpl2only.cpp 24 delete mode 100644 unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h 25 delete mode 100644 unsupported/Eigen/src/IterativeSolvers/IterationController.h 26 27diff --git a/COPYING.LGPL b/COPYING.LGPL 28deleted file mode 100644 29index 4362b4915..000000000 30--- a/COPYING.LGPL 31+++ /dev/null 32@@ -1,502 +0,0 @@ 33- GNU LESSER GENERAL PUBLIC LICENSE 34- Version 2.1, February 1999 35- 36- Copyright (C) 1991, 1999 Free Software Foundation, Inc. 37- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 38- Everyone is permitted to copy and distribute verbatim copies 39- of this license document, but changing it is not allowed. 40- 41-[This is the first released version of the Lesser GPL. It also counts 42- as the successor of the GNU Library Public License, version 2, hence 43- the version number 2.1.] 44- 45- Preamble 46- 47- The licenses for most software are designed to take away your 48-freedom to share and change it. By contrast, the GNU General Public 49-Licenses are intended to guarantee your freedom to share and change 50-free software--to make sure the software is free for all its users. 51- 52- This license, the Lesser General Public License, applies to some 53-specially designated software packages--typically libraries--of the 54-Free Software Foundation and other authors who decide to use it. You 55-can use it too, but we suggest you first think carefully about whether 56-this license or the ordinary General Public License is the better 57-strategy to use in any particular case, based on the explanations below. 58- 59- When we speak of free software, we are referring to freedom of use, 60-not price. Our General Public Licenses are designed to make sure that 61-you have the freedom to distribute copies of free software (and charge 62-for this service if you wish); that you receive source code or can get 63-it if you want it; that you can change the software and use pieces of 64-it in new free programs; and that you are informed that you can do 65-these things. 66- 67- To protect your rights, we need to make restrictions that forbid 68-distributors to deny you these rights or to ask you to surrender these 69-rights. These restrictions translate to certain responsibilities for 70-you if you distribute copies of the library or if you modify it. 71- 72- For example, if you distribute copies of the library, whether gratis 73-or for a fee, you must give the recipients all the rights that we gave 74-you. You must make sure that they, too, receive or can get the source 75-code. If you link other code with the library, you must provide 76-complete object files to the recipients, so that they can relink them 77-with the library after making changes to the library and recompiling 78-it. And you must show them these terms so they know their rights. 79- 80- We protect your rights with a two-step method: (1) we copyright the 81-library, and (2) we offer you this license, which gives you legal 82-permission to copy, distribute and/or modify the library. 83- 84- To protect each distributor, we want to make it very clear that 85-there is no warranty for the free library. Also, if the library is 86-modified by someone else and passed on, the recipients should know 87-that what they have is not the original version, so that the original 88-author's reputation will not be affected by problems that might be 89-introduced by others. 90- 91- Finally, software patents pose a constant threat to the existence of 92-any free program. We wish to make sure that a company cannot 93-effectively restrict the users of a free program by obtaining a 94-restrictive license from a patent holder. Therefore, we insist that 95-any patent license obtained for a version of the library must be 96-consistent with the full freedom of use specified in this license. 97- 98- Most GNU software, including some libraries, is covered by the 99-ordinary GNU General Public License. This license, the GNU Lesser 100-General Public License, applies to certain designated libraries, and 101-is quite different from the ordinary General Public License. We use 102-this license for certain libraries in order to permit linking those 103-libraries into non-free programs. 104- 105- When a program is linked with a library, whether statically or using 106-a shared library, the combination of the two is legally speaking a 107-combined work, a derivative of the original library. The ordinary 108-General Public License therefore permits such linking only if the 109-entire combination fits its criteria of freedom. The Lesser General 110-Public License permits more lax criteria for linking other code with 111-the library. 112- 113- We call this license the "Lesser" General Public License because it 114-does Less to protect the user's freedom than the ordinary General 115-Public License. It also provides other free software developers Less 116-of an advantage over competing non-free programs. These disadvantages 117-are the reason we use the ordinary General Public License for many 118-libraries. However, the Lesser license provides advantages in certain 119-special circumstances. 120- 121- For example, on rare occasions, there may be a special need to 122-encourage the widest possible use of a certain library, so that it becomes 123-a de-facto standard. To achieve this, non-free programs must be 124-allowed to use the library. A more frequent case is that a free 125-library does the same job as widely used non-free libraries. In this 126-case, there is little to gain by limiting the free library to free 127-software only, so we use the Lesser General Public License. 128- 129- In other cases, permission to use a particular library in non-free 130-programs enables a greater number of people to use a large body of 131-free software. For example, permission to use the GNU C Library in 132-non-free programs enables many more people to use the whole GNU 133-operating system, as well as its variant, the GNU/Linux operating 134-system. 135- 136- Although the Lesser General Public License is Less protective of the 137-users' freedom, it does ensure that the user of a program that is 138-linked with the Library has the freedom and the wherewithal to run 139-that program using a modified version of the Library. 140- 141- The precise terms and conditions for copying, distribution and 142-modification follow. Pay close attention to the difference between a 143-"work based on the library" and a "work that uses the library". The 144-former contains code derived from the library, whereas the latter must 145-be combined with the library in order to run. 146- 147- GNU LESSER GENERAL PUBLIC LICENSE 148- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 149- 150- 0. This License Agreement applies to any software library or other 151-program which contains a notice placed by the copyright holder or 152-other authorized party saying it may be distributed under the terms of 153-this Lesser General Public License (also called "this License"). 154-Each licensee is addressed as "you". 155- 156- A "library" means a collection of software functions and/or data 157-prepared so as to be conveniently linked with application programs 158-(which use some of those functions and data) to form executables. 159- 160- The "Library", below, refers to any such software library or work 161-which has been distributed under these terms. A "work based on the 162-Library" means either the Library or any derivative work under 163-copyright law: that is to say, a work containing the Library or a 164-portion of it, either verbatim or with modifications and/or translated 165-straightforwardly into another language. (Hereinafter, translation is 166-included without limitation in the term "modification".) 167- 168- "Source code" for a work means the preferred form of the work for 169-making modifications to it. For a library, complete source code means 170-all the source code for all modules it contains, plus any associated 171-interface definition files, plus the scripts used to control compilation 172-and installation of the library. 173- 174- Activities other than copying, distribution and modification are not 175-covered by this License; they are outside its scope. The act of 176-running a program using the Library is not restricted, and output from 177-such a program is covered only if its contents constitute a work based 178-on the Library (independent of the use of the Library in a tool for 179-writing it). Whether that is true depends on what the Library does 180-and what the program that uses the Library does. 181- 182- 1. You may copy and distribute verbatim copies of the Library's 183-complete source code as you receive it, in any medium, provided that 184-you conspicuously and appropriately publish on each copy an 185-appropriate copyright notice and disclaimer of warranty; keep intact 186-all the notices that refer to this License and to the absence of any 187-warranty; and distribute a copy of this License along with the 188-Library. 189- 190- You may charge a fee for the physical act of transferring a copy, 191-and you may at your option offer warranty protection in exchange for a 192-fee. 193- 194- 2. You may modify your copy or copies of the Library or any portion 195-of it, thus forming a work based on the Library, and copy and 196-distribute such modifications or work under the terms of Section 1 197-above, provided that you also meet all of these conditions: 198- 199- a) The modified work must itself be a software library. 200- 201- b) You must cause the files modified to carry prominent notices 202- stating that you changed the files and the date of any change. 203- 204- c) You must cause the whole of the work to be licensed at no 205- charge to all third parties under the terms of this License. 206- 207- d) If a facility in the modified Library refers to a function or a 208- table of data to be supplied by an application program that uses 209- the facility, other than as an argument passed when the facility 210- is invoked, then you must make a good faith effort to ensure that, 211- in the event an application does not supply such function or 212- table, the facility still operates, and performs whatever part of 213- its purpose remains meaningful. 214- 215- (For example, a function in a library to compute square roots has 216- a purpose that is entirely well-defined independent of the 217- application. Therefore, Subsection 2d requires that any 218- application-supplied function or table used by this function must 219- be optional: if the application does not supply it, the square 220- root function must still compute square roots.) 221- 222-These requirements apply to the modified work as a whole. If 223-identifiable sections of that work are not derived from the Library, 224-and can be reasonably considered independent and separate works in 225-themselves, then this License, and its terms, do not apply to those 226-sections when you distribute them as separate works. But when you 227-distribute the same sections as part of a whole which is a work based 228-on the Library, the distribution of the whole must be on the terms of 229-this License, whose permissions for other licensees extend to the 230-entire whole, and thus to each and every part regardless of who wrote 231-it. 232- 233-Thus, it is not the intent of this section to claim rights or contest 234-your rights to work written entirely by you; rather, the intent is to 235-exercise the right to control the distribution of derivative or 236-collective works based on the Library. 237- 238-In addition, mere aggregation of another work not based on the Library 239-with the Library (or with a work based on the Library) on a volume of 240-a storage or distribution medium does not bring the other work under 241-the scope of this License. 242- 243- 3. You may opt to apply the terms of the ordinary GNU General Public 244-License instead of this License to a given copy of the Library. To do 245-this, you must alter all the notices that refer to this License, so 246-that they refer to the ordinary GNU General Public License, version 2, 247-instead of to this License. (If a newer version than version 2 of the 248-ordinary GNU General Public License has appeared, then you can specify 249-that version instead if you wish.) Do not make any other change in 250-these notices. 251- 252- Once this change is made in a given copy, it is irreversible for 253-that copy, so the ordinary GNU General Public License applies to all 254-subsequent copies and derivative works made from that copy. 255- 256- This option is useful when you wish to copy part of the code of 257-the Library into a program that is not a library. 258- 259- 4. You may copy and distribute the Library (or a portion or 260-derivative of it, under Section 2) in object code or executable form 261-under the terms of Sections 1 and 2 above provided that you accompany 262-it with the complete corresponding machine-readable source code, which 263-must be distributed under the terms of Sections 1 and 2 above on a 264-medium customarily used for software interchange. 265- 266- If distribution of object code is made by offering access to copy 267-from a designated place, then offering equivalent access to copy the 268-source code from the same place satisfies the requirement to 269-distribute the source code, even though third parties are not 270-compelled to copy the source along with the object code. 271- 272- 5. A program that contains no derivative of any portion of the 273-Library, but is designed to work with the Library by being compiled or 274-linked with it, is called a "work that uses the Library". Such a 275-work, in isolation, is not a derivative work of the Library, and 276-therefore falls outside the scope of this License. 277- 278- However, linking a "work that uses the Library" with the Library 279-creates an executable that is a derivative of the Library (because it 280-contains portions of the Library), rather than a "work that uses the 281-library". The executable is therefore covered by this License. 282-Section 6 states terms for distribution of such executables. 283- 284- When a "work that uses the Library" uses material from a header file 285-that is part of the Library, the object code for the work may be a 286-derivative work of the Library even though the source code is not. 287-Whether this is true is especially significant if the work can be 288-linked without the Library, or if the work is itself a library. The 289-threshold for this to be true is not precisely defined by law. 290- 291- If such an object file uses only numerical parameters, data 292-structure layouts and accessors, and small macros and small inline 293-functions (ten lines or less in length), then the use of the object 294-file is unrestricted, regardless of whether it is legally a derivative 295-work. (Executables containing this object code plus portions of the 296-Library will still fall under Section 6.) 297- 298- Otherwise, if the work is a derivative of the Library, you may 299-distribute the object code for the work under the terms of Section 6. 300-Any executables containing that work also fall under Section 6, 301-whether or not they are linked directly with the Library itself. 302- 303- 6. As an exception to the Sections above, you may also combine or 304-link a "work that uses the Library" with the Library to produce a 305-work containing portions of the Library, and distribute that work 306-under terms of your choice, provided that the terms permit 307-modification of the work for the customer's own use and reverse 308-engineering for debugging such modifications. 309- 310- You must give prominent notice with each copy of the work that the 311-Library is used in it and that the Library and its use are covered by 312-this License. You must supply a copy of this License. If the work 313-during execution displays copyright notices, you must include the 314-copyright notice for the Library among them, as well as a reference 315-directing the user to the copy of this License. Also, you must do one 316-of these things: 317- 318- a) Accompany the work with the complete corresponding 319- machine-readable source code for the Library including whatever 320- changes were used in the work (which must be distributed under 321- Sections 1 and 2 above); and, if the work is an executable linked 322- with the Library, with the complete machine-readable "work that 323- uses the Library", as object code and/or source code, so that the 324- user can modify the Library and then relink to produce a modified 325- executable containing the modified Library. (It is understood 326- that the user who changes the contents of definitions files in the 327- Library will not necessarily be able to recompile the application 328- to use the modified definitions.) 329- 330- b) Use a suitable shared library mechanism for linking with the 331- Library. A suitable mechanism is one that (1) uses at run time a 332- copy of the library already present on the user's computer system, 333- rather than copying library functions into the executable, and (2) 334- will operate properly with a modified version of the library, if 335- the user installs one, as long as the modified version is 336- interface-compatible with the version that the work was made with. 337- 338- c) Accompany the work with a written offer, valid for at 339- least three years, to give the same user the materials 340- specified in Subsection 6a, above, for a charge no more 341- than the cost of performing this distribution. 342- 343- d) If distribution of the work is made by offering access to copy 344- from a designated place, offer equivalent access to copy the above 345- specified materials from the same place. 346- 347- e) Verify that the user has already received a copy of these 348- materials or that you have already sent this user a copy. 349- 350- For an executable, the required form of the "work that uses the 351-Library" must include any data and utility programs needed for 352-reproducing the executable from it. However, as a special exception, 353-the materials to be distributed need not include anything that is 354-normally distributed (in either source or binary form) with the major 355-components (compiler, kernel, and so on) of the operating system on 356-which the executable runs, unless that component itself accompanies 357-the executable. 358- 359- It may happen that this requirement contradicts the license 360-restrictions of other proprietary libraries that do not normally 361-accompany the operating system. Such a contradiction means you cannot 362-use both them and the Library together in an executable that you 363-distribute. 364- 365- 7. You may place library facilities that are a work based on the 366-Library side-by-side in a single library together with other library 367-facilities not covered by this License, and distribute such a combined 368-library, provided that the separate distribution of the work based on 369-the Library and of the other library facilities is otherwise 370-permitted, and provided that you do these two things: 371- 372- a) Accompany the combined library with a copy of the same work 373- based on the Library, uncombined with any other library 374- facilities. This must be distributed under the terms of the 375- Sections above. 376- 377- b) Give prominent notice with the combined library of the fact 378- that part of it is a work based on the Library, and explaining 379- where to find the accompanying uncombined form of the same work. 380- 381- 8. You may not copy, modify, sublicense, link with, or distribute 382-the Library except as expressly provided under this License. Any 383-attempt otherwise to copy, modify, sublicense, link with, or 384-distribute the Library is void, and will automatically terminate your 385-rights under this License. However, parties who have received copies, 386-or rights, from you under this License will not have their licenses 387-terminated so long as such parties remain in full compliance. 388- 389- 9. You are not required to accept this License, since you have not 390-signed it. However, nothing else grants you permission to modify or 391-distribute the Library or its derivative works. These actions are 392-prohibited by law if you do not accept this License. Therefore, by 393-modifying or distributing the Library (or any work based on the 394-Library), you indicate your acceptance of this License to do so, and 395-all its terms and conditions for copying, distributing or modifying 396-the Library or works based on it. 397- 398- 10. Each time you redistribute the Library (or any work based on the 399-Library), the recipient automatically receives a license from the 400-original licensor to copy, distribute, link with or modify the Library 401-subject to these terms and conditions. You may not impose any further 402-restrictions on the recipients' exercise of the rights granted herein. 403-You are not responsible for enforcing compliance by third parties with 404-this License. 405- 406- 11. If, as a consequence of a court judgment or allegation of patent 407-infringement or for any other reason (not limited to patent issues), 408-conditions are imposed on you (whether by court order, agreement or 409-otherwise) that contradict the conditions of this License, they do not 410-excuse you from the conditions of this License. If you cannot 411-distribute so as to satisfy simultaneously your obligations under this 412-License and any other pertinent obligations, then as a consequence you 413-may not distribute the Library at all. For example, if a patent 414-license would not permit royalty-free redistribution of the Library by 415-all those who receive copies directly or indirectly through you, then 416-the only way you could satisfy both it and this License would be to 417-refrain entirely from distribution of the Library. 418- 419-If any portion of this section is held invalid or unenforceable under any 420-particular circumstance, the balance of the section is intended to apply, 421-and the section as a whole is intended to apply in other circumstances. 422- 423-It is not the purpose of this section to induce you to infringe any 424-patents or other property right claims or to contest validity of any 425-such claims; this section has the sole purpose of protecting the 426-integrity of the free software distribution system which is 427-implemented by public license practices. Many people have made 428-generous contributions to the wide range of software distributed 429-through that system in reliance on consistent application of that 430-system; it is up to the author/donor to decide if he or she is willing 431-to distribute software through any other system and a licensee cannot 432-impose that choice. 433- 434-This section is intended to make thoroughly clear what is believed to 435-be a consequence of the rest of this License. 436- 437- 12. If the distribution and/or use of the Library is restricted in 438-certain countries either by patents or by copyrighted interfaces, the 439-original copyright holder who places the Library under this License may add 440-an explicit geographical distribution limitation excluding those countries, 441-so that distribution is permitted only in or among countries not thus 442-excluded. In such case, this License incorporates the limitation as if 443-written in the body of this License. 444- 445- 13. The Free Software Foundation may publish revised and/or new 446-versions of the Lesser General Public License from time to time. 447-Such new versions will be similar in spirit to the present version, 448-but may differ in detail to address new problems or concerns. 449- 450-Each version is given a distinguishing version number. If the Library 451-specifies a version number of this License which applies to it and 452-"any later version", you have the option of following the terms and 453-conditions either of that version or of any later version published by 454-the Free Software Foundation. If the Library does not specify a 455-license version number, you may choose any version ever published by 456-the Free Software Foundation. 457- 458- 14. If you wish to incorporate parts of the Library into other free 459-programs whose distribution conditions are incompatible with these, 460-write to the author to ask for permission. For software which is 461-copyrighted by the Free Software Foundation, write to the Free 462-Software Foundation; we sometimes make exceptions for this. Our 463-decision will be guided by the two goals of preserving the free status 464-of all derivatives of our free software and of promoting the sharing 465-and reuse of software generally. 466- 467- NO WARRANTY 468- 469- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 470-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 471-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 472-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 473-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 474-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 475-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 476-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 477-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 478- 479- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 480-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 481-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 482-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 483-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 484-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 485-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 486-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 487-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 488-DAMAGES. 489- 490- END OF TERMS AND CONDITIONS 491- 492- How to Apply These Terms to Your New Libraries 493- 494- If you develop a new library, and you want it to be of the greatest 495-possible use to the public, we recommend making it free software that 496-everyone can redistribute and change. You can do so by permitting 497-redistribution under these terms (or, alternatively, under the terms of the 498-ordinary General Public License). 499- 500- To apply these terms, attach the following notices to the library. It is 501-safest to attach them to the start of each source file to most effectively 502-convey the exclusion of warranty; and each file should have at least the 503-"copyright" line and a pointer to where the full notice is found. 504- 505- <one line to give the library's name and a brief idea of what it does.> 506- Copyright (C) <year> <name of author> 507- 508- This library is free software; you can redistribute it and/or 509- modify it under the terms of the GNU Lesser General Public 510- License as published by the Free Software Foundation; either 511- version 2.1 of the License, or (at your option) any later version. 512- 513- This library is distributed in the hope that it will be useful, 514- but WITHOUT ANY WARRANTY; without even the implied warranty of 515- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 516- Lesser General Public License for more details. 517- 518- You should have received a copy of the GNU Lesser General Public 519- License along with this library; if not, write to the Free Software 520- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 521- 522-Also add information on how to contact you by electronic and paper mail. 523- 524-You should also get your employer (if you work as a programmer) or your 525-school, if any, to sign a "copyright disclaimer" for the library, if 526-necessary. Here is a sample; alter the names: 527- 528- Yoyodyne, Inc., hereby disclaims all copyright interest in the 529- library `Frob' (a library for tweaking knobs) written by James Random Hacker. 530- 531- <signature of Ty Coon>, 1 April 1990 532- Ty Coon, President of Vice 533- 534-That's all there is to it! 535diff --git a/COPYING.README b/COPYING.README 536index de5b63215..11af93ca7 100644 537--- a/COPYING.README 538+++ b/COPYING.README 539@@ -2,17 +2,5 @@ Eigen is primarily MPL2 licensed. See COPYING.MPL2 and these links: 540 http://www.mozilla.org/MPL/2.0/ 541 http://www.mozilla.org/MPL/2.0/FAQ.html 542 543-Some files contain third-party code under BSD or LGPL licenses, whence the other 544-COPYING.* files here. 545- 546-All the LGPL code is either LGPL 2.1-only, or LGPL 2.1-or-later. 547-For this reason, the COPYING.LGPL file contains the LGPL 2.1 text. 548- 549-If you want to guarantee that the Eigen code that you are #including is licensed 550-under the MPL2 and possibly more permissive licenses (like BSD), #define this 551-preprocessor symbol: 552- EIGEN_MPL2_ONLY 553-For example, with most compilers, you could add this to your project CXXFLAGS: 554- -DEIGEN_MPL2_ONLY 555-This will cause a compilation error to be generated if you #include any code that is 556-LGPL licensed. 557+Some files contain third-party code under BSD or other MPL2-compatible licenses, 558+whence the other COPYING.* files here. 559\ No newline at end of file 560diff --git a/Eigen/src/Core/util/NonMPL2.h b/Eigen/src/Core/util/NonMPL2.h 561deleted file mode 100644 562index 1af67cf18..000000000 563--- a/Eigen/src/Core/util/NonMPL2.h 564+++ /dev/null 565@@ -1,3 +0,0 @@ 566-#ifdef EIGEN_MPL2_ONLY 567-#error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 568-#endif 569diff --git a/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h b/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h 570index 7803fd817..1a5d7faeb 100644 571--- a/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h 572+++ b/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h 573@@ -24,8 +24,7 @@ namespace Eigen { 574 * \tparam Scalar the scalar type of the input matrices 575 * \tparam _UpLo The triangular part that will be used for the computations. It can be Lower 576 * or Upper. Default is Lower. 577- * \tparam _OrderingType The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<int>, 578- * unless EIGEN_MPL2_ONLY is defined, in which case the default is NaturalOrdering<int>. 579+ * \tparam _OrderingType The ordering method to use, either AMDOrdering<> or NaturalOrdering<>. Default is AMDOrdering<int>. 580 * 581 * \implsparsesolverconcept 582 * 583diff --git a/bench/tensors/eigen_sycl_bench.sh b/bench/tensors/eigen_sycl_bench.sh 584index 3f67b3d86..4cb8f7be4 100755 585--- a/bench/tensors/eigen_sycl_bench.sh 586+++ b/bench/tensors/eigen_sycl_bench.sh 587@@ -10,7 +10,6 @@ benchmark_main.cc \ 588 -march=native \ 589 -O3 \ 590 -DNDEBUG \ 591--DEIGEN_MPL2_ONLY \ 592 -DEIGEN_USE_SYCL=1 \ 593 -DEIGEN_SYCL_LOCAL_MEM=1 \ 594 -no-serial-memop \ 595diff --git a/bench/tensors/eigen_sycl_bench_contract.sh b/bench/tensors/eigen_sycl_bench_contract.sh 596index 73fd6c4a0..3ab0138a1 100644 597--- a/bench/tensors/eigen_sycl_bench_contract.sh 598+++ b/bench/tensors/eigen_sycl_bench_contract.sh 599@@ -1,7 +1,7 @@ 600 rm -f tensor_contract_sycl_bench 601 : "${COMPUTECPP_PACKAGE_ROOT_DIR:?Need to set COMPUTECPP_PACKAGE_ROOT_DIR}" 602 echo "COMPUTECPP_PACKAGE_ROOT_DIR is set to: "$COMPUTECPP_PACKAGE_ROOT_DIR 603-${COMPUTECPP_PACKAGE_ROOT_DIR}/bin/compute++ tensor_contract_sycl_bench.cc -I ../../ -I ${COMPUTECPP_PACKAGE_ROOT_DIR}/include/ -std=c++11 -O3 -DNDEBUG -DEIGEN_MPL2_ONLY -DEIGEN_USE_SYCL=1 -no-serial-memop -mllvm -inline-threshold=10000 -fsycl-ih-last -sycl-driver -Xclang -cl-mad-enable -lOpenCL -lComputeCpp -lpthread -o tensor_contract_sycl_bench ${@:1} 604+${COMPUTECPP_PACKAGE_ROOT_DIR}/bin/compute++ tensor_contract_sycl_bench.cc -I ../../ -I ${COMPUTECPP_PACKAGE_ROOT_DIR}/include/ -std=c++11 -O3 -DNDEBUG -DEIGEN_USE_SYCL=1 -no-serial-memop -mllvm -inline-threshold=10000 -fsycl-ih-last -sycl-driver -Xclang -cl-mad-enable -lOpenCL -lComputeCpp -lpthread -o tensor_contract_sycl_bench ${@:1} 605 export LD_LIBRARY_PATH=${COMPUTECPP_PACKAGE_ROOT_DIR}/lib:$LD_LIBRARY_PATH 606 ./tensor_contract_sycl_bench 607 608diff --git a/doc/PreprocessorDirectives.dox b/doc/PreprocessorDirectives.dox 609index 0f545b086..b7d59ccbc 100644 610--- a/doc/PreprocessorDirectives.dox 611+++ b/doc/PreprocessorDirectives.dox 612@@ -92,9 +92,6 @@ run time. However, these assertions do cost time and can thus be turned off. 613 - \b eigen_assert - macro with one argument that is used inside %Eigen for assertions. By default, it is 614 basically defined to be \c assert, which aborts the program if the assertion is violated. Redefine this 615 macro if you want to do something else, like throwing an exception. 616- - \b EIGEN_MPL2_ONLY - disable non MPL2 compatible features, or in other words disable the features which 617- are still under the LGPL. 618- 619 620 \section TopicPreprocessorDirectivesPerformance Alignment, vectorization and performance tweaking 621 622diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt 623index 5136f82aa..9f557743a 100644 624--- a/test/CMakeLists.txt 625+++ b/test/CMakeLists.txt 626@@ -277,7 +277,6 @@ ei_add_test(special_numbers) 627 ei_add_test(rvalue_types) 628 ei_add_test(dense_storage) 629 ei_add_test(ctorleak) 630-ei_add_test(mpl2only) 631 ei_add_test(inplace_decomposition) 632 ei_add_test(half_float) 633 ei_add_test(bfloat16_float) 634diff --git a/test/mpl2only.cpp b/test/mpl2only.cpp 635deleted file mode 100644 636index 296350d08..000000000 637--- a/test/mpl2only.cpp 638+++ /dev/null 639@@ -1,24 +0,0 @@ 640-// This file is part of Eigen, a lightweight C++ template library 641-// for linear algebra. 642-// 643-// Copyright (C) 2015 Gael Guennebaud <gael.guennebaud@inria.fr> 644-// 645-// This Source Code Form is subject to the terms of the Mozilla 646-// Public License v. 2.0. If a copy of the MPL was not distributed 647-// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 648- 649-#ifndef EIGEN_MPL2_ONLY 650-#define EIGEN_MPL2_ONLY 651-#endif 652-#include <Eigen/Dense> 653-#include <Eigen/SparseCore> 654-#include <Eigen/SparseLU> 655-#include <Eigen/SparseQR> 656-#include <Eigen/Sparse> 657-#include <Eigen/IterativeLinearSolvers> 658-#include <Eigen/Eigen> 659- 660-int main() 661-{ 662- return 0; 663-} 664diff --git a/unsupported/Eigen/IterativeSolvers b/unsupported/Eigen/IterativeSolvers 665index a3f58d676..f045fb607 100644 666--- a/unsupported/Eigen/IterativeSolvers 667+++ b/unsupported/Eigen/IterativeSolvers 668@@ -19,7 +19,6 @@ 669 * \defgroup IterativeLinearSolvers_Module Iterative solvers module 670 * This module aims to provide various iterative linear and non linear solver algorithms. 671 * It currently provides: 672- * - a constrained conjugate gradient 673 * - a Householder GMRES implementation 674 * - an IDR(s) implementation 675 * - a DGMRES implementation 676@@ -33,11 +32,6 @@ 677 678 #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 679 680-#ifndef EIGEN_MPL2_ONLY 681-#include "src/IterativeSolvers/IterationController.h" 682-#include "src/IterativeSolvers/ConstrainedConjGrad.h" 683-#endif 684- 685 #include "src/IterativeSolvers/IncompleteLU.h" 686 #include "src/IterativeSolvers/GMRES.h" 687 #include "src/IterativeSolvers/DGMRES.h" 688diff --git a/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h b/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h 689deleted file mode 100644 690index e7d70f39d..000000000 691--- a/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h 692+++ /dev/null 693@@ -1,187 +0,0 @@ 694-// This file is part of Eigen, a lightweight C++ template library 695-// for linear algebra. 696-// 697-// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr> 698- 699-/* NOTE The functions of this file have been adapted from the GMM++ library */ 700- 701-//======================================================================== 702-// 703-// Copyright (C) 2002-2007 Yves Renard 704-// 705-// This file is a part of GETFEM++ 706-// 707-// Getfem++ is free software; you can redistribute it and/or modify 708-// it under the terms of the GNU Lesser General Public License as 709-// published by the Free Software Foundation; version 2.1 of the License. 710-// 711-// This program is distributed in the hope that it will be useful, 712-// but WITHOUT ANY WARRANTY; without even the implied warranty of 713-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 714-// GNU Lesser General Public License for more details. 715-// You should have received a copy of the GNU Lesser General Public 716-// License along with this program; if not, write to the Free Software 717-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 718-// USA. 719-// 720-//======================================================================== 721- 722-#include "../../../../Eigen/src/Core/util/NonMPL2.h" 723- 724-#ifndef EIGEN_CONSTRAINEDCG_H 725-#define EIGEN_CONSTRAINEDCG_H 726- 727-#include "../../../../Eigen/Core" 728- 729-namespace Eigen { 730- 731-namespace internal { 732- 733-/** \ingroup IterativeLinearSolvers_Module 734- * Compute the pseudo inverse of the non-square matrix C such that 735- * \f$ CINV = (C * C^T)^{-1} * C \f$ based on a conjugate gradient method. 736- * 737- * This function is internally used by constrained_cg. 738- */ 739-template <typename CMatrix, typename CINVMatrix> 740-void pseudo_inverse(const CMatrix &C, CINVMatrix &CINV) 741-{ 742- // optimisable : copie de la ligne, precalcul de C * trans(C). 743- typedef typename CMatrix::Scalar Scalar; 744- typedef typename CMatrix::Index Index; 745- // FIXME use sparse vectors ? 746- typedef Matrix<Scalar,Dynamic,1> TmpVec; 747- 748- Index rows = C.rows(), cols = C.cols(); 749- 750- TmpVec d(rows), e(rows), l(cols), p(rows), q(rows), r(rows); 751- Scalar rho, rho_1, alpha; 752- d.setZero(); 753- 754- typedef Triplet<double> T; 755- std::vector<T> tripletList; 756- 757- for (Index i = 0; i < rows; ++i) 758- { 759- d[i] = 1.0; 760- rho = 1.0; 761- e.setZero(); 762- r = d; 763- p = d; 764- 765- while (rho >= 1e-38) 766- { /* conjugate gradient to compute e */ 767- /* which is the i-th row of inv(C * trans(C)) */ 768- l = C.transpose() * p; 769- q = C * l; 770- alpha = rho / p.dot(q); 771- e += alpha * p; 772- r += -alpha * q; 773- rho_1 = rho; 774- rho = r.dot(r); 775- p = (rho/rho_1) * p + r; 776- } 777- 778- l = C.transpose() * e; // l is the i-th row of CINV 779- // FIXME add a generic "prune/filter" expression for both dense and sparse object to sparse 780- for (Index j=0; j<l.size(); ++j) 781- if (l[j]<1e-15) 782- tripletList.push_back(T(i,j,l(j))); 783- 784- 785- d[i] = 0.0; 786- } 787- CINV.setFromTriplets(tripletList.begin(), tripletList.end()); 788-} 789- 790- 791- 792-/** \ingroup IterativeLinearSolvers_Module 793- * Constrained conjugate gradient 794- * 795- * Computes the minimum of \f$ 1/2((Ax).x) - bx \f$ under the constraint \f$ Cx \le f \f$ 796- */ 797-template<typename TMatrix, typename CMatrix, 798- typename VectorX, typename VectorB, typename VectorF> 799-void constrained_cg(const TMatrix& A, const CMatrix& C, VectorX& x, 800- const VectorB& b, const VectorF& f, IterationController &iter) 801-{ 802- using std::sqrt; 803- typedef typename TMatrix::Scalar Scalar; 804- typedef typename TMatrix::Index Index; 805- typedef Matrix<Scalar,Dynamic,1> TmpVec; 806- 807- Scalar rho = 1.0, rho_1, lambda, gamma; 808- Index xSize = x.size(); 809- TmpVec p(xSize), q(xSize), q2(xSize), 810- r(xSize), old_z(xSize), z(xSize), 811- memox(xSize); 812- std::vector<bool> satured(C.rows()); 813- p.setZero(); 814- iter.setRhsNorm(sqrt(b.dot(b))); // gael vect_sp(PS, b, b) 815- if (iter.rhsNorm() == 0.0) iter.setRhsNorm(1.0); 816- 817- SparseMatrix<Scalar,RowMajor> CINV(C.rows(), C.cols()); 818- pseudo_inverse(C, CINV); 819- 820- while(true) 821- { 822- // computation of residual 823- old_z = z; 824- memox = x; 825- r = b; 826- r += A * -x; 827- z = r; 828- bool transition = false; 829- for (Index i = 0; i < C.rows(); ++i) 830- { 831- Scalar al = C.row(i).dot(x) - f.coeff(i); 832- if (al >= -1.0E-15) 833- { 834- if (!satured[i]) 835- { 836- satured[i] = true; 837- transition = true; 838- } 839- Scalar bb = CINV.row(i).dot(z); 840- if (bb > 0.0) 841- // FIXME: we should allow that: z += -bb * C.row(i); 842- for (typename CMatrix::InnerIterator it(C,i); it; ++it) 843- z.coeffRef(it.index()) -= bb*it.value(); 844- } 845- else 846- satured[i] = false; 847- } 848- 849- // descent direction 850- rho_1 = rho; 851- rho = r.dot(z); 852- 853- if (iter.finished(rho)) break; 854- if (transition || iter.first()) gamma = 0.0; 855- else gamma = (std::max)(0.0, (rho - old_z.dot(z)) / rho_1); 856- p = z + gamma*p; 857- 858- ++iter; 859- // one dimensionnal optimization 860- q = A * p; 861- lambda = rho / q.dot(p); 862- for (Index i = 0; i < C.rows(); ++i) 863- { 864- if (!satured[i]) 865- { 866- Scalar bb = C.row(i).dot(p) - f[i]; 867- if (bb > 0.0) 868- lambda = (std::min)(lambda, (f.coeff(i)-C.row(i).dot(x)) / bb); 869- } 870- } 871- x += lambda * p; 872- memox -= x; 873- } 874-} 875- 876-} // end namespace internal 877- 878-} // end namespace Eigen 879- 880-#endif // EIGEN_CONSTRAINEDCG_H 881diff --git a/unsupported/Eigen/src/IterativeSolvers/IterationController.h b/unsupported/Eigen/src/IterativeSolvers/IterationController.h 882deleted file mode 100644 883index a116e09e2..000000000 884--- a/unsupported/Eigen/src/IterativeSolvers/IterationController.h 885+++ /dev/null 886@@ -1,154 +0,0 @@ 887-// This file is part of Eigen, a lightweight C++ template library 888-// for linear algebra. 889-// 890-// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr> 891- 892-/* NOTE The class IterationController has been adapted from the iteration 893- * class of the GMM++ and ITL libraries. 894- */ 895- 896-//======================================================================= 897-// Copyright (C) 1997-2001 898-// Authors: Andrew Lumsdaine <lums@osl.iu.edu> 899-// Lie-Quan Lee <llee@osl.iu.edu> 900-// 901-// This file is part of the Iterative Template Library 902-// 903-// You should have received a copy of the License Agreement for the 904-// Iterative Template Library along with the software; see the 905-// file LICENSE. 906-// 907-// Permission to modify the code and to distribute modified code is 908-// granted, provided the text of this NOTICE is retained, a notice that 909-// the code was modified is included with the above COPYRIGHT NOTICE and 910-// with the COPYRIGHT NOTICE in the LICENSE file, and that the LICENSE 911-// file is distributed with the modified code. 912-// 913-// LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. 914-// By way of example, but not limitation, Licensor MAKES NO 915-// REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY 916-// PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS 917-// OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS 918-// OR OTHER RIGHTS. 919-//======================================================================= 920- 921-//======================================================================== 922-// 923-// Copyright (C) 2002-2007 Yves Renard 924-// 925-// This file is a part of GETFEM++ 926-// 927-// Getfem++ is free software; you can redistribute it and/or modify 928-// it under the terms of the GNU Lesser General Public License as 929-// published by the Free Software Foundation; version 2.1 of the License. 930-// 931-// This program is distributed in the hope that it will be useful, 932-// but WITHOUT ANY WARRANTY; without even the implied warranty of 933-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 934-// GNU Lesser General Public License for more details. 935-// You should have received a copy of the GNU Lesser General Public 936-// License along with this program; if not, write to the Free Software 937-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 938-// USA. 939-// 940-//======================================================================== 941- 942-#include "../../../../Eigen/src/Core/util/NonMPL2.h" 943- 944-#ifndef EIGEN_ITERATION_CONTROLLER_H 945-#define EIGEN_ITERATION_CONTROLLER_H 946- 947-namespace Eigen { 948- 949-/** \ingroup IterativeLinearSolvers_Module 950- * \class IterationController 951- * 952- * \brief Controls the iterations of the iterative solvers 953- * 954- * This class has been adapted from the iteration class of GMM++ and ITL libraries. 955- * 956- */ 957-class IterationController 958-{ 959- protected : 960- double m_rhsn; ///< Right hand side norm 961- size_t m_maxiter; ///< Max. number of iterations 962- int m_noise; ///< if noise > 0 iterations are printed 963- double m_resmax; ///< maximum residual 964- double m_resminreach, m_resadd; 965- size_t m_nit; ///< iteration number 966- double m_res; ///< last computed residual 967- bool m_written; 968- void (*m_callback)(const IterationController&); 969- public : 970- 971- void init() 972- { 973- m_nit = 0; m_res = 0.0; m_written = false; 974- m_resminreach = 1E50; m_resadd = 0.0; 975- m_callback = 0; 976- } 977- 978- IterationController(double r = 1.0E-8, int noi = 0, size_t mit = size_t(-1)) 979- : m_rhsn(1.0), m_maxiter(mit), m_noise(noi), m_resmax(r) { init(); } 980- 981- void operator ++(int) { m_nit++; m_written = false; m_resadd += m_res; } 982- void operator ++() { (*this)++; } 983- 984- bool first() { return m_nit == 0; } 985- 986- /* get/set the "noisyness" (verbosity) of the solvers */ 987- int noiseLevel() const { return m_noise; } 988- void setNoiseLevel(int n) { m_noise = n; } 989- void reduceNoiseLevel() { if (m_noise > 0) m_noise--; } 990- 991- double maxResidual() const { return m_resmax; } 992- void setMaxResidual(double r) { m_resmax = r; } 993- 994- double residual() const { return m_res; } 995- 996- /* change the user-definable callback, called after each iteration */ 997- void setCallback(void (*t)(const IterationController&)) 998- { 999- m_callback = t; 1000- } 1001- 1002- size_t iteration() const { return m_nit; } 1003- void setIteration(size_t i) { m_nit = i; } 1004- 1005- size_t maxIterarions() const { return m_maxiter; } 1006- void setMaxIterations(size_t i) { m_maxiter = i; } 1007- 1008- double rhsNorm() const { return m_rhsn; } 1009- void setRhsNorm(double r) { m_rhsn = r; } 1010- 1011- bool converged() const { return m_res <= m_rhsn * m_resmax; } 1012- bool converged(double nr) 1013- { 1014- using std::abs; 1015- m_res = abs(nr); 1016- m_resminreach = (std::min)(m_resminreach, m_res); 1017- return converged(); 1018- } 1019- template<typename VectorType> bool converged(const VectorType &v) 1020- { return converged(v.squaredNorm()); } 1021- 1022- bool finished(double nr) 1023- { 1024- if (m_callback) m_callback(*this); 1025- if (m_noise > 0 && !m_written) 1026- { 1027- converged(nr); 1028- m_written = true; 1029- } 1030- return (m_nit >= m_maxiter || converged(nr)); 1031- } 1032- template <typename VectorType> 1033- bool finished(const MatrixBase<VectorType> &v) 1034- { return finished(double(v.squaredNorm())); } 1035- 1036-}; 1037- 1038-} // end namespace Eigen 1039- 1040-#endif // EIGEN_ITERATION_CONTROLLER_H 1041