Unable to build sage from source on M4 Macbook

43 views
Skip to first unread message

Pavel Galashin

unread,
Jan 2, 2025, 6:28:28 AM1/2/25
to sage-s...@googlegroups.com
Hi all,

I am trying to build a local sage version for development and keep running into the below problem. 

I have been following this manual and the README file. In particular, all the homebrew packages have been installed, and I also did the

source ./.homebrew-build-env

I am on an M4 Macbook Pro (2024), Mac OS Sequoia 15.2.
Not sure if this is relevant: I recently migrated from an intel 2020 macbook, and migrated homebrew as described here.

Any help would be appreciated!
[spkg-build] ld: warning: search path '/Users/user/sage/sage/local/var/lib/sage/venv-python3.12.5/lib' not found
[spkg-build] Undefined symbols for architecture arm64:
[spkg-build]   "_libintl_bindtextdomain", referenced from:
[spkg-build]       __locale_bindtextdomain in _localemodule.o
[spkg-build]   "_libintl_dcgettext", referenced from:
[spkg-build]       __locale_dcgettext in _localemodule.o
[spkg-build]   "_libintl_dgettext", referenced from:
[spkg-build]       __locale_dgettext in _localemodule.o
[spkg-build]   "_libintl_gettext", referenced from:
[spkg-build]       __locale_gettext in _localemodule.o
[spkg-build]   "_libintl_setlocale", referenced from:
[spkg-build]       __locale_setlocale in _localemodule.o
[spkg-build]       __locale_setlocale in _localemodule.o
[spkg-build]       __locale_localeconv in _localemodule.o
[spkg-build]       __locale_localeconv in _localemodule.o
[spkg-build]       __locale_localeconv in _localemodule.o
[spkg-build]       __locale_localeconv in _localemodule.o
[spkg-build]   "_libintl_textdomain", referenced from:
[spkg-build]       __locale_textdomain in _localemodule.o
[spkg-build] ld: symbol(s) not found for architecture arm64
[spkg-build] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[spkg-build] make[5]: *** [Programs/_freeze_module] Error 1
[spkg-build] ********************************************************************************
[spkg-build] Error building python3-3.12.5
[spkg-build] ********************************************************************************
************************************************************************
Error building package python3-3.12.5
************************************************************************

python3-3.12.5.log
config.log

Dima Pasechnik

unread,
Jan 2, 2025, 9:40:51 AM1/2/25
to sage-s...@googlegroups.com
Why won't you use Python from Homebrew?
Not that it explains your error, but they know how to build Python on macOS.

Dima Pasechnik

unread,
Jan 2, 2025, 11:22:34 AM1/2/25
to sage-s...@googlegroups.com
You can install Homebrew's Python 3.12 :

    brew install pyt...@3.12

and run

    ./configure --with-python=python3.12

to tell Sage to use it and do not build Python.





On 2 January 2025 06:27:09 GMT-05:00, Pavel Galashin <pgal...@gmail.com> wrote:

Pavel Galashin

unread,
Jan 2, 2025, 11:27:48 PM1/2/25
to sage-support
Thank you! Python was already installed by Homebrew but somehow not attached to the command ``python``, only to ``python3``. I symlinked one to the other and made progress (still getting another error but much later in the process and unrelated to python - will post in a different thread).
Reply all
Reply to author
Forward
0 new messages