In the file src/sage_setup/clean.py, the variable CEXTMOD_EXTS could 
perhaps be modified from (on OS X) ".so" to ".cpython-36m-darwin.so". That 
fixes the problem for me, but I'm not what Python code to use to come with 
"cpython-36m-darwin". Something in distutils?

Along similar lines, building the Sage library byte-compiles the python 
files, and with python 3 it puts them into a subdirectory __pycache__. This 
subdirectory is not an expected part of the path name for Sage, so Sage 
then views them as stale and deletes them.

  John



On Saturday, May 20, 2017 at 8:36:12 AM UTC-7, John H Palmieri wrote:
>
> With Python 2, the .so files are just called "sage_object.so", while with 
> Python 3, the .so files are called "sage_object.cpython-36m-darwin.so" 
> (on OS X). Is that file name difference causing Sage to treat them as stale 
> (= not connected to existing Sage library files) and thus removing them? I 
> don't know what else the problem could be.
>
>
> On Friday, May 19, 2017 at 10:59:34 PM UTC-7, Frédéric Chapoton wrote:
>>
>> Thanks, John, for the helping hand.
>>
>> Yes, this unicode error will be the next one we need to handle. But first 
>> we need to understand what is going wrong before. Commenting the line in 
>> src/setup.py is certainly not the right solution..
>>
>>
>> Le samedi 20 mai 2017 00:43:25 UTC+2, John H Palmieri a écrit :
>>>
>>>
>>>
>>> On Friday, May 19, 2017 at 3:27:54 PM UTC-7, John H Palmieri wrote:
>>>>
>>>>
>>>>
>>>> On Friday, May 19, 2017 at 2:46:15 PM UTC-7, John H Palmieri wrote:
>>>>>
>>>>>
>>>>>
>>>>> On Friday, May 19, 2017 at 9:51:46 AM UTC-7, Frédéric Chapoton wrote:
>>>>>>
>>>>>> Dear all,
>>>>>>
>>>>>> We have almost reached the state of vanilla sage building with 
>>>>>> SAGE_PYTHON3=yes (this does not mean working !). But something seems to 
>>>>>> go 
>>>>>> wrong, and I would like help to find and fix the current problem.
>>>>>>
>>>>>> So, for people that want to do something else than answering polls, 
>>>>>> you can try the following:
>>>>>>
>>>>>> In a separate install of sage, on top of 8.0.beta7, apply
>>>>>>
>>>>>> https://trac.sagemath.org/ticket/23030 (git pull 
>>>>>> trac u/chapoton/23030)
>>>>>>
>>>>>> and
>>>>>>
>>>>>> https://trac.sagemath.org/ticket/22305 (git pull trac public/22305)
>>>>>>
>>>>>> then export SAGE_PYTHON3=yes
>>>>>>
>>>>>> and make build.
>>>>>>
>>>>>> This should finish succesfully, with the usual message. 
>>>>>>
>>>>>
>>>>> It took me a bit more work. First I had a problem with the Sage 
>>>>> library, which I could fix by applying #23029. Second, conway-polynomials 
>>>>> wouldn't build because it couldn't find six.moves, so I had to change the 
>>>>> spkg-install script to use #!/usr/bin/env sage-python23 instead of 
>>>>> #!/usr/bin/env python. I should also point out that even when the problem 
>>>>> is only in conway-polynomials, the build process keeps rebuilding all of 
>>>>> sagelib, rebuilding all of the extensions. So something is not correctly 
>>>>> detecting that the Sage library files are already built and installed.
>>>>>
>>>>> The docs now don't build, although now I see that you were not 
>>>>> recommending even trying. Anyway, the error is:
>>>>>
>>>>> /Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.0.beta7/local/bin/python:
>>>>>  
>>>>> No module named sage_setup
>>>>>
>>>>> I suppose it should be calling python3 or sage-python23 instead. If 
>>>>> we're not worrying about the docs for now, that's fine with me.
>>>>>
>>>>>
>>>>> Anyway, I finally got 'make build' to work and I ran into the same 
>>>>> problem you did. One issue is that sage-ipython is being called, and its 
>>>>> first line is #!/usr/bin/env python, which calls python2. You can change 
>>>>> that to sage-python23 (which calls a version of Python depending on the 
>>>>> setting of SAGE_PYTHON3). When I do that, Sage creates a crash report, 
>>>>> saying 
>>>>>
>>>>> ModuleNotFoundError: No module named 'sage.structure.sage_object'. 
>>>>> Indeed, when I look at local/lib/python3.6/site-packages/sage/structure, 
>>>>> there are no .so files there. This must be related to the issues that 
>>>>> caused constant rebuilding of the Sage library. Here are some lines from 
>>>>> the log file:
>>>>>
>>>>> copying build/lib.macosx-10.9-x86_64-3.6/sage/structure/
>>>>> sage_object.cpython-36m-darwin.so -> 
>>>>> /Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.0.beta7/local/lib/python3.6/site-packages/sage/structure
>>>>>
>>>>> and then later
>>>>>
>>>>> Cleaning up stale file: 
>>>>> /Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.0.beta7/local/lib/python3.6/site-packages/sage/structure/
>>>>> sage_object.cpython-36m-darwin.so
>>>>>
>>>>> (Why isn't it just called "sage_object.so"?)
>>>>>
>>>>
>>>> The stale file issue has been discussed before: 
>>>> https://groups.google.com/d/msg/sage-devel/W7FotQglFBs/RsnII556AwAJ. 
>>>>
>>>
>>> If I comment out the "self.clean_stale_files()" line from src/setup.py, 
>>> then I still get an error, but one you might expect from Python3: 
>>> "NameError: name 'unicode' is not defined". This comes from 
>>> src/sage/misc/sageinspect.py:
>>>
>>>     if not isinstance(r, string_types):
>>>         return ''
>>>     elif isinstance(r, unicode):
>>>         return r.encode('utf-8', 'ignore')
>>>     else:
>>>         return r
>>>
>>>  
>>>
>>>>  
>>>>
>>>>>
>>>>> -- 
>>>>> John
>>>>>
>>>>>
>>>>>
>>>>>  
>>>>>
>>>>>> Then try ./sage
>>>>>>
>>>>>> For me, this fails with some traceback about not finding 
>>>>>> sage.repl.interpreter. Can someone help to fix that please ?
>>>>>>
>>>>>> Frédéric
>>>>>>
>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to