ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 17 Oct 2018 05:53:17 -0500How to use a software package available for SageMathhttp://ask.sagemath.org/question/43970/how-to-use-a-software-package-available-for-sagemath/Hi.
I know SageMath is meant for math (so here user should post questions related mainly to math problems with Sage), but I'm testing SageMath capabilities about use/loading of external libraries created by user (c, fortran, etc...), that is like a complete environment able to process other prog languages like C and Fortran (mainly for scientific purposes).
I've found [here](http://www.sagemath.org/links-components.html) that SageMath can load and use some external libraries (not only python libraries) to allow user to perform some tasks with them.
For example I'd like to know how to use the Rubik program (a C program) for fun and for testing by using SageMath (specifically SageMathCell). It is listed in position 82 of the list [here](http://www.sagemath.org/links-components.html).
Can you kindly show me a procedure to load/compile/use this library available for SageMath?
I'd like to run the compiled code to solve (only for fun) some virtual/random Rubik cubes. The procedure for Rubik library could help me to understand how to run other libraries listed in the link above.
Thanks
Wed, 17 Oct 2018 04:21:30 -0500http://ask.sagemath.org/question/43970/how-to-use-a-software-package-available-for-sagemath/Answer by slelievre for <p>Hi.
I know SageMath is meant for math (so here user should post questions related mainly to math problems with Sage), but I'm testing SageMath capabilities about use/loading of external libraries created by user (c, fortran, etc...), that is like a complete environment able to process other prog languages like C and Fortran (mainly for scientific purposes).</p>
<p>I've found <a href="http://www.sagemath.org/links-components.html">here</a> that SageMath can load and use some external libraries (not only python libraries) to allow user to perform some tasks with them.</p>
<p>For example I'd like to know how to use the Rubik program (a C program) for fun and for testing by using SageMath (specifically SageMathCell). It is listed in position 82 of the list <a href="http://www.sagemath.org/links-components.html">here</a>.</p>
<p>Can you kindly show me a procedure to load/compile/use this library available for SageMath?
I'd like to run the compiled code to solve (only for fun) some virtual/random Rubik cubes. The procedure for Rubik library could help me to understand how to run other libraries listed in the link above.</p>
<p>Thanks</p>
http://ask.sagemath.org/question/43970/how-to-use-a-software-package-available-for-sagemath/?answer=43972#post-id-43972The reference manual available on the SageMath documentation site
has a page about interfaces:
- [SageMath interfaces](http://doc.sagemath.org/html/en/reference/interfaces/)
The list there includes an item for Rubik's cube solvers:
- [Interface to several Rubik’s cube solvers](http://doc.sagemath.org/html/en/reference/interfaces/sage/interfaces/rubik.html)
See also:
- ["Interfaces" page on the Sage wiki](https://wiki.sagemath.org/Interfaces)Wed, 17 Oct 2018 05:29:34 -0500http://ask.sagemath.org/question/43970/how-to-use-a-software-package-available-for-sagemath/?answer=43972#post-id-43972Comment by Matteo for <p>The reference manual available on the SageMath documentation site
has a page about interfaces:</p>
<ul>
<li><a href="http://doc.sagemath.org/html/en/reference/interfaces/">SageMath interfaces</a></li>
</ul>
<p>The list there includes an item for Rubik's cube solvers:</p>
<ul>
<li><a href="http://doc.sagemath.org/html/en/reference/interfaces/sage/interfaces/rubik.html">Interface to several Rubik’s cube solvers</a></li>
</ul>
<p>See also:</p>
<ul>
<li><a href="https://wiki.sagemath.org/Interfaces">"Interfaces" page on the Sage wiki</a></li>
</ul>
http://ask.sagemath.org/question/43970/how-to-use-a-software-package-available-for-sagemath/?comment=43975#post-id-43975Nice! Thank you @slelievre, so SageMath has several interfaces for a lot of existing libraries!
And if I wanted to modify the source code of Rubik, by downloading the original version it in my cloud service and by modifying some pieces of code inside it, how could I reload it in SageMath (specifically SageMathCell) in order to use my modified code instead of the original one the user finds [here](http://www.cflmath.com/~reid/Rubik/optimal_solver.html)?
In other words how could I modify the following sage commands (shown [here](http://doc.sagemath.org/html/en/reference/interfaces/sage/interfaces/rubik.html)) to use the modified version of "optimal.c" in my cloud?
from sage.interfaces.rubik import *
C = RubiksCube("R U")
CubexSolver().solve(C.facets())
Thank youWed, 17 Oct 2018 05:53:17 -0500http://ask.sagemath.org/question/43970/how-to-use-a-software-package-available-for-sagemath/?comment=43975#post-id-43975