since I found Arch based linux distros, I stopped having to deal with building anything from source, including sagemath, fricas, giac, etc...
I simply do
sudo pacman -S sagemath
or
yay -S sagemath
That is all. same for other software. the package manager does everything, you do not need to worry about any prerequisites or anything like this.
which sage
/usr/bin/sage
which fricas
/usr/bin/fricas
I use endeavouros linux distro which I like.
--Nasser