Build failure at matplotlib-2.2.4 and sagenb-1.1.2 on OS X

204 views
Skip to first unread message

Ben Salisbury

unread,
Sep 24, 2019, 1:12:17 PM9/24/19
to sage-devel
Hi,

I'm attempting to build Sage from the develop branch on a new office computer running OS X 10.14.6.  I've installed Xcode and Command Line Tools (or at least I thought I had), and I'm getting a build failure at sagenb-1.1.2.  The log files for sagenb-1.1.2 and for matplotlib-2.2.4.p0 have been attached.  Any ideas on how to fix?

Ben
sagenb-1.1.2.log
matplotlib-2.2.4.p0.log

John H Palmieri

unread,
Sep 24, 2019, 1:53:03 PM9/24/19
to sage-devel
matplotlib is complaining about png, so you could try "./sage -f libpng". (It should have been installed already, but maybe something went wrong.) Then try "make" again.

The sagenb error says things like

The full traceback has been saved in /var/folders/d0/bbf0zvnn43b4_fhtkznp_yyc0000gp/T/sphinx-err-ZfIXOy.log, if you want to report the issue to the developers.

Can you post that file?

By the way, does "git" work from the command-line? How about "gcc"? I just recently did a system upgrade on OS X, and I had to rerun Xcode to get the command-line tools to function — it wanted me to click on a licensing agreement or something like that.

--
John

Ben Salisbury

unread,
Sep 24, 2019, 2:24:31 PM9/24/19
to sage-devel
I'll try "./sage -f libpng".  In the meantime, I've attached the log file requested.  Also:

mth153844pe212:~ salis1bt$ git --version
git version
2.20.1 (Apple Git-117)

mth153844pe212
:~ salis1bt$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin



sphinx-err-ZfIXOy.log

Dima Pasechnik

unread,
Sep 24, 2019, 2:49:54 PM9/24/19
to sage-devel
by the way, there is
https://trac.sagemath.org/ticket/28513
where I proposed a fix for this sort of error -- least the error
message is much more clear...
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/04c4706c-f5d1-42a7-b3db-abdceef51b29%40googlegroups.com.

Ben Salisbury

unread,
Sep 24, 2019, 3:54:09 PM9/24/19
to sage-devel
Trying "./sage -f libpng" first did not work.  But there are new errors this time!
sagenb-1.1.2.log
scipy-1.2.0.log

Dima Pasechnik

unread,
Sep 24, 2019, 4:18:11 PM9/24/19
to sage-devel
On Tue, Sep 24, 2019 at 8:54 PM Ben Salisbury <bsali...@gmail.com> wrote:
>
> Trying "./sage -f libpng" first did not work. But there are new errors this time!

hmm, in the scipy log one sees

> ld: library not found for -lSystem

coming from gfortran, more precisely, from
/Users/salis1bt/sage-git/local/bin/gfortran

So it looks as if gfortran you built in the process is broken.

What is the output of

otool -L /Users/salis1bt/sage-git/local/bin/gfortran

?
>
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/bdf45658-3498-4642-9010-dd56bbc32e89%40googlegroups.com.

Dima Pasechnik

unread,
Sep 25, 2019, 5:49:52 AM9/25/19
to sage-devel
I don't know really why (well, lack of information, surely) MacOS
people continue to put themselves and their machines
through the torture of building full Sagemath toolchain,
whereas a considerable number of Homebrew packages can be used
instead, including gfortran, gmp, yasm, NTL, etc etc etc.

I've played around with creating custom Homebrew formulae, here:
https://github.com/dimpase/homebrew-science
and have there (source code-only) formulae for flint and arb,
something missing from the main Homebrew site.

So you can do

brew install dimpase/science/flint

and

brew install dimpase/science/arb

to get up to date flint and arb built and installed, so that building
Sage from source does not need these re-built.

-------------------------

