Licensing and Copyright#
When a program should be distributed publicly, licensing might become an issue. Technically, licensing and copyright are two different things, but since a license is in place to ensure the copyright of a software, these topics are closely related.
Copyright#
There are two different kinds of copyright. One for each file and one for the whole program.
According to University of Galway policies, everything we create while working at ICHEC is intellectual property of University of Galway. Adding a copyright disclaimer will ensure, that everybody knows that a certain piece of software belongs to the university.
Copyright for the whole program#
To set the copyright of a program, you can just write a simple
Copyright 2024 Irish Centre for High End Computing (ICHEC), University of Galway.
anywhere in your program. I advice to put it into the main README.
Copyright of the source code#
Each (source code) file should have it’s own copyright disclaimer at the top together with a short mention of the license under which it will be published. This makes sense, since other people might just take single files and copy them into their own software (which they are allowed to do according most open source licenses).
The copyright disclaimer added to the top of every source code file could for example look like this:
/*
* Copyright (c) 2024, Irish Centre for High End Computing (ICHEC), University of Galway.
*/
If you did not create a new file and are merely changing an existing one, this copyright has to go underneath the one, that was there before. Unless you really changed the file to a completely new code you have to keep the copyright notices of other people!
I decided to add myself as author of the file to the copyright. As mentioned above, all intellectual property belongs to University of Galway. That means that even if your names are on these source code files, the copyright is not technically yours.
It is still advised to put your name on your work (together with the mention of ICHEC/University of Galway.) to first, enable people to enquire about the software and secondly, to show what you have done and to make a name of yourself.
For some licenses (GPL, Apache) you have to document changes you made to the code and the example above can be easily extended.
If you don’t see the need to document the changes, you can shorten this disclaimer, which especially makes sense the older the code gets. This is an example from RedHat’s Linux source code:
/*
File: linux/xattr.h
Extended attributes handling.
Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org>
Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
*/
If you are unsure where to put copyright acknowledgements, I mostly saw the advice to just add it everywhere, because you rather have it too often and be safe than missing an important spot and making the whole case controversial.
Licenses#
There are several open source licenses, the most common ones are the GPL, LGPL, MIT, BSD and the Apache License.
GPL version 2#
We had a case where we wanted to use a software made public with the GNU General Public License GPL. We changed small parts of this code to update it to a newer version of other dependencies.
According to the GPL, our program must then be licensed under GPL as well (that is called copyleft). The whole topic is complicated and confusing, but in this simple case three things are needed:
Add the license as a file to your repository
Add your copyright to the source code files and the main project and specify any changes you made to the existing software
Distribute the source code as well instead of just handing out binaries
License file#
I picked the GPL version 2 for our project, because the original project stated clearly to only use version 2:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software Foundation.
The license files themselves can be downloaded in multiple different formats from the GNU website.
Copyright disclaimers#
As explained in the section copyright, you should add copyright disclaimers to your code as well to have something to license.
In case of the GPL, the GPL license file should be mentioned with the copyright disclaimers of every source file you want to fall under this license. This is not legally necessary though, as the license will also be valid if you don’t. It just makes everything more clear, transparent and it will ensure the license stays in place even if somebody only copies one of the source files instead of the whole project.
This short mention usually looks like this for the GPL v2:
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see
http://www.gnu.org/licenses/gpl-2.0.html
Some parts of this can be changed of course and you can find more information in the license text itself.
Furthermore, the GPL states that you need to document all changes you made to a document.
I more or less decided together with a Stackoverflow entry that the following is enough to to mention some function calls and include files that changed - which is all we did.
/*
* Copyright (c) 2020, Irish Centre for High End Computing (ICHEC), NUI Galway
* Authors:
* Ciarán O'Rourke <ciaran.orourke@ichec.ie>,
* Sophie Wenzel-Teuber <sophie.wenzel-teuber@ichec.ie>
*
* Update to a new version of Lustre and Libs3
*/
However, if more crucial parts of the code have changed, you will have to figure out how specific this documentation has to be.
I guess by looking at famous open source codes that the year and a comprehensible git history might be enough, but don’t quote me on it once the lawyers are knocking…
This is for example taken from the file lustre/lustre_fid.h
, which is also published under GPLv2:
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2011, 2017, Intel Corporation.
*/
Overview of other licenses#
LGPL#
As you can see, GPL is a rather strict license. The Lesser GNU Public License LGPL is very similar to the GPL.
The main difference is the copyleft of the GPL: When one software is licensed under GPL, all software that uses the first one has to be licensed under GPL as well. That means for example, that code under GPL cannot be used for closed source, proprietary applications. (By the way, you can still charge people for using GPL software. The GNU websites state very clearly, that their license is a free one, but free as in freedom, not free as in free beer.)
LGPL does not have the copyleft requirement, so a third party software using the LGPL one can have any license, also a closed source one.
Apache License 2.0#
Again very similar is the Apache License. As the LGPL it is not a copyleft license, so you can use code under the Apache License in software of any other license, you just have to tag along the Apache licensing files and have to document any changes you made to the code.
These changed code parts need to remain under Apache license, even if the new code around them is not.
MIT and BSD#
These are probably the most permissive licenses. You just can do anything, as long as you don’t change the copyright notices.
One very convenient advantage is the length of the license text of MIT and BSD licenses compared to the others above.
What I did to publish code under the MIT license was to add a LICENSE
file to the root directory containting the license itself and add a copyright disclaimer to every source file like this:
/*
* Copyright (c) 2020, Irish Centre for High End Computing (ICHEC), NUI Galway
* Authors:
* Ciarán O'Rourke <ciaran.orourke@ichec.ie>,
* Sophie Wenzel-Teuber <sophie.wenzel-teuber@ichec.ie>
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/