Changes between Version 10 and Version 34 of Ticket #22756
- Timestamp:
- 04/07/17 22:49:08 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #22756
-
Property
Commit
changed from
c050438fa802d56738cc7084254579c5610b7358
to678fb206f5fb7731651c80263c61ac4872915396
-
Property
Commit
changed from
-
Ticket #22756 – Description
v10 v34 1 On OS X, Python3 sometimes fails to build correctly. I think it depends on whether Python2 is built first or not. Even if it seems to build correctly, then the `_scproxy` module is broken.1 On OS X, Python3 sometimes fails to build correctly. To fix this: 2 2 3 Examples (all start with `make distclean`): 3 - make `xz` a dependency: not necessary for Python 3 to build, but this way it builds the `_lzma` module. 4 4 5 - `./sage -i python3`. Then `python3` works, but the `_scproxy` (on OS X 10.12) and `_lzma` modules fail to build. We've seen the `_scproxy` error before: the solution is to compile with clang, at least on recent versions of OS X. The error for `_lzma` is 6 {{{ 7 /Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.0.beta0/local/var/tmp/sage/build/python3-3.5.1/src/Modules/_lzmamodule.c:19:18: fatal error: lzma.h: No such file or directory 8 }}} 9 We can fix this by making `xz` a dependency. Is it important? `xz` doesn't take long to build and doesn't have any dependencies of its own, so why not? 5 - use `clang` to compile Python 3, as we do for Python 2. Without this, the `_scproxy` module fails to build. 10 6 11 - `./sage -i python2; ./sage -i python3`: then Python3 fails with the error 12 {{{ 13 $ sage --sh 14 $ python3 15 Fatal Python error: Py_Initialize: unable to load the file system codec 16 File "/Users/jpalmier/Desktop/Sage_stuff/git/sage/local/lib/python/encodings/__init__.py", line 123 17 raise CodecRegistryError,\ 18 ^ 19 SyntaxError: invalid syntax 7 - do not create a symlink `SAGE_LOCAL/lib/python` -- see #22764. If this symlink is in place and if Python 2 is built before Python 3, then Python 3 picks up that link in its load path, and so it tries to read a lot of Python 2 packages, which is bad. 20 8 21 Current thread 0x00007fff76225000 (most recent call first): 22 Abort trap: 6 23 }}} 9 - see also #22781 which tracks a few other issues related to Python 3, OS X, and Sage packages. 24 10 25 - if we build Python3 with `clang`, the way we do with Python2, then as long as we haven't built Python2 first, it works and `_scproxy` builds properly. `_lzma` doesn't, but we can fix that.26 27 - if we build Python3 with `clang` but we build Python2 first, then we get the same error as above.28 29 So I propose that we build Python3 with `clang` as we already do with Python2, and we make `xz` a dependency. To fix the interference between the two Python builds, we should remove the symbolic link `SAGE_LOCAL/lib/python`. See #22764.