#31275 closed enhancement (fixed)

QEPCAD: improve installation locations

Reported by: Matthias Köppe Owned by:
Priority: major Milestone: sage-9.5
Component: packages: experimental Keywords:
Cc: John Palmieri, Michael Orlitzky 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 23 months ago by John Palmieri

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 17 months ago by Matthias Köppe

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

comment:3 Changed 17 months ago by Matthias Köppe

Dependencies: #32254

comment:4 Changed 16 months ago by Matthias Köppe

Cc: Michael Orlitzky added

comment:5 Changed 16 months ago by Matthias Köppe

Milestone: sage-wishlistsage-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 16 months ago by Michael Orlitzky

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 16 months ago by Michael Orlitzky

Authors: Michael Orlitzky
Branch: u/mjo/ticket/31275
Commit: 7c43cf6fce0821c161f7b66923bc0667881c41c6
Status: newneeds_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 16 months ago by git

Commit: 7c43cf6fce0821c161f7b66923bc0667881c41c6991ff3e32459877fb701cac4a029ecd2692d617b

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 15 months ago by Dima Pasechnik

Dependencies: #32254

comment:10 Changed 15 months ago by Dima Pasechnik

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 15 months ago by Dima Pasechnik

Reviewers: Dima Pasechnik

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

comment:12 Changed 15 months ago by Dima Pasechnik

Branch: u/mjo/ticket/31275u/dimpase/ticket/31275
Commit: 991ff3e32459877fb701cac4a029ecd2692d617b036b431a63435f66ed4023c78fd14ad8b9498e5b
Status: needs_reviewpositive_review

New commits:

036b431fix locations of qepcad.help and qepcadrc

comment:13 Changed 15 months ago by Michael Orlitzky

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

Version 0, edited 15 months ago by Michael Orlitzky (next)

comment:14 Changed 15 months ago by Volker Braun

Branch: u/dimpase/ticket/31275036b431a63435f66ed4023c78fd14ad8b9498e5b
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.