Trouble building from source

58 views
Skip to first unread message

Ben Wyser

unread,
Jun 5, 2021, 1:02:05 AM6/5/21
to sage-devel
I've attempted to build Sage from source, and it failed due to an error building OpenBLAS.  The log files, as well as a screenshot giving the rundown on my system, are attached.

It appears to not like my processor apparently being of type 'tigerlake' but I don't know what the fix should be.

I'd appreciate any help anyone can provide.
config.log
Screenshot from 2021-06-04 20-41-17.png
openblas-0.3.13.log

Dima Pasechnik

unread,
Jun 5, 2021, 2:21:35 AM6/5/21
to sage-devel


On Sat, 5 Jun 2021, 06:02 Ben Wyser, <ben....@gmail.com> wrote:
I've attempted to build Sage from source, and it failed due to an error building OpenBLAS.  The log files, as well as a screenshot giving the rundown on my system, are attached.

Most likely your system has OpenBLAS you can use, and not build from source.

Please run

./configure

and read the last page or so of its output.
It will tell you what you can install.

HTH



It appears to not like my processor apparently being of type 'tigerlake' but I don't know what the fix should be.

I'd appreciate any help anyone can provide.

--
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/c9f987b4-404b-47b9-aaed-adff1f538027n%40googlegroups.com.

Tirthankar Mazumder

unread,
Jun 5, 2021, 7:45:09 AM6/5/21
to sage-...@googlegroups.com
I actually had the same problem as you! I have the same processor and compiler and everything.

The problem happens because GCC 9.3.0 (the version of GCC that build-essential on Ubuntu 20.04 comes with) doesn't recognize tigerlake as a valid architecture (perhaps because it is new... I'm not entirely sure why it's this way).

The solution is very simple: Download GCC 10! GCC 10 accepts -march=tigerlake and -mtune=tigerlake as valid flags.

(This is the solution that enabled me to compile Sage 9.3 from source without any trouble whatsoever.)

Here are the commands you have to run: (The dollar signs convey the command prompt)
$sudo apt update
$sudo apt install gcc-10 g++-10

I found out yesterday, while building Sage 9.3, that gfortran is necessary because SciPy uses it, and SciPy seems to be an integral part of Sage. So, if you plan to build SciPy, download gfortran-10 as well:
$sudo gfortran-10

Now you have the compilers, but you still need to make gcc, g++, and gfortran to point to the newest versions of the software. This is where update-alternatives comes into play. Run these commands (courtesy of this website):
$sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
$sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
These commands set gcc-10 and g++-10 to a priority of 100 and set gcc-9 and g++-9 to a priority of 90 so that by default, gcc-10 and g++-10 are used whenever gcc/g++ is called. (Of course, this can be changed later on, if desired). As the website suggests, you can run sudo update-alternatives --config gcc to make sure that the action was performed correctly.

The same thing needs to be done for gfortran, if you plan on building SciPy from source:
$sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-10 100
$sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-9 90
Like before, you can run sudo update-alternatives --config gfortran to make sure that the action was performed correctly.

I hope this helps!

Ben Wyser

unread,
Jun 6, 2021, 1:37:28 AM6/6/21
to sage-...@googlegroups.com
Yep, this did the trick.  Thanks very much for your help!

--
You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/XHzqSPyuYec/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAC5%2B-Dod0Ggfo0C7GJg6Hqy0gvjua3PD1rD3sMgLiYyNam5oA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages