TL;DR. patches are most welcome :-) Details below.
On Wed, 23 Dec 2020, 02:40 Mouse Mousevich, <u...@ll.mit.edu> wrote: > A lot of people have a lot of problems with Sage-9.2 on MacOS, installing > pre-compiled or building from the source. > > Sage-9.2 has several idiosyncrasies that for me are hard to explain. One - > it deliberately refuses to work with Macports-installed packages, even > though their main difference from similar ones installed via Brew is their > location. How crazy is that? > To me, it is macOS that has idiosyncrasies ;-) But OK, SageMath problems here are not deliberate, and caused by severe labour shortage, if you like. We don't have a single MacPort user among a handful of SageMath developers. Please feel free to provide patches. (Yes, it means supporting yet another nonstandard location, more or less, I suppose) > Second, pplpy-0.8.4 is "obtuse" enough to try compiling C++ file > linear_algebra.cpp with clang instead of clang++, and then complain that > CFLAGS that are (surprise!) C-specific, do not make sense for C++. Need I > mention that it is impossible to locate clang but not clang++? > pplpy upstream is here, it has a very busy maintainer who does not use macOS https://gitlab.com/videlec/pplpy - the main developer no longer works on SageMath, as far as I know. patches are most welcome! > Now, from generic criticisms to specific errors and logs. > > *Platform* > *-* iMac 2020, Intel Core i9 CPU, 32GM RAM > - macOS Catalina 10.15.7 > - Xcode-12.3 (with command-line tools installed) in > /Applications/Xcode.app, and separately installed CLT 12.3 in > /Library/Developer/CommandLineTools. > XCode is a moving target, 9.2 was released before XCode 12.3 - Macports 2.6.4, with a ton of packages installed in /opt/local, which > include clang-11, gcc-10, python38 and python39, and OpenSSL-1.1.1i. > one ought to use XCode's clang(++), and only need gfortran from the gcc package. Fortran binary location can be explicitly provided by setting FC environment variable. (same for C and C++, one can use CC and CXX) If you like to enable MacPorts, think about providing an analog of .homebrew-build-env script. > *Problems* > > 1. Sage-9.2 config refuses to use already-installed packages in > /opt/local, spends sh*tload of time and bandwidth downloading what's > already there (except that it downloads Python-3.8.5, and my machine has > Python-3.8.6), and finally fails to compile that pile: > 2. pplpy-0.8.4 uses clang (*not* clang++? Why?) to compile ppl/ > linear_algebra.cpp files, and fails because on my machine CFLAGS > differ from CXXFLAGS (surprise! one sets -std=gnu18, and other one > sets -std=gnu++17). This bug should manifest on all the .cpp files. > > *Logs* > The main log is 5.7 MB, so I don't want to post it unless asked to. > Excerpts: > > Error building Sage. > > The following package(s) may have failed to build (not necessarily > > during this run of 'make all-build'): > > * package: pplpy-0.8.4 > > last build time: Dec 20 22:51 > > log file: /Applications/SageMath/logs/pkgs/pplpy-0.8.4.log > build directory: > /Applications/SageMath/local/var/tmp/sage/build/pplpy-0.8.4 > > and more specifically: > > [pplpy-0.8.4] creating build/temp.macosx-10.9-x86_64-3.8/ppl > > [pplpy-0.8.4] *clang* -Wno-unused-result -Wsign-compare > -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -O3 -std=gnu18 > -march=native -isysroot > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk > -O3 *-std=gnu18* -march=native -isysroot > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk > -Ippl -I/Applications/SageMath/local/lib/python3.8/site-packages/gmpy2 > -Ippl -I -I/Applications/SageMath/local > -I/Applications/SageMath/local/lib/python38.zip > -I/Applications/SageMath/local/lib/python3.8 > -I/Applications/SageMath/local/lib/python3.8/lib-dynload > -I/Applications/SageMath/local/lib/python3.8/site-packages > -I/private/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/pip-req-build-_4gwq_tw > -I/Applications/SageMath/local/include/python3.8 -c ppl/linear_algebra.cpp > -o build/temp.macosx-10.9-x86_64-3.8/ppl/linear_algebra.o > > [pplpy-0.8.4] error: *invalid argument '-std=gnu18' not allowed with > 'C++'* > > [pplpy-0.8.4] error: *command 'clang' failed* with exit status 1 > > [pplpy-0.8.4] Building wheel for pplpy (setup.py): finished with status > 'error' > > [pplpy-0.8.4] ERROR: Failed building wheel for pplpy > > BTW, why is it creating build for macosx-10.9 when the current version of > the OS is 10.15, and SDK is for 11.1? > > On Friday, December 4, 2020 at 11:30:57 AM UTC-5 dim...@gmail.com wrote: > >> On Fri, Dec 4, 2020 at 3:26 PM Mathieu Dutour <mathieu...@gmail.com> >> wrote: >> > >> > On Thursday, 3 December 2020 at 19:13:28 UTC+1 dim...@gmail.com wrote: >> >> >> >> On Thu, Dec 3, 2020 at 5:39 PM Mathieu Dutour <mathieu...@gmail.com> >> wrote: >> >>> >> >>> Thank you for providing this. Keep that in mind for future. >> >>> >> >>> As it turns out, the solution to installing was incredibly simple: >> >>> "brew install sage" >> >> >> >> >> >> on macOS 10.15.7 this appears to install the version 9.2 of >> x86_64.app.dmg by >> >> pulling it from a Sage mirror. >> >> >> >> Does Sage installed this way work? >> >> (I'd be surprised it was the case) >> > >> > That is correct. >> > However, I had to give authorization only one time which represent >> > a progress and allowed me to run sage on macintosh. >> > >> > I still think it should be mentioned in the Sage Installation Guide. >> >> as I already mentioned, for some reason this does not work on a macOS >> 10.15.7 machine I have access to. >> >> Strangely enough, I needed to run first a command >> >> brew cask >> >> (don't know what it actually does, it did >> download (probably git-cloned) something >> >> ==> Tapping homebrew/cask >> Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'... >> remote: Enumerating objects: 55, done. >> remote: Counting objects: 100% (55/55), done. >> remote: Compressing objects: 100% (41/41), done. >> remote: Total 574981 (delta 26), reused 19 (delta 14), pack-reused 574926 >> Receiving objects: 100% (574981/574981), 240.80 MiB | 7.59 MiB/s, done. >> Resolving deltas: 100% (409134/409134), done. >> Tapped 1 command and 3739 casks (3,857 files, 259MB). >> >> >> >> brew cask >> >> after which >> >> brew install --cask sage >> >> did seem to work. >> >> Starting sage brought up the popup: >> >> ---------------------------------- >> “SageMath-9.2” cannot be opened because the developer cannot be verified. >> macOS cannot verify that this app is free from malware. >> --------------- >> [move to bin] [cancel] >> ------------------------------------- >> >> So I did >> >> % sudo xattr -r -d com.apple.quarantine /Applications/SageMath-9.2.app >> xattr: No such file: >> /Applications/SageMath-9.2.app/Contents/Resources/sage/local/share/jupyter/kernels/sagemath/doc >> >> >> Apparently there is a dangling link pointing there, but OK. It has done >> the job, >> and have an apparently working sage in terminal. Jupyter is broken: >> >> % sage -n >> >> ┌────────────────────────────────────────────────────────────────────┐ >> │ SageMath version 9.2, Release Date: 2020-10-24 │ >> │ Using Python 3.8.5. Type "help()" for help. │ >> └────────────────────────────────────────────────────────────────────┘ >> Please wait while the Sage Jupyter Notebook server starts... >> Traceback (most recent call last): >> File >> "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/sage/repl/ipython_kernel/install.py", >> >> line 307, in have_prerequisites >> from notebook.notebookapp import NotebookApp >> File >> "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/notebook/notebookapp.py", >> >> line 66, in <module> >> from tornado import httpserver >> File >> "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/tornado/httpserver.py", >> >> line 29, in <module> >> import ssl >> File >> "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/ssl.py", >> >> line 98, in <module> >> import _ssl # if we can't import it, let the error propagate >> ModuleNotFoundError: No module named '_ssl' >> The Jupyter notebook requires ssl, even if you do not use >> https. Install the openssl development packages in your system and >> then rebuild Python (sage -f python3). >> >> >> Also, the app in /Applications/SageMath-9.2 >> >> does not quite work, most stuff from the menu's does not launch, etc. >> >> So this is not really working well, still. :-( >> >> >> >> >> >> >> >> > >> > Mathieu >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups "sage-support" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an email to sage-support...@googlegroups.com. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/sage-support/4cafb667-ca96-4417-b57e-c3341bafb041n%40googlegroups.com. >> >> > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-support/63642cb1-a380-4570-b703-e6a873269adbn%40googlegroups.com > <https://groups.google.com/d/msgid/sage-support/63642cb1-a380-4570-b703-e6a873269adbn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAAWYfq2XapWVmQfCHJNdADS8Na796K%3DkDfzgaFGqPRu%3D_taAGA%40mail.gmail.com.