Error building sage-10.8 on macOS Tahoe on a MacMini M2 pro

172 views
Skip to first unread message

Andreas Könen

unread,
Jan 1, 2026, 11:59:24 AMJan 1
to sage-devel
Hello, good morning and a Happy New Year 2026!

Yesterday a got the following error during make for sage 10.8 based on the standard tar:

...

[primecountpy-0.1.1] [spkg-install] g++ -std=gnu++11 -g -O2 -I/private/var/folders/g8/42n7xvhd1kl7zkmr3l7_8b_w0000gn/T/build-env-h9xdfx5q/lib/python3.14/site-packages/cysignals -I/private/var/folders/g8/42n7xvhd1kl7zkmr3l7_8b_w0000gn/T/build-env-h9xdfx5q/include -I/opt/homebrew/opt/pyt...@3.14/Frameworks/Python.framework/Versions/3.14/include/python3.14 -c primecountpy/primecount.cpp -o build/temp.macosx-26.0-arm64-cpython-314/primecountpy/primecount.o

[primecountpy-0.1.1] [spkg-install] primecountpy/primecount.cpp:3265:81: error: no matching function for call to 'pi'

[primecountpy-0.1.1] [spkg-install]  3265 |   __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(primecount::pi(__pyx_v_s)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)

[primecountpy-0.1.1] [spkg-install]       |                                                                                 ^~~~~~~~~~~~~~

[primecountpy-0.1.1] [spkg-install] /opt/homebrew/include/primecount.hpp:57:9: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'int64_t' (aka 'long long') for 1st argument

[primecountpy-0.1.1] [spkg-install]    57 | int64_t pi(int64_t x);

[primecountpy-0.1.1] [spkg-install]       |         ^  ~~~~~~~~~

[primecountpy-0.1.1] [spkg-install] /opt/homebrew/include/primecount.hpp:74:13: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'pc_int128_t' for 1st argument

[primecountpy-0.1.1] [spkg-install]    74 | pc_int128_t pi(pc_int128_t x);

[primecountpy-0.1.1] [spkg-install]       |             ^  ~~~~~~~~~~~~~

[primecountpy-0.1.1] [spkg-install] 1 error generated.

[primecountpy-0.1.1] [spkg-install] error: command '/usr/bin/g++' failed with exit code 1

...

Attached you find the corresponding log files.

Any help is appreciated.

Best wishes

Andreas


primecountpy-0.1.1.log
config.log

Dima Pasechnik

unread,
Jan 1, 2026, 4:19:17 PMJan 1
to sage-...@googlegroups.com
You need the update
from <https://github.com/sagemath/sage/pull/41341>

either do a git clone of the repo, and then,
once on the 10.8 branch, do

git pull origin pull/41341/head

or manually copy changed files from the PR into the build/ subdirectory.

(primecount 8.0 is already in Homebrew, so it should not even be necessary to build it)

After that, run
./bootstrap
./configure
make

Andreas Könen

unread,
Jan 2, 2026, 1:27:39 PMJan 2
to sage-devel
Thanks a lot, solved my problem! Sage compiled without any further error.

Best wishes 

Andreas

Sette Diop

unread,
Apr 21, 2026, 7:06:21 PM (6 days ago) Apr 21
to sage-...@googlegroups.com
Hi:

The recent macOS and Xcode 26.4.1 updates broke my sage-10.8 build. Unfortunately the new build of sage-10.8 runs thru a fatal error with givaro 4.2.1 install.

I did succeed installing givaro 4.2.1 thru Homebrew but I could not figure out how to tell sage-10.8 not re-install givaro and to use the version installed by Homebrew: the ./configure option "--with-system-givaro=yes” did not work.

Any help?

The givaro-4.2.1.log and config.log log files are attached.

givaro-4.2.1.log
config.log

Dima Pasechnik

