Opened 11 months ago

Closed 3 months ago

#31275 closed enhancement (fixed)

QEPCAD: improve installation locations

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-9.5
Component: packages: experimental Keywords:
Cc: jhpalmieri, mjo Merged in:
Authors: Michael Orlitzky Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: 036b431 (Commits, GitHub, GitLab) Commit: 036b431a63435f66ed4023c78fd14ad8b9498e5b
Dependencies: Stopgaps:

Status badges

Description

QEPCAD assumes unusual locations for several files, including

  • $SAGE_LOCAL/default.qepcadrc (which would better live in $SAGE_ETC (= $SAGE_LOCAL/etc)
  • $SAGE_LOCAL/bin/qepcad.help (which would better live in $SAGE_LOCAL/share/qepcad)

(We already use Fedora's patches (https://src.fedoraproject.org/rpms/qepcad-B/blob/master/f/qepcad-B.spec), which make some changes to qepcad's environment.)

It would be good to improve this.

Change History (14)

comment:1 Changed 11 months ago by jhpalmieri

Also, very low on the priority list since this is an experimental package, but the spkg-install.in script could be rewritten to use the sdh tools.

comment:2 Changed 6 months ago by mkoeppe

I think we can just remove default.qepcadrc entirely and just set SINGULARPATH as an env var

comment:3 Changed 5 months ago by mkoeppe

  • Dependencies set to #32254

comment:4 Changed 4 months ago by mkoeppe

  • Cc mjo added

comment:5 Changed 4 months ago by mkoeppe

  • Milestone changed from sage-wishlist to sage-9.5

As noted in #29024, we should get rid of qepcad's use of the environment variable SINGULARPATH - as preparation for singular spkg-configure.

comment:6 Changed 4 months ago by mjo

SINGULARPATH is only mentioned in qepcad-B-env.patch whose value I doubt. The default for $qe is Fedora-specific, and $SINGULARPATH should not be needed at all because the compiled Singular executable knows it.

What's more, we seem to be setting SINGULAR in QEPCAD's rc file...

cat > "$SAGE_LOCAL/default.qepcadrc" <<EOF
# THIS FILE IS AUTOMATICALLY GENERATED by build/pkgs/qepcad/spkg-install.in -- DO NOT EDIT

#####################################################
# QEPCAD rc file.
# This file allows for some customization of QEPCAD.
# Right now, the ability to give a path to Singular,
# so that it gets used for some computer algebra
# computations is the only feature.
#####################################################
SINGULAR $SAGE_LOCAL/bin
EOF

but the only place that's used is to execute "Singular" (in source/db/SINGULAR.c):

   string SingularCall = SingularBase + "/Singular";
   ...
    execlp(SingularCall.c_str(),
           SingularCall.c_str(),
           "-q",
           "--no-warn",
           "--min-time=0.001",
           "--ticks-per-sec=1000",
           NULL);

Since execlp() searches PATH, the whole mess can simply be replaced by execlp("Singular",...). If we want to create a nice backwards-compatible patch, we could use SingularBase + "/Singular" when SINGULAR is defined, and "Singular" otherwise. Then deleting SINGULAR from our qepcad rc file would make it do the right thing, but the patch could be used by others without breaking configs that rely on SINGULAR being set.

comment:7 Changed 4 months ago by mjo

  • Authors set to Michael Orlitzky
  • Branch set to u/mjo/ticket/31275
  • Commit set to 7c43cf6fce0821c161f7b66923bc0667881c41c6
  • Status changed from new to needs_review

This seems to work. I dropped the nonsensical qepcad-B-env.patch, and added a new patch that chaged the SINGULAR variable in default.qepcadrc into a boolean. Now "yes" makes it launch Singular from the $PATH, and anything else disables it.


New commits:

8243319Trac #31275: drop qepcad-B-env.patch.
7c43cf6Trac #31275: use boolean SINGULAR variable.

comment:8 Changed 4 months ago by git

  • Commit changed from 7c43cf6fce0821c161f7b66923bc0667881c41c6 to 991ff3e32459877fb701cac4a029ecd2692d617b

Branch pushed to git repo; I updated commit sha1. New commits:

5d7022fTrac #31275: move qepcad.help and default.qepcadrc to better locations.
991ff3eTrac #31275: use $CXXFLAGS instead of hard-coding "-g -O3".

comment:9 Changed 3 months ago by dimpase

  • Dependencies #32254 deleted

comment:10 Changed 3 months ago by dimpase

test errors like

 File "/mnt/opt/Sage/sage-dev/local/lib/python3.8/site-packages/sage/interfaces/qepcad.py", line 687, in _update_command_info
        with open(os.path.join(SAGE_LOCAL, 'bin', 'qepcad.help')) as help:
    FileNotFoundError: [Errno 2] No such file or directory: '/mnt/opt/Sage/sage-dev/local/bin/qepcad.help'

whereas the location used now is $SAGE_LOCAL/share/qepcad/qepcad.help.

So one needs to change sage/interfaces/qepcad.py to fix this.

comment:11 Changed 3 months ago by dimpase

  • Reviewers set to Dima Pasechnik

few other tests need a fix. I'll provide a branch.

comment:12 Changed 3 months ago by dimpase

  • Branch changed from u/mjo/ticket/31275 to u/dimpase/ticket/31275
  • Commit changed from 991ff3e32459877fb701cac4a029ecd2692d617b to 036b431a63435f66ed4023c78fd14ad8b9498e5b
  • Status changed from needs_review to positive_review

New commits:

036b431fix locations of qepcad.help and qepcadrc

comment:13 Changed 3 months ago by mjo

Thanks for the fix! I guess I forgot to re-test after I realized that I hadn't actually solved the problem in $description and moved the help/rc files.

Last edited 3 months ago by mjo (previous) (diff)

comment:14 Changed 3 months ago by vbraun

  • Branch changed from u/dimpase/ticket/31275 to 036b431a63435f66ed4023c78fd14ad8b9498e5b
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.