jorose wrote:I am going to release my engine sometime this month.
Congratulations!
So my first question is in respect to licensing. I want to release my code under GPL however I found out there are 3 versions of GPL, is there a reason not to use the newest version?
Maybe. There are people who are very hung up on the distinction between GPL 2 and GPL 3. See
http://stackoverflow.com/questions/4146 ... 3-licenses for a list of bullet points.
Ultimately though, it is up to
you to understand the terms under which you release the source code, in particular what other people can and cannot do with it. Also remember that even if you release the code under the GPL, the code is still yours: you can change the licence later (but you cannot retract versions that are already out there that are under the GPL).
On this same note as far I can remember there shouldn't be any code snippets I didn't write myself that is longer then just a few lines of code, however I use
kogge stone fill algorithms which I at some point, back when my engine was still in Java took from the CPW page I just linked. Is it even possible for me to release my engine with this part of the code?
Yes. Worst possible case - you stick a separate licence on that bit of code.
There are a lot of technicalities that have to do with code that is released for educational or instructive purposes. Without any counter arguments, I would assume that code on CPW specifically falls under "fair use/public domain". Ask if you want to be certain.
In practical terms: don't worry about it.
Do I need to add people to the list of authors if I don't remove this part of the code?
Presumably you already credit the source in your readme file? That is probably good enough (and should be done even if not required, it's only polite).
Assuming I can release my code under some license, should I write the license information at the top of every single file or does it suffice to simply add it in the project directory together with a read me file?
I think the latter is sufficient (don't put the licence in the README though, put the licence blurb in the readme and stick the full licence text in a separate file).
Furthermore I wrote my code under Linux and I currently have the following 3 functions which I don't know if they are platform specific?
Code: Select all
/** return the number of trailing zeros */
inline int numberOfTrailingZeros(BitBoard x) {
return __builtin_ctzll(x);
}
/** return the leading number of zeros */
inline int numberOfLeadingZeros(BitBoard x) {
return __builtin_clzll(x);
}
/** return number of set 1 bits */
inline int popCount(BitBoard x) {
return __builtin_popcountll(x);
}
Aside from again having the question if it is possible to release my code with these functions in them I also wanted to know if I would have to change something so the code will compile on Windows/OSX? My understanding is that functions that start with "__" are system specific...
These particular ones are compiler specific. They work with both GCC and Clang, so you should be good on both Linux and OS X. Windows is a different matter. GCC is still fine, but most people use different compilers on Windows. You can have a look at my program SjaakII (in particular the file include/bits64.h) to see one possible way of handling this.
Having said all that - if this is the only change you have to make to get things to compile under Windows, well done! That's better than I ever managed.
The last question that comes to mind is in respect to makefiles. This is my first and so far only larger scale (more then a single file) project written in c++ and was in large part done in order to learn how to code c++ (for better or worse the majority of c++ code I have now seen outside of my own, is that of Stockfish). And while it was a great learning experience it was a serious uphill battle for me and as such I tried to avoid some things, specifically I haven't used pointers in my code yet and have absolutely no clue how to write my own makefile yet. Instead I opted for making a Managed Make C++ project using the Eclipse CDT. In essence what I am trying to say is my makefile is automatically generated and any other automatically or manually generated makefile should be as good or better then mine and I don't know how it actually works. My question is when I release the code should I release the makefile with it?
If it's all you have, go for it. Chances are it'll be useless, but having a non-functional makefile is no worse than not having one at all. Some people include a simple shell script to build the code (which basically runs "gcc -O2 *.c -o myprogram").
Chances are someone here will send you an appropriate makefile.
Should I take the time to learn to write and proceed to write my own makefile before releasing the project?
Yes and no. It's good to learn how to write simple makefiles, so do that.
However, large and complicated makefiles are hard to maintain (by hand) once you need to worry about differences between compilers and platforms. Learn to use a configure/makefile generator instead. Autotools used to be the standard for UNIX based systems, but they're pretty complicated and not portable. Personally I'm a fan of CMake, but there are other options.
Will the makefile work on systems that are not Linux without changing it at all?
No.
In fact they probably won't work on anyone else's computer even if they run Linux.