Needless to say, one can also install Conda, and installing Sage there
will automatically install most of the Sage packages listed on
https://trac.sagemath.org/ticket/27330
(so that they don't need to be built)

And then building Sage from source at Conda "prompt" should be using them...

HTH
Dima

Ben Salisbury

unread,
Sep 25, 2019, 9:02:28 AM9/25/19
to sage-devel
mth153844pe212:~ salis1bt$ otool -L /Users/salis1bt/sage-git/local/bin/gfortran
/Users/salis1bt/sage-git/local/bin/gfortran:
 
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
 
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
 
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)

Ben Salisbury

unread,
Sep 25, 2019, 9:04:28 AM9/25/19
to sage-devel
Sorry, I had left for the day when these messages came in yesterday.  Given the output of the otool - L /Users/salis1bt/sage-git/local/bin/gfortran, should I still do those brew installs?

Dima Pasechnik

unread,
Sep 25, 2019, 9:23:21 AM9/25/19
to sage-devel
On Wed, Sep 25, 2019 at 2:04 PM Ben Salisbury <bsali...@gmail.com> wrote:
>
> Sorry, I had left for the day when these messages came in yesterday. Given the output of the otool - L /Users/salis1bt/sage-git/local/bin/gfortran, should I still do those brew installs?


The output of otool -L looks OK, but I really don't understand the
error you got there, it looks as if some system library got updated,
breaking
already built Sage components, or perhaps one of dependencies in
that call did not link correctly, and the error stems from it.

what are the outputs of

otool -L /Users/salis1bt/sage-git/local/lib/libX.dylib

for X being in [dfftpack fftpack gfortran] ?

Regarding Homebrew: if you are a regular Homebrew user, then yes, by
all means, this would speed things up for everyone
if you used as many packages from Homebrew as possible...
(you probably would need to start the build from scratch after installing them)


>
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/dd98f3ce-262e-4ed4-a3d2-ba351dde5fb8%40googlegroups.com.

Ben Salisbury

unread,
Sep 25, 2019, 10:10:01 AM9/25/19
to sage-devel
Here are the outputs:

mth153844pe212:~ salis1bt$ otool -L  /Users/salis1bt/sage-git/local/lib/libdfftpack.dylib
/Library/Developer/CommandLineTools/usr/bin/objdump: '/Users/salis1bt/sage-git/local/lib/libdfftpack.dylib': No such file or directory
mth153844pe212
:~ salis1bt$ otool -L  /Users/salis1bt/sage-git/local/lib/libfftpack.dylib
/Library/Developer/CommandLineTools/usr/bin/objdump: '/Users/salis1bt/sage-git/local/lib/libfftpack.dylib': No such file or directory
mth153844pe212
:~ salis1bt$ otool -L  /Users/salis1bt/sage-git/local/lib/libgfortran.dylib
/Users/salis1bt/sage-git/local/lib/libgfortran.dylib:
 
/Users/salis1bt/sage-git/local/lib/libgfortran.4.dylib (compatibility version 5.0.0, current version 5.0.0)
 
/Users/salis1bt/sage-git/local/lib/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)
 
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
 
/Users/salis1bt/sage-git/local/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

As far as Homebrew is concerned, I wouldn't say I'm a regular user, but I have used it.  I'll try that approach now.

Ben Salisbury

unread,
Sep 25, 2019, 3:09:55 PM9/25/19
to sage-devel
Ok, I tried the Homebrew route, and still the build failed.  First, the computer successfully executed the following:

brew install dimpase/science/flint
brew install dimpase/science/arb
brew tap brewsci/bio
brew install matplotlib

Then I tried to build Sage again, after a distclean, and another matplotlib error came up.  Log file is attached.

John H Palmieri

unread,
Sep 25, 2019, 3:54:08 PM9/25/19
to sage-devel
Could you also trying using Homebrew to install gfortran?

Ben Salisbury

unread,
Sep 25, 2019, 3:56:10 PM9/25/19
to sage-devel
mth153844pe212:sage-git salis1bt$ brew install gcc
Warning: gcc 9.2.0 is already installed and up-to-date
To reinstall 9.2.0, run `brew reinstall gcc`

Dima Pasechnik

