Open DrXyzzy opened 6 years ago
Thanks for reporting this issue.
At https://github.com/sagemath/sagelib/blob/master/sage/interfaces/phc.py it may be better to replace line 712 in the function mixed_volume: output_filename = self._output_from_command_list(['phc -m','4','n','n','n'], polys, verbose = verbose) by output_filename = self._output_from_command_list(['phc -m','4','0','n','n'], polys, verbose = verbose)
Polyhedral homotopies with double double and quad double arithmetic were introduced in version 2.3.90 (30 July 2014), which changed one question prompting for a number (zero in this case) instead of y/n.
Note that https://github.com/sagemath/sagelib is a snapshot of the state of the Sage library in July 2012.
The change suggested by @janverschelde was made, see line 760 in https://github.com/sagemath/sage/blob/master/src/sage/interfaces/phc.py#L760
The best known effort of combining SageMath and PHCPack (also with SnapPy, Regina, flipper, curver, and more) is the "computop-sage" Docker image (where computop stands for computational topology).
computop-sage docker image on DockerHub: https://hub.docker.com/r/computop/sage/
computop-sage docker image sources at bitbucket: https://bitbucket.org/t3m/sagedocker
computop-sage dockerfile: https://bitbucket.org/t3m/sagedocker/src/tip/sage/Dockerfile
The dockerfile reveals computop-sage is currently based on Ubuntu 16.04 and uses PHCpack 2.4.43 (see line 73 of the dockerfile), which was released 2017-08-20, according to
Thanks @janverschelde and @slel. Line 760 at the link provided by Samuel still has the old code, i.e. 'n' instead of '0' in the third element of the first argument to self._output_from_command_list
. Also, neither of the versions of phc.py seems to include the tmp_filename() update in sagemath trac 4411.
If I manually apply both the change suggested by @janverschelde and the fix in trac 4411 to https://github.com/sagemath/sagelib/blob/master/sage/interfaces/phc.py, I am able to run the 3-line demo successfully.
@DrXyzzy you are right, the change from 'n' to '0' was not made. But I am not sure what you mean about SageMath trac ticket 4411, since the patch "trac_4411-tmpfilename.patch" was applied, see:
Do you mean you undo that patch? Or apply another patch proposed in SageMath trac ticket 4411, that did not end up being applied?
After installing phc binary from PHCpack download page and attempting the first example from Sage docs here, we see the following:
This is seen on Linux Ubuntu 16.04 with the 64-bit Linux phc binary using both sage-8.0 and sage-8.1 in CoCalc sagews and in command terminal, as well as on OS X running sage-8.1 in a terminal with the current macOS phc binary.
Would it be possible to download an earlier version of phc for 64-bit Linux to try to isolate the problem and offer a possible workaround? For example, according to this thread from sage-support, the sage interface to PHCpack was working in July of 2017.