#9871: Update Cliquer to the latest version (1.21) and get the library buiilding
properly on Solaris.
----------------------------+-----------------------------------------------
   Reporter:  drkirkby      |       Owner:  GeorgSWeber                         
       
       Type:  defect        |      Status:  needs_work                          
       
   Priority:  critical      |   Milestone:  sage-4.6                            
       
  Component:  build         |    Keywords:                                      
       
     Author:  David Kirkby  |    Upstream:  Not yet reported upstream; Will do 
shortly.
   Reviewer:                |      Merged:                                      
       
Work_issues:                |  
----------------------------+-----------------------------------------------

Comment(by leif):

 Replying to [comment:8 drkirkby]:
 >  * There's no need for this to be a .p0 or .p1. It is a new upstream
 source code (version 1.21), so the patch level in Sage is removed.

 This seems to be an endless discussion. I'd prefer having ''always'' a
 patch level, be it {{{.p0}}} for unpatched upstream code. But here we
 actually (still) do patch a fresh upstream release, so it should IMHO be
 {{{.p1}}} (or {{{.p0}}} for those who think the ''first unpatched new
 release'' should ''not'' have a patch level extension).

 >  * It is {{{make test}}} which exits with 0, even when I alter the file
 {{{src/testcases.c}}} to force tests to fail.

 When {{{testcases}}} returns 1, so does {{{make test}}} (or {{{$MAKE
 test}}}); see above.

 >  * {{{make test}}} actually creates a binary called {{{testcases}}} and
 then executes that. That exits with 0 in all cases.

 Not really, though not really relevant if it doesn't in ''all'' error
 cases. But
 {{{
 make test | tee test.out
 if [ $? -ne 0 ]; then
     echo "Failed to compile test cases of cliquer... exiting"
     exit 1
 fi
 }}}
 does not even catch the cases in which it ''does'' return 1, nor errors
 ''compiling'' the test program - which is perhaps even worse, since
 {{{
 #!sh
 [ "x`grep ERROR non_existing_file`" != x ] && never_happens
 }}}
 (There will just be an error message of grep in the spkg's installation
 log file. You know [http://trac.sagemath.org/sage_trac/ticket/9434 these
 messages] well...)

 {{{
 #!sh
 ~/Sage/spkgs/cliquer-1.21$ egrep -B2 "return |exit" src/testcases.c
         printf("Please reconfigure and recompile.\n");
         printf("\n");
         exit(1);
 --
     if ((fp=fopen("testcase-small.a","rt"))==NULL) {
         perror("testcase-small.a");
         return 1;
 --
     fclose(fp);
     if (!small) {
         return 1;
 --
     large=graph_read_dimacs_file("testcase-large.b");
     if (!large) {
         return 1;
 --
     if ((fp=fopen("testcase-large-w.b","rb"))==NULL) {
         perror("testcase-large-w.b");
         return 1;
 --
     fclose(fp);
     if (!wlarge) {
         return 1;
 --
         printf("ERROR\n");
         graph_test(small,stdout);
         return 1;
 --
         printf("ERROR\n");
         graph_test(large,stdout);
         return 1;
 --
         printf("ERROR\n");
         graph_test(wlarge,stdout);
         return 1;
 --
             small,0,0,FALSE,small_max_cliques);

     return 0;
 --
         printf(")\n");
     }
     return found;
 --

     if (!list_contains(sets,s,g))
         return FALSE;
     user_fnct_cnt--;
     if (!user_fnct_cnt)
         return FALSE;
     return TRUE;
 --
     if (n!=correct_n) {
         printf("ERROR (returned %d cliques (!=%d))\n",n,correct_n);
         return FALSE;
 --
         if (!list_contains(sopt->sets,s[i],sopt->g)) {
             printf("(inner loop)\n");
             return FALSE;
         }
     }
     return TRUE;
 }}}

 Also, running the test suite just in {{{spkg-install}}} is IMHO a bad
 idea; that disturbs upcoming improvements to {{{sage-spkg}}} wrt.
 {{{SAGE_CHECK}}}, since we don't want the [whole] ''build'' to fail (or
 stop) just because ''some'' package failed to pass its tests; cf. the
 Python package. And we won't be able to log test results separately.

 >  * I agree this is an upstream bug in the test code - it should exit
 with a non-zero code in the case of errors.

 >  * I'm not trying to test the exit code of {{{tee}}}, but rather
 {{{grep}}}.

 See above. (You do both, or actually currently only the former.)

 >  * I thought {{{grep -q}}} was not portable, but it was {{{cmp -q}}}
 which caused a portability issue. So I'll change that.

 I think there are still but very rarely dumb {{{grep}}}s around that don't
 understand {{{-q}}}, in which case one can omit the {{{-q}}} and redirect
 {{{stdout}}} to {{{/dev/null}}}; this anyway doesn't affect {{{grep}}}'s
 exit status. (But we should IMHO ignore that and use {{{-q}}}. POSIX isn't
 of the 1970s either.)

 >  * I take Leif's point about the fact that there should be no main in a
 shared library. But the code works with the compiler options {{{-shared
 -Wl,-h,libcliquer.so}}} on Linux and OS X, even though Leif says there's a
 main there. I do not want to start re-writing the source code or Makefile
 to remove main(). That's an upstream problem.

 The original code was - sorry - messed up by some ''Sage'' developer. (I
 already mentioned {{{src/}}} was ''not'' vanilla.)

 > If it was the only way to fix the text relocations, then I would do it.
 But simply using the same compiler options as on other platforms works.

 Ok, (in my opinion) a work-around, but doesn't remove the real cause,
 namely bad adaption / conversion of a program to a library.

 The "bad" flags btw. originate from Sage, too - not upstream.

 > I've created #9870 to address the other issues. I agree there are many,
 but I don't want this ticket drag on like #9603.

 Created six weeks ago, starting with a minor issue. Now we won't have to
 touch that for a long time I think, since all currently desirable changes
 are made - on ''one'' ticket, by creating ''one'' new spkg. (The situation
 with blockers is a bit different.)

 But regarding the previous Cliquer tickets (which weren't quick ones
 either), {{{SPKG.txt}}} still fails to spell the algorithm's developer's
 name correctly.

 I've taken over ''that'' ticket (#9870). If this ticket here quickly gets
 positively reviewed, I can make the remaining changes, based on it.
 Changing {{{testcases.c}}} is rather independent of that, but not the
 rest.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9871#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.


Reply via email to