unread,
Sep 25, 2019, 4:02:28 PM9/25/19
to sage-devel
On Wed, Sep 25, 2019 at 8:56 PM Ben Salisbury <bsali...@gmail.com> wrote:
>
> mth153844pe212:sage-git salis1bt$ brew install gcc

brew install gfortran
https://formulae.brew.sh/cask/gfortran#default

in fact, you do not need gcc from brew, it might even be leading to problems.
I'd suggest you remove it.
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/5b089fcb-ffe1-4b7d-bc62-b7ce6b97ff0b%40googlegroups.com.

Ben Salisbury

unread,
Oct 1, 2019, 10:09:38 AM10/1/19
to sage-devel
I've uninstalled the Homebrew install of gcc.  I had posted that before because, upon attempting to install gfortran using Homebrew, I get

Error: No available formula with the name "gfortran"
GNU
Fortran is part of the GCC formula:
  brew install gcc

For completeness, in case something else is causing a conflict, here are my Homebrew packages.

mth153844pe212:sage-git salis1bt$ brew list
arb gdbm icu4c libffi little
-cms2 openblas pixman webp
cairo gettext ilmbase libheif lua openexr python x265
flint glib imagemagick libmpc lzo openjpeg python@2 xz
fontconfig gmp isl libomp matplotlib openssl qt
freetype gnuplot jpeg libpng mpfr openssl@1
.1 readline
fribidi graphite2 libcerf libtiff ntl pango shared
-mime-info
gd harfbuzz libde265 libtool numpy pcre sqlite

Note that I attempted to build Sage again after uninstalling gcc with Homebrew, and the build still fails.

Dima Pasechnik

unread,
Oct 1, 2019, 10:15:21 AM10/1/19
to sage-devel
On Tue, Oct 1, 2019 at 10:09 PM Ben Salisbury <bsali...@gmail.com> wrote:
>
> I've uninstalled the Homebrew install of gcc. I had posted that before because, upon attempting to install gfortran using Homebrew, I get
>
> Error: No available formula with the name "gfortran"
> GNU Fortran is part of the GCC formula:
> brew install gcc

Do you have gfortran in your PATH?
Perhaps gfortran9 or something like that?

If yes, do make distclean and then run configure with

FC=gfortran9 ./configure

then do make

otherwise,

uninstall gcc, which, I guess, blocks

brew install gfortran

(the latter should work)

Now, do make distclean

and

./configure
make


>
> For completeness, in case something else is causing a conflict, here are my Homebrew packages.
>
> mth153844pe212:sage-git salis1bt$ brew list
> arb gdbm icu4c libffi little-cms2 openblas pixman webp
> cairo gettext ilmbase libheif lua openexr python x265
> flint glib imagemagick libmpc lzo openjpeg python@2 xz
> fontconfig gmp isl libomp matplotlib openssl qt
> freetype gnuplot jpeg libpng mpfr openssl@1.1 readline
> fribidi graphite2 libcerf libtiff ntl pango shared-mime-info
> gd harfbuzz libde265 libtool numpy pcre sqlite
>
> Note that I attempted to build Sage again after uninstalling gcc with Homebrew, and the build still fails.
>
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/596ee366-a13e-463c-a115-35d6e851ff8e%40googlegroups.com.

Ben Salisbury

unread,
Oct 1, 2019, 10:26:02 AM10/1/19
to sage-devel
I had uninstalled and did a distclean before posting the last post, and brew install gfortran still does not work.

mth153844pe212:sage-git salis1bt$ brew uninstall gcc
Error: No such keg: /usr/local/Cellar/gcc
mth153844pe212
:sage-git salis1bt$ brew install gfortran

Dima Pasechnik

unread,
Oct 1, 2019, 10:46:59 AM10/1/19
to sage-devel
maybe you need to run "brew update" ?
Cause, here is the formula for gfortran
https://formulae.brew.sh/cask/gfortran#default

and it works on my OSX 10.13 (I'd be very surprised if it didn't on 10,14)
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/940dc8d6-d1e8-430c-a9b6-0ef2f99d5f71%40googlegroups.com.

Ben Salisbury

unread,
Oct 1, 2019, 10:54:58 AM10/1/19
to sage-devel
No such luck.

mth153844pe212:sage-git salis1bt$ brew update

Updated 1 tap (homebrew/core).

No changes to formulae.

Dima Pasechnik

unread,
Oct 1, 2019, 11:17:26 AM10/1/19
to sage-devel
looks like our brews are different...
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/10dd0000-f370-45b8-b95f-f2f2a673ac6b%40googlegroups.com.

Dima Pasechnik

unread,
Oct 1, 2019, 12:53:19 PM10/1/19
to sage-devel
maybe now (i.e after brew update)

brew uninstall gcc

followed by

brew install gfortran



will work?

(cause this:
$ brew uninstall gcc
Error: No such keg: /usr/local/Cellar/gcc
didn't succeed, IMHO)

Ben Salisbury

unread,
Oct 1, 2019, 1:00:54 PM10/1/19
to sage-devel
Same error as before.

mth153844pe212:sage-git salis1bt$ brew update
Updated 1 tap (homebrew/core).
==> Updated Formulae
django
-completion                                                                                    kubeseal
mth153844pe212
:sage-git salis1bt$ brew uninstall gcc
Error: No such keg: /usr/local/Cellar/
gcc
mth153844pe212
:sage-git salis1bt$ brew install gfortran

Dima Pasechnik

unread,
Oct 1, 2019, 1:05:45 PM10/1/19
to sage-devel
and what happens after

brew install gcc

?

Does it finish without an error? Does it install any gfortan* ?
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/c17bc26d-6b79-4f41-bd60-f5095c961a4b%40googlegroups.com.

Ben Salisbury

unread,
Oct 1, 2019, 1:12:42 PM10/1/19
to sage-devel
Running 'brew install gcc' works without an error.

mth153844pe212:sage-git salis1bt$ brew install gcc
==> Downloading https://homebrew.bintray.com/bottles/gcc-9.2.0_1.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/12/12951cda5ca32814387a1106fdaea9c4d4dd55e9c27f0dc7c044ab5e00dca695?__gda__=exp=1569950472~hmac=0f53b63ceb2e77eb83370ba311eb6c172d0cba3273717771f1e3c78c
######################################################################## 100.0%
==> Pouring gcc-9.2.0_1.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/gcc/9.2.0_1: 1,462 files, 292.2MB

Moreover, now both gfortran and gfortran-9 are now in my PATH.

Dima Pasechnik

unread,
Oct 1, 2019, 1:30:21 PM10/1/19
to sage-devel
OK,  apparently "brew update" did its magic, phew...
now do 

  make distclean
  ./configure
  make

should not build Sage's gcc/gfortran...



--
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+...@googlegroups.com.

Dima Pasechnik

unread,
Oct 1, 2019, 1:32:08 PM10/1/19
to sage-devel
Sorry, I was too quick. ./configure needs to be run as follows

  CC=clang CXX=clang++ ./configure

(otherwise Homebrew's gcc will be used, and it will break...)
(we only need gfortran from Homebrew,no gcc)

Ben Salisbury

unread,
Oct 1, 2019, 4:02:11 PM10/1/19
to sage-devel
Another build failure (seemingly at the same spot).  The log file is attached.
matplotlib-2.2.4.p0.log

Dima Pasechnik

unread,
Oct 1, 2019, 9:29:04 PM10/1/19
to sage-devel
The error is different, it is related to png.
and the error message even tells you what Homebrew package to install and how.

* The following required packages can not be built:
* png
* Try installing png with `brew install libpng` and
* pkg-config with `brew install pkg-config`


Apparently, building Sage's png has failed for some reason...

On Wed, Oct 2, 2019 at 5:02 AM Ben Salisbury <bsali...@gmail.com> wrote:
>
> Another build failure (seemingly at the same spot). The log file is attached.
>
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/36fcf6a6-23ec-414b-a3d1-85bec40110bc%40googlegroups.com.

Ben Salisbury

unread,
Oct 2, 2019, 10:43:25 AM10/2/19
to sage-devel
Success!!!  Thank you for all your help!
Reply all
Reply to author
Forward
0 new messages