Hi David, On Tue, Sep 14, 2010 at 8:25 PM, Dr. David Kirkby <david.kir...@onetel.net> wrote: > The Cliquer package in Sage is presenting problems on Solaris in the way it > builds a shared library.
First, allow me to express my gratitude for your tremendous work in porting Sage to (Open)Solaris. I have learnt a great deal from reading your patches and posts to the various Sage discussion forums. These include issues concerning portability, good software engineering practices, and shell and C programming. > I've looked briefly at what is supposed to be the unmodified Cliquer code, > but there are endless modifications to the upstream source code. I'm disheartened that this happened. One should not modify upstream source, but place patches against upstream source under the directory patch/. > Those modifications look very dubious too. For example, there are endless > calls to malloc, but the programmer has not bothered to check if the calls > to malloc fails or not. Those modifications are in sections specific to > Sage, but there are similar examples in the upstream source code too. You've raised an excellent point about good coding practices. I was one of the early (around late 2009) maintainers of the Cliquer spkg. However, my work then centred on build issues. I don't remember writing anything that interfaces with the Cliquer C code. > The upstream source code does NOT create a shared library at all, so the > *Sage* developer that has messed around to create a shared library has > screwed up. > > Perhaps it's just me, but when I see code where people can't be bothered to > check if malloc fails or not, I suspect they have not taken much care > elsewhere too. I worked on getting Cliquer to build as a shared library on Cygwin, Linux, Mac OS X and Solaris (t2.math). I take your comments as an encouragement for me (or anyone) to further investigate how to polish up the Cliquer spkg. In my programming work, I have been following advice from E. S. Raymond's book "The Art of Unix Programming" [1] and D. A. Wheeler's book "Secure Programming for Linux and Unix HOWTO -- Creating Secure Software" [2]. I hope you would continue to share your thoughts, as you have generous done, on good programming practices so that contributors to the Sage community can benefit from your experience. > Do we really need Cliquer in Sage? Next to graph isomorphism, functionalities for computing cliques [3] are some of the important and fundamental features that any graph theory library should have. The upstream code of the Cliquer spkg is written by an expert in cliques who has published some fast algorithms for computing cliques. As you know, being an expert in cliques doesn't necessarily translates to being an expert in implementing clique algorithms. The Cliquer upstream author has provided the Sage community with a useful library of code for computing cliques. As a gesture of our gratitude, we can send the author patches to improve his code. [1] http://catb.org/~esr/writings/taoup/html/ [2] http://www.dwheeler.com/secure-programs/ [3] http://en.wikipedia.org/wiki/Clique_(graph_theory) -- Regards Minh Van Nguyen -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org