unread,
Apr 21, 2026, 11:15:54 PM (6 days ago) Apr 21
to sage-...@googlegroups.com
I don't think the latest Xcode for arm64 macOS can built Sage 10.8.
You'd have better lack with the latest 10.9.rc0
> --
> 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 visit https://groups.google.com/d/msgid/sage-devel/785340F7-35DC-42B7-8B2F-79EC9C44DA80%40gmail.com.

Sette Diop

unread,
Apr 22, 2026, 4:01:08 AM (5 days ago) Apr 22
to sage-...@googlegroups.com
My 2019 MacBook Pro is not arm64 but Intel.

And I gave a try to the latest 10.9.rc0 and hit a fatal error with the install of fflas_ffpack-2.5.0+sage-2024-05-18b.

To me this error looks very similar to the previous one I reported concerning sage-10.8 with givaro install: using Homebrew "macaulay2/tap/fflas-ffpack 2.5.0 is already installed and up-to-date” but sage-10.9.rc0 fails when trying to re-install it.

The "fflas_ffpack-2.5.0+sage-2024-05-18b.log"" and “config.log” log files are attached.

fflas_ffpack-2.5.0+sage-2024-05-18b.log
config.log

Dima Pasechnik

unread,
Apr 22, 2026, 11:31:01 AM (5 days ago) Apr 22
to sage-...@googlegroups.com
I suggest to try
<https://github.com/sagemath/sage/pull/41626>
(enabling Accelerate with a configure option, look it up in the output of ./configure -h)

Sette Diop

unread,
Apr 22, 2026, 1:44:45 PM (5 days ago) Apr 22
to sage-...@googlegroups.com
Thanks so much Dima!

With the following commands

******
make configure
env
./configure --with-darwin-accelerate=yes
make
******

the sage-10.9.rc0 build made a progress but hit a new error with libgd:


******
Error building Sage.

The following package(s) may have failed to build (not necessarily
during this run of 'make all-start'):

* package: libgd-2.3.3
last build time: Apr 22 19:07
log file: /Applications/sage/logs/pkgs/libgd-2.3.3.log
build directory: /Applications/sage/local/var/tmp/sage/build/libgd-2.3.3
******


config.log
libgd-2.3.3.log

Dima Pasechnik

unread,
Apr 22, 2026, 2:04:10 PM (5 days ago) Apr 22
to sage-...@googlegroups.com
How about getting libgd from Homebrew rather than building it?

brew install gd

followed up by

make

should do the trick
> --
> 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 visit https://groups.google.com/d/msgid/sage-devel/FE33450D-D015-4F22-8904-A0D0DF2CE5D2%40gmail.com.

Sette Diop

unread,
Apr 22, 2026, 2:38:32 PM (5 days ago) Apr 22
to sage-...@googlegroups.com
The command

brew install gd

says

************
✔︎ JSON API cask.jws.json Downloaded 15.4MB/ 15.4MB
✔︎ JSON API formula.jws.json Downloaded 32.0MB/ 32.0MB
Warning: gd 2.3.3_6 is already installed and up-to-date.
To reinstall 2.3.3_6, run:
brew reinstall gd
************
and the command

make

Hit the same error as before:

************
Error building Sage.

The following package(s) may have failed to build (not necessarily
during this run of 'make all-start'):

* package: libgd-2.3.3
last build time: Apr 22 20:32
log file: /Applications/sage/logs/pkgs/libgd-2.3.3.log
build directory: /Applications/sage/local/var/tmp/sage/build/libgd-2.3.3
************


config.log
libgd-2.3.3.log

Dima Pasechnik

unread,
Apr 22, 2026, 5:46:16 PM (5 days ago) Apr 22
to sage-...@googlegroups.com
have a look at your config.log,search for libgd

Have you forgotten to run

source .homebrew-build-env

?

Cause for some reason ./configure cannot find pkg-config file
for bzip2, this in turn breaks detection of freetype, which in turn
breaks detection of your Homebrew libgd
(all this you can find in config.log)

