Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QEPCAD giving an error #36825

Closed
2 tasks done
anirjoshi opened this issue Dec 6, 2023 · 4 comments
Closed
2 tasks done

QEPCAD giving an error #36825

anirjoshi opened this issue Dec 6, 2023 · 4 comments
Labels

Comments

@anirjoshi
Copy link

anirjoshi commented Dec 6, 2023

Steps To Reproduce

I have installed sage using the following command:
sudo apt-get install sagemath

Then in running sage, I get the command prompt of sage.
Then I try to run the following commands as mentioned in the tutorial here

var('a,b,c,d,x,y,z')
qf = qepcad_formula
ellipse = 3*x^2 + 2*x*y + y^2 - x + y - 7
F = qf.exists(y, ellipse == 0);
qepcad(F)

On running qepcad(F), I get the following error:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
/usr/lib/python3/dist-packages/pexpect/spawnbase.py in read_nonblocking(self, size, timeout)
    165         try:
--> 166             s = os.read(self.child_fd, size)
    167         except OSError as err:

OSError: [Errno 5] Input/output error

During handling of the above exception, another exception occurred:

EOF                                       Traceback (most recent call last)
/usr/lib/python3/dist-packages/pexpect/expect.py in expect_loop(self, timeout)
    110                 # Still have time left, so read more data
--> 111                 incoming = spawn.read_nonblocking(spawn.maxread, timeout)
    112                 if self.spawn.delayafterread is not None:

/usr/lib/python3/dist-packages/pexpect/pty_spawn.py in read_nonblocking(self, size, timeout)
    484         if self.child_fd in r:
--> 485             return super(spawn, self).read_nonblocking(size)
    486 

/usr/lib/python3/dist-packages/pexpect/spawnbase.py in read_nonblocking(self, size, timeout)
    170                 self.flag_eof = True
--> 171                 raise EOF('End Of File (EOF). Exception style platform.')
    172             raise

EOF: End Of File (EOF). Exception style platform.

During handling of the above exception, another exception occurred:

EOF                                       Traceback (most recent call last)
/usr/lib/python3/dist-packages/sage/interfaces/expect.py in _start(self, alt_message, block_during_init)
    518         try:
--> 519             self._expect.expect(self._prompt)
    520         except (pexpect.TIMEOUT, pexpect.EOF) as msg:

/usr/lib/python3/dist-packages/pexpect/spawnbase.py in expect(self, pattern, timeout, searchwindowsize, async_, **kw)
    339         compiled_pattern_list = self.compile_pattern_list(pattern)
--> 340         return self.expect_list(compiled_pattern_list,
    341                 timeout, searchwindowsize, async_)

/usr/lib/python3/dist-packages/pexpect/spawnbase.py in expect_list(self, pattern_list, timeout, searchwindowsize, async_, **kw)
    368         else:
--> 369             return exp.expect_loop(timeout)
    370 

/usr/lib/python3/dist-packages/pexpect/expect.py in expect_loop(self, timeout)
    116         except EOF as e:
--> 117             return self.eof(e)
    118         except TIMEOUT as e:

/usr/lib/python3/dist-packages/pexpect/expect.py in eof(self, err)
     62                 msg = str(err) + '\n' + msg
---> 63             raise EOF(msg)
     64 

EOF: End Of File (EOF). Exception style platform.
Qepcad finished running /usr/bin/env qe=/usr qepcad
command: /usr/bin/env
args: ['/usr/bin/env', 'qe=/usr', 'qepcad']
buffer (last 100 chars): b''
before (last 100 chars): b'/usr/bin/env: \xe2\x80\x98qepcad\xe2\x80\x99: No such file or directory\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 127
flag_eof: True
pid: 8838
child_fd: 20
closed: False
timeout: None
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 4194304
ignorecase: False
searchwindowsize: None
delaybeforesend: None
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile(b'\nEnter an .*:\r')

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
<ipython-input-6-63f2a929c2ee> in <module>
----> 1 qepcad(F)

/usr/lib/python3/dist-packages/sage/interfaces/qepcad.py in qepcad(formula, assume, interact, solution, vars, **kwargs)
   1627             use_witness = True
   1628 
-> 1629     qe = Qepcad(formula, vars=vars, **kwargs)
   1630     if assume is not None:
   1631         qe.assume(assume)

/usr/lib/python3/dist-packages/sage/interfaces/qepcad.py in __init__(self, formula, vars, logfile, verbose, memcells, server)
    874 
    875         qex = Qepcad_expect(logfile=logfile, memcells=memcells, server=server)
--> 876         qex._send('[ input from Sage ]')
    877         qex._send('(' + ','.join(varlist) + ')')
    878         qex._send(str(free_vars))

/usr/lib/python3/dist-packages/sage/interfaces/expect.py in _send(self, cmd)
    271     def _send(self, cmd):
    272         if self._expect is None:
--> 273             self._start()
    274         E = self._expect
    275         self.__so_far = ''

/usr/lib/python3/dist-packages/sage/interfaces/expect.py in _start(self, alt_message, block_during_init)
    521             self._expect = None
    522             self._session_number = BAD_SESSION
--> 523             raise RuntimeError("unable to start %s: %s" % (self.name(), msg))
    524         self._expect.timeout = None
    525 

RuntimeError: unable to start QEPCAD: End Of File (EOF). Exception style platform.
Qepcad finished running /usr/bin/env qe=/usr qepcad
command: /usr/bin/env
args: ['/usr/bin/env', 'qe=/usr', 'qepcad']
buffer (last 100 chars): b''
before (last 100 chars): b'/usr/bin/env: \xe2\x80\x98qepcad\xe2\x80\x99: No such file or directory\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 127
flag_eof: True
pid: 8838
child_fd: 20
closed: False
timeout: None
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 4194304
ignorecase: False
searchwindowsize: None
delaybeforesend: None
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile(b'\nEnter an .*:\r')

Expected Behavior

8 x^2 - 8 x - 29 <= 0

Actual Behavior

Error as mentioned above.

Additional Information

No response

Environment

- **OS**: I am using it on mac M2 with a docker of ubuntu 20.04
- **Sage Version**: SageMath version 9.0, Release Date: 2020-01-01

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@dimpase
Copy link
Member

dimpase commented Dec 6, 2023

SageMath version 9.0, Release Date: 2020-01-01 - sorry, we don't have resources to support such an old version.
We're now on 10.2, and have approximately 2 releases per year.

also, QEPCAD had its latest release in 2012, it'd be a miracle if it still reliably works on modern systems.

@dimpase
Copy link
Member

dimpase commented Dec 6, 2023

I tested this example on the latest beta, 10.3.beta0, and it works and returns 8 x^2 - 8 x - 29 <= 0.

I suggest that you build Sage (latest released version, 10.2) from source, following the instructions.
First of all, uninstall apt-get installed Sage 9.0. Then,

After you dowloaded/installed the source, either using git, or untarring the tarball, run

./configure --enable-qepcad
make 

(after running ./configure have a look at its output, roughly the last page, where it suggests to install more system packages; do the suggested installations, then re-run ./configure as above, or as told )

@dimpase dimpase closed this as completed Dec 6, 2023
@anirjoshi
Copy link
Author

anirjoshi commented Dec 6, 2023

Running ./configure gives an error on sage 10.2:
bash: ./configure: No such file or directory

The output of ls is as follows:

AUTHORS.md          CONTRIBUTING.md  README.md        build         docker              sage
CITATION.cff        COPYING.txt      VERSION.txt      condarc.yml   m4                  src
CITATION.cff.in     Makefile         bootstrap        config        pkgs                tox.ini
CODE_OF_CONDUCT.md  Pipfile.m4       bootstrap-conda  configure.ac  pyrightconfig.json

@dimpase
Copy link
Member

dimpase commented Dec 7, 2023

@anirjoshi - in this case first you need to run ./bootstrap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants