Changeset c31a71 in git for Singular


Ignore:
Timestamp:
Dec 2, 2021, 3:25:27 PM (2 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
273a2f1fd6fae79d6cfdd19dacabce628fa15ee6
Parents:
b67904c91e15359f47b0d5e377ffe945a966c8ff
Message:
chg: system("SingularBin") ends with /
Location:
Singular
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/intprog.lib

    rb67904 rc31a71  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="version intprog.lib 4.2.1.0 Nov_2021 "; // $Id$
     2version="version intprog.lib 4.2.1.2 Nov_2021 "; // $Id$
    33category="Commutative Algebra";
    44info="
     
    9696
    9797  // call external program
    98   int dummy=system("sh",system("SingularBin")+"/solve_IP -alg "+alg+" "+matrixfile+" "+problemfile);
     98  int dummy=system("sh",system("SingularBin")+"solve_IP -alg "+alg+" "+matrixfile+" "+problemfile);
    9999
    100100  // read solution from created file
     
    259259
    260260  // call external program
    261   int dummy=system("sh",system("SingularBin")+"/solve_IP -alg "+alg+" "+matrixfile+" "+problemfile);
     261  int dummy=system("sh",system("SingularBin")+"solve_IP -alg "+alg+" "+matrixfile+" "+problemfile);
    262262
    263263  // read solution from created file
     
    406406
    407407  // call external program
    408   int dummy=system("sh",system("SingularBin")+"/solve_IP -alg "+alg+" "+matrixfile+" "+problemfile);
     408  int dummy=system("sh",system("SingularBin")+"solve_IP -alg "+alg+" "+matrixfile+" "+problemfile);
    409409
    410410  // read solution from created file
     
    552552
    553553  // call external program
    554   int dummy=system("sh",system("SingularBin")+"/solve_IP -alg "+alg+" "+matrixfile+" "+problemfile);
     554  int dummy=system("sh",system("SingularBin")+"solve_IP -alg "+alg+" "+matrixfile+" "+problemfile);
    555555
    556556  // read solution from created file
  • Singular/LIB/toric.lib

    rb67904 rc31a71  
    11///////////////////////////////////////////////////////////////////////////
    2 version="version toric.lib 4.2.1.0 Nov_2021 "; // $Id$
     2version="version toric.lib 4.2.1.2 Nov_2021 "; // $Id$
    33category="Commutative Algebra";
    44info="
     
    274274
    275275  // call external program
    276   dummy=system("sh",system("SingularBin")+"/toric_ideal -alg "+alg+" "+matrixfile);
     276  dummy=system("sh",system("SingularBin")+"toric_ideal -alg "+alg+" "+matrixfile);
    277277  if (dummy!=0) { ERROR("toric_ideal failed with error code "+string(dummy)); }
    278278
     
    587587
    588588  // call external program
    589   dummy=system("sh",system("SingularBin")+"/toric_ideal -alg "+alg+" "+matrixfile);
     589  dummy=system("sh",system("SingularBin")+"toric_ideal -alg "+alg+" "+matrixfile);
    590590  if (dummy!=0) { ERROR("toric_ideal failed with error code "+string(dummy)); }
    591591
     
    10001000
    10011001  // call external program
    1002   dummy=system("sh",system("SingularBin")+"/change_cost "+groebnerfile+" "+newcostfile);
     1002  dummy=system("sh",system("SingularBin")+"change_cost "+groebnerfile+" "+newcostfile);
    10031003  if (dummy!=0) { ERROR("change_cost failed with error code "+string(dummy)); }
    10041004
  • Singular/extra.cc

    rb67904 rc31a71  
    663663      if (r == NULL) r="/usr/local";
    664664      int l=strlen(r);
     665      /* where to find Singular's programs: */
     666      #define SINGULAR_PROCS_DIR "/libexec/singular/MOD"
     667      int ll=si_max(strlen(SINGULAR_PROCS_DIR),strlen(LIBEXEC_DIR));
     668      char *s=(char*)omAlloc(l+ll+2);
    665669      if ((strstr(r,".libs/..")==NULL)   /*not installed Singular (libtool)*/
    666670      &&(strstr(r,"Singular/..")==NULL)) /*not installed Singular (static)*/
    667671      {
    668         /* where to find Singular's programs: */
    669         #define SINGULAR_PROCS_DIR "/libexec/singular/MOD"
    670         char *s=(char*)omAlloc(l+strlen(SINGULAR_PROCS_DIR)+1);
    671672        strcpy(s,r);
    672673        strcat(s,SINGULAR_PROCS_DIR);
    673674        if (access(s,X_OK)==0)
    674           res->data = (void*)s;
     675        {
     676          strcat(s,"/");
     677        }
    675678        else
    676679        {
    677680          /*second try: LIBEXEC_DIR*/
    678           omFree(s); s=omStrDup(LIBEXEC_DIR);
     681          strcpy(s,LIBEXEC_DIR);
    679682          if (access(s,X_OK)==0)
    680             res->data = (void*)s;
     683          {
     684            strcat(s,"/");
     685          }
    681686          else
    682687          {
    683688            s[0]='\0';
    684             res->data = (void*)s;
    685689          }
    686690        }
     
    689693      {
    690694        const char *r=feResource('b');
    691         if (r == NULL) r="";
    692         res->data = (void*) omStrDup( r );
    693       }
     695        if (r == NULL)
     696        {
     697          s[0]='\0';
     698        }
     699        else
     700        {
     701          strcpy(s,r);
     702          strcat(s,"/");
     703        }
     704      }
     705      res->data = (void*)s;
    694706      return FALSE;
    695707    }
Note: See TracChangeset for help on using the changeset viewer.