And Homebrew does install, such a file, accouding to
https://github.com/Homebrew/homebrew-core/blob/9ee102d44d69ba2c000d9e436a4d8f546c107566/Formula/b/bzip2.rb

(perhaps you are overdue with running "brew upgrade")
> --
> 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 visit https://groups.google.com/d/msgid/sage-devel/89165315-E501-402F-BD53-DCE51DC89A59%40gmail.com.

Sette Diop

unread,
Apr 22, 2026, 6:35:53 PM (5 days ago) Apr 22
to sage-...@googlegroups.com
I make sure that gd is still installed by running the following command:

*************
seet@sage: brew install gd
✔︎ JSON API cask.jws.json Downloaded 15.5MB/ 15.5MB
✔︎ JSON API formula.jws.json Downloaded 32.0MB/ 32.0MB
Warning: gd 2.3.3_6 is already installed and up-to-date.
To reinstall 2.3.3_6, run:
brew reinstall gd
*************

Here are the lines of the config.log file concerning the installation of libgd:

*************
## Checking whether SageMath should install SPKG libgd... ##
## ------------------------------------------------------ ##
real_configure:36933: checking whether any of gcc libpng freetype is installed as or will be installed as SPKG
real_configure:36938: result: yes; install libgd as well
real_configure:37042: no suitable system package found for SPKG libgd
## ------------------------------------------------------------ ##
## Checking whether SageMath should install SPKG libgraphviz... ##
## ------------------------------------------------------------ ##



real_configure:138043: result: libgd: no suitable system package; standard, SPKG version 2.3.3 will be installed
*************

And here are the commands that were run for sage-10.9.rc0 build:

*************
./bootstrap
./configure --with-darwin-accelerate=yes
source /Applications/sage/.homebrew-build-env
make
*************

which lead to the same failure:

*************
Error building Sage.

The following package(s) may have failed to build (not necessarily
during this run of 'make all-start'):

* package: libgd-2.3.3
last build time: Apr 23 00:15
log file: /Applications/sage/logs/pkgs/libgd-2.3.3.log
build directory: /Applications/sage/local/var/tmp/sage/build/libgd-2.3.3
*************


Dima Pasechnik

unread,
Apr 22, 2026, 10:31:32 PM (5 days ago) Apr 22
to sage-...@googlegroups.com


On April 22, 2026 5:35:31 PM CDT, Sette Diop <sett...@gmail.com> wrote:
>I make sure that gd is still installed by running the following command:
>
>*************
>seet@sage: brew install gd
>✔︎ JSON API cask.jws.json Downloaded 15.5MB/ 15.5MB
>✔︎ JSON API formula.jws.json Downloaded 32.0MB/ 32.0MB
>Warning: gd 2.3.3_6 is already installed and up-to-date.
>To reinstall 2.3.3_6, run:
> brew reinstall gd
>*************
>
>Here are the lines of the config.log file concerning the installation of libgd:

Yes, you have to follow what it says in some depth. Namely, the reason that libgd is rejected is the following

>real_configure:36933: checking whether any of gcc libpng freetype is installed as or will be installed as SPKG
>real_configure:36938: result: yes; install libgd as well

Now, you can check that system gcc and libpng are accepted, but freetype is not.

Checking the corresponding part of the test of freetype will tell you that it's rejected, because the test cannot find pkg-config file for bzip2.


So you might want to verify that the latter is there, e.g. by running

pkg-config --path bzip2

it should return something like

/usr/local/Homebrew/Library/os/mac/pkgconfig/15/bzip2.pc

Note that it is an unusual path,
and inspection of this file will reveal that it is pointing at the native macOS libbz2, not one provided by Homebrew.

If it's not there, then your Homebrew install is broken.

HTH

Sette Diop

unread,
Apr 23, 2026, 10:48:22 AM (4 days ago) Apr 23
to sage-...@googlegroups.com
Thanks so much Dima! Specially for guiding to the reading of the very technical (to me) files “config.log” and others.

