GithubHelp home page GithubHelp logo

Comments (1)

fredrikbk avatar fredrikbk commented on May 14, 2024

I've given this a some thought and I'm not sure we should try to license code we generate for the user's expressions. It sounds like shaky legal grounds and I also don't want to antagonize users.

We should discuss this in a meeting, but for now I've added the following to the generated code:

/* Generated by the Tensor Algebra Compiler (tensor-compiler.org) */

The following patch gives us licensing:

diff --git a/tools/taco.cpp b/tools/taco.cpp
index a47a198..4cada42 100644
--- a/tools/taco.cpp
+++ b/tools/taco.cpp
@@ -65,6 +65,8 @@ static void printUsageInfo() {
   cout << endl;
   printFlag("nocolor", "Print without colors.");
   cout << endl;
+  printFlag("license", "Print with the full license.");
+  cout << endl;

   /*
   cout << "Options planned for the future:" << endl;
@@ -101,6 +103,7 @@ int main(int argc, char* argv[]) {
   bool printLattice = false;
   bool evaluate = false;
   bool color = true;
+  bool license = false;

   string indexVarName = "";

@@ -146,6 +149,9 @@ int main(int argc, char* argv[]) {
     else if ("-nocolor" == arg) {
       color = false;
     }
+    else if ("-license" == arg) {
+      license = true;
+    }
     else {
       if (exprStr.size() != 0) {
         printUsageInfo();
@@ -175,10 +181,39 @@ int main(int argc, char* argv[]) {

   tensor.compile();

-  string gentext = "Generated by the Tensor Algebra Compiler (tensor-compiler.org)";
+  string gentext =
+      "Generated by the Tensor Algebra Compiler (taco) under the MIT license";
+
   std::string green = (color) ? "\033[38;5;70m" : "";
   std::string nc    = (color) ? "\033[0m"       : "";
-  cout << green << "/* " << gentext << " */" << nc << endl;
+
+  if (license) {
+    cout << green << "/* ";
+    cout << gentext << endl << endl;
+    cout << "   Copyright (c) 2016 MIT CSAIL and other contributors\n\n";
+    cout << "   Permission is hereby granted, free of charge, to any person obtaining a copy\n";
+    cout << "   of this software and associated documentation files (the \"Software\"), to deal\n";
+    cout << "   in the Software without restriction, including without limitation the rights\n";
+    cout << "   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n";
+    cout << "   copies of the Software, and to permit persons to whom the Software is\n";
+    cout << "   furnished to do so, subject to the following conditions:\n\n";
+
+    cout << "   The above copyright notice and this permission notice shall be included in all\n";
+    cout << "   copies or substantial portions of the Software.\n\n";
+
+    cout << "   THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n";
+    cout << "   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n";
+    cout << "   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n";
+    cout << "   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n";
+    cout << "   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n";
+    cout << "   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n";
+    cout << "   SOFTWARE.\n";
+    cout << " */" << nc << endl;
+  }
+  else {
+    cout << green << "/* " << gentext << " */" << nc << endl;
+  }
+

   bool hasPrinted = false;
   if (printAssemble) {

from taco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.