C++ Error building Sage

81 views
Skip to first unread message

Gareth Ma

unread,
May 1, 2025, 10:06:14 AM5/1/25
to sage-...@googlegroups.com, David...@univ-amu.fr
Hi all, this is yet another build problem with Sage.

Background: I was helping David with building Sage 10.6 on his M2 Macbook
yesterday using the Meson build method. In particular, I don't have the error
logs right now, but I believe David can reply and attach them later (CC'ed).

1. We started with a completely fresh source tarball download (10.6 stable).

2. Then we installed Miniforge following following
https://doc.sagemath.org/html/en/installation/conda.html.

3. Next, we followed https://doc.sagemath.org/html/en/installation/meson.html
Creating the sage-dev Conda environment worked successfully.

4. We then ran the `pip install --no-build-isolation --editable .`, but it
failed on the file src/sage/graphs/base/boost_interface.cpp

More specifically, it errored on Line 119 (index[boost:source(...)]), IIRC with
this error

> error: non-constant-expression cannot be narrowed from type ... (aka unsigned
long) to ... (aka int) in initializer list [-Wc++11-narrowing]

Is this a known issue? What can cause this? In particular, it compiles on my linux

Dima Pasechnik

unread,
May 1, 2025, 11:22:41 AM5/1/25
to sage-...@googlegroups.com, grh...@gmail.com
It's hard to tell, but does your environment use Apple's toolchain, or Conda toolchain.
Could it be that you forgot to activate the Conda environment?

Anyhow, I think 10.6 release is somewhat broken.
Try the latest beta instead.

Duma

Tobia...@gmx.de

unread,
May 1, 2025, 12:14:50 PM5/1/25
to sage-devel
That's probably due to a recent clang. Should be fixed by https://github.com/sagemath/sage/pull/39526 in the develop branch.

Gareth Ma

unread,
May 1, 2025, 12:18:03 PM5/1/25
to sage-...@googlegroups.com, david...@univ-amu.fr
Re Dima: Thank you for the help! We will try out latest beta and see how it goes.
 
Re Tobias: Thank you! The PR looks very relevant, so we will try out the latest beta again. I don’t remember the clang version, but it was compiled with -std=c++17 in one of the flags.
--
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/36544008-7d74-4612-bbca-36302fcbcbe9n%40googlegroups.com.

Dima Pasechnik

unread,
May 1, 2025, 1:03:34 PM5/1/25
to sage-...@googlegroups.com, david...@univ-amu.fr
For some reason, my proposal to release 10.6.1 to specifically fix this has fallen on deaf ears, I don't know why.
Instead I'm sending dozens of messages related to the 10.6 problem, thank you, the community, for the trust you place in me :-)

David Kohel

unread,
May 1, 2025, 4:06:31 PM5/1/25
to sage-...@googlegroups.com, Gareth Ma
Hi everyone,

Indeed, here is the relevant error line:

../../src/sage/graphs/base/boost_interface.cpp:119:34: error:
non-constant-expression cannot be narrowed from type 'value_type' (aka
'unsigned long') to 'int' in initializer list
[-Wc++11-narrowing-const-reference]

and the full log file is attached.  Any suggestions would be greatly
appreciated.

Best,

David


On 01/05/2025 16:06, Gareth Ma wrote:
> Ce mail provient de l'extérieur, restons vigilants
log

Dima Pasechnik

unread,
May 1, 2025, 4:58:34 PM5/1/25
to sage-...@googlegroups.com, David...@univ-amu.fr
Hi David,
I already mentioned that 10.6 release is broken.
Please use the latest beta (and perhaps you will need more not yet merged patches)

Dima
Reply all
Reply to author
Forward
0 new messages