ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 11 May 2017 07:57:33 -0500Where is the source code ?https://ask.sagemath.org/question/37561/where-is-the-source-code/ Hello all,
I am using SageMath-7.5.1 on a Linux platform. Sometimes I am interested in the source code for studying implementation details. When asking for documentation or source code, e.g.
R.<x>=GF(61)[] ; p=x^3 + x^2 + 59*x + 60 ; p?
then the documentation may contain a line like:
~/.sage/temp/WJ1/6067/spyx/sage/rings/polynomial/polynomial_zmod/sage/rings/polynomial/polynomial_zmod_flint.pyx
But directory "~/.sage/temp/WJ1/6067" is empty! Neither does the SageMath installation directory "/usr/lib/sagemath" (recursively searched) contain a file "polynomial_zmod*.py*". So, where is the source code?
Thanks in advance Wed, 10 May 2017 07:54:08 -0500https://ask.sagemath.org/question/37561/where-is-the-source-code/Comment by wjansen for <p>Hello all, </p>
<p>I am using SageMath-7.5.1 on a Linux platform. Sometimes I am interested in the source code for studying implementation details. When asking for documentation or source code, e.g. </p>
<p>R.<x>=GF(61)[] ; p=x^3 + x^2 + 59*x + 60 ; p?</p>
<p>then the documentation may contain a line like:</p>
<p>~/.sage/temp/WJ1/6067/spyx/sage/rings/polynomial/polynomial_zmod/sage/rings/polynomial/polynomial_zmod_flint.pyx</p>
<p>But directory "~/.sage/temp/WJ1/6067" is empty! Neither does the SageMath installation directory "/usr/lib/sagemath" (recursively searched) contain a file "polynomial_zmod<em>.py</em>". So, where is the source code? </p>
<p>Thanks in advance </p>
https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37572#post-id-37572That's so in your case, not in mine.Thu, 11 May 2017 03:32:58 -0500https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37572#post-id-37572Comment by dan_fulea for <p>Hello all, </p>
<p>I am using SageMath-7.5.1 on a Linux platform. Sometimes I am interested in the source code for studying implementation details. When asking for documentation or source code, e.g. </p>
<p>R.<x>=GF(61)[] ; p=x^3 + x^2 + 59*x + 60 ; p?</p>
<p>then the documentation may contain a line like:</p>
<p>~/.sage/temp/WJ1/6067/spyx/sage/rings/polynomial/polynomial_zmod/sage/rings/polynomial/polynomial_zmod_flint.pyx</p>
<p>But directory "~/.sage/temp/WJ1/6067" is empty! Neither does the SageMath installation directory "/usr/lib/sagemath" (recursively searched) contain a file "polynomial_zmod<em>.py</em>". So, where is the source code? </p>
<p>Thanks in advance </p>
https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37565#post-id-37565In my case, after starting sage in a linux console, the path is correctly detected:
sage: p?
Type: Polynomial_zmod_flint
String form: x^3 + x^2 + 59*x + 60
File: /usr/share/sage/source/sage/rings/polynomial/polynomial_zmod_flint.pyx
Docstring: Polynomial on ZZ/nZZ implemented via FLINT.Wed, 10 May 2017 12:31:07 -0500https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37565#post-id-37565Answer by kcrisman for <p>Hello all, </p>
<p>I am using SageMath-7.5.1 on a Linux platform. Sometimes I am interested in the source code for studying implementation details. When asking for documentation or source code, e.g. </p>
<p>R.<x>=GF(61)[] ; p=x^3 + x^2 + 59*x + 60 ; p?</p>
<p>then the documentation may contain a line like:</p>
<p>~/.sage/temp/WJ1/6067/spyx/sage/rings/polynomial/polynomial_zmod/sage/rings/polynomial/polynomial_zmod_flint.pyx</p>
<p>But directory "~/.sage/temp/WJ1/6067" is empty! Neither does the SageMath installation directory "/usr/lib/sagemath" (recursively searched) contain a file "polynomial_zmod<em>.py</em>". So, where is the source code? </p>
<p>Thanks in advance </p>
https://ask.sagemath.org/question/37561/where-is-the-source-code/?answer=37562#post-id-37562Yes, when it does that it just puts the things in a temp directory. But look for `polynomial_zmod_flint.pyx`. For me, when I'm in the Sage directory, it's
$ pwd
.../src/sage/rings/polynomial
$ ls polynomial_zmod_flint.pyx
polynomial_zmod_flint.pyx
Wed, 10 May 2017 08:03:52 -0500https://ask.sagemath.org/question/37561/where-is-the-source-code/?answer=37562#post-id-37562Comment by kcrisman for <p>Yes, when it does that it just puts the things in a temp directory. But look for <code>polynomial_zmod_flint.pyx</code>. For me, when I'm in the Sage directory, it's</p>
<pre><code>$ pwd
.../src/sage/rings/polynomial
$ ls polynomial_zmod_flint.pyx
polynomial_zmod_flint.pyx
</code></pre>
https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37576#post-id-37576See https://github.com/sagemath/website/issues/110Thu, 11 May 2017 07:57:33 -0500https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37576#post-id-37576Comment by kcrisman for <p>Yes, when it does that it just puts the things in a temp directory. But look for <code>polynomial_zmod_flint.pyx</code>. For me, when I'm in the Sage directory, it's</p>
<pre><code>$ pwd
.../src/sage/rings/polynomial
$ ls polynomial_zmod_flint.pyx
polynomial_zmod_flint.pyx
</code></pre>
https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37575#post-id-37575Ah, the PPA was the culprit - as I suspected. Yes, I think we can add some info on that.Thu, 11 May 2017 07:54:35 -0500https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37575#post-id-37575Comment by wjansen for <p>Yes, when it does that it just puts the things in a temp directory. But look for <code>polynomial_zmod_flint.pyx</code>. For me, when I'm in the Sage directory, it's</p>
<pre><code>$ pwd
.../src/sage/rings/polynomial
$ ls polynomial_zmod_flint.pyx
polynomial_zmod_flint.pyx
</code></pre>
https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37573#post-id-37573I used the installation procedure according to "http://www.sagemath.org/download-linux.html", entry "Ubuntu PPA" (only the last of the three commands is relevant to find out what had been installed). The link points to version 7.6, but when I installed version 7.5.1 it was the same procedure. Well, I can try to upgrade to version 7.6 to see what happens.
Addendum 1: I did without success: "sagemath-upstream-binary" still provides version 7.5.1.
Addendum 2: Now, I installed version 7.6 from a tar.bz2 archive according to entry "Usage" in the link given above (i.e. no upgrade): the missing sources are there, hurrah! If the stripping down is really necessary to generate the PPA it may be wise to add a comment in entry "Ubuntu PPA".Thu, 11 May 2017 03:40:48 -0500https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37573#post-id-37573Comment by kcrisman for <p>Yes, when it does that it just puts the things in a temp directory. But look for <code>polynomial_zmod_flint.pyx</code>. For me, when I'm in the Sage directory, it's</p>
<pre><code>$ pwd
.../src/sage/rings/polynomial
$ ls polynomial_zmod_flint.pyx
polynomial_zmod_flint.pyx
</code></pre>
https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37569#post-id-37569Hmm, then you might be installing it via some binary that explicitly is stripped down to make sure the size is small. Can you say *precisely* which SageMath you installed? Which exact binary or installation procedure? Hopefully someone else can answer once you provide that - I do not have a Linux install.Wed, 10 May 2017 20:10:06 -0500https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37569#post-id-37569Comment by wjansen for <p>Yes, when it does that it just puts the things in a temp directory. But look for <code>polynomial_zmod_flint.pyx</code>. For me, when I'm in the Sage directory, it's</p>
<pre><code>$ pwd
.../src/sage/rings/polynomial
$ ls polynomial_zmod_flint.pyx
polynomial_zmod_flint.pyx
</code></pre>
https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37564#post-id-37564My installation contains only one subdirectory of .../sage/src, namely *doc*. So it may be an installation issue. What can I do to install more subdirectories? I installed the compiled SageMath, not from source code.
BTW, I searched the installation directory for file names having two asterisks: "polynomial_zmod*asterisk*.py*asterisk*" including the "pyx" files. Unfortunately, both asterisks were deleted in the formatted question you see (and, my failure, I did not look at it).Wed, 10 May 2017 10:14:43 -0500https://ask.sagemath.org/question/37561/where-is-the-source-code/?comment=37564#post-id-37564