I first checked the path of pkg-config file for bzip2 and found that it is NOT

/usr/local/Homebrew/Library/os/mac/pkgconfig/15/bzip2.pc

BUT

/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/15/bzip2.pc

Also the command

pkg-config --path bzip2

results in the following error

****************
seet@sage: pkg-config --path bzip2
Unknown option —path
****************

Does this really mean my Homebrew install is broken?

-- 
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.

Sette Diop

unread,
Apr 23, 2026, 11:20:26 AM (4 days ago) Apr 23
to Dima Pasechnik, sage-...@googlegroups.com
*************
seet@sage: which pkg-config
/opt/local/bin/pkg-config
*************


Also the contents of the file

/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/15/bzip2.pc

reads as follows:

***********
homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
prefix=${homebrew_sdkroot}/usr
exec_prefix=/usr
bindir=${exec_prefix}/bin
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: bzip2
Description: Lossless, block-sorting data compression
Version: 1.0.8
Libs: -L${libdir} -lbz2
Cflags:
***********

Dima Pasechnik

unread,
Apr 23, 2026, 11:50:14 AM (4 days ago) Apr 23
to sage-...@googlegroups.com, sett...@gmail.com
What is the output of

   which pkg-config

?

It looks like it's a wrong one you are calling, and it might be due to something fishy in PATH.

Dima Pasechnik

unread,
Apr 23, 2026, 11:50:21 AM (4 days ago) Apr 23
to Sette Diop, sage-...@googlegroups.com
On Thu, Apr 23, 2026 at 10:20 AM Sette Diop <sett...@gmail.com> wrote:
>
> *************
> seet@sage: which pkg-config
> /opt/local/bin/pkg-config
> *************

this is a wrong one. The good one, /usr/local/bin/pkg-config, should
know the --path option;
it should all be like

% which pkg-config
/usr/local/bin/pkg-config
% pkg-config --path bzip2
/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/15/bzip2.pc

Please make sure that "/opt/local/bin" is not in your PATH before
trying to run ./configure

Sette Diop

unread,
Apr 23, 2026, 3:20:54 PM (4 days ago) Apr 23
to Dima Pasechnik, sage-...@googlegroups.com


> On Apr 23, 2026, at 5:49 PM, Dima Pasechnik <dim...@gmail.com> wrote:
>
> On Thu, Apr 23, 2026 at 10:20 AM Sette Diop <sett...@gmail.com> wrote:
>>
>> *************
>> seet@sage: which pkg-config
>> /opt/local/bin/pkg-config
>> *************
>
> this is a wrong one. The good one, /usr/local/bin/pkg-config, should
> know the --path option;
> it should all be like
>
> % which pkg-config
> /usr/local/bin/pkg-config
> % pkg-config --path bzip2
> /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/15/bzip2.pc

Now I have:

seet@sage: which pkg-config
/usr/local/bin/pkg-config

seet@sage: pkg-config --path bzip2
/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/26/bzip2.pc
seet@sage:


> Please make sure that "/opt/local/bin" is not in your PATH before
> trying to run ./configure

I commented the followings lines which are in ~/.zprofile:

# MacPorts
#export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
#export MANPATH="/opt/local/share/man:$MANPATH"


And I changed the directory name:

/opt/local into /opt/localDisabled

To prevent conflicts with MacPorts installs and I am still stuck in the libgd-2.3.3. install error:

**************
Error building Sage.

The following package(s) may have failed to build (not necessarily
during this run of 'make all-start'):

* package: libgd-2.3.3
last build time: Apr 23 20:58
log file: /Applications/sage/logs/pkgs/libgd-2.3.3.log
build directory: /Applications/sage/local/var/tmp/sage/build/libgd-2.3.3
**************


libgd-2.3.3.log
config.log
Reply all
Reply to author
Forward
0 new messages