clang on OS X and beyond

58 views
Skip to first unread message

François Bissey

unread,
Jun 22, 2017, 7:50:12 PM6/22/17
to sage-...@googlegroups.com
Hi all,

I think it is time to say where we are again in regards to supporting
building sage with clang on OS X rather than gcc.

There are two tickets currently needed to achieve it:

https://trac.sagemath.org/ticket/22646 which aim is to make your compiler
configuration to “stick” if it isn’t the default or in a default path.
Not strictly necessary but it touches a lot of the same code and prevent
some “accidents”.

https://trac.sagemath.org/ticket/12426 which is clang support proper.
There are a few things done in this ticket:
* allow clang/clang++ to be used for C/C++
* Add a separate gfortran package to build if you have a C/C++ compiler
but no gfortran. Which is the case on OS X by default of course.
For a while I was trying to get the gcc spkg to just install gfortran
in some circumstances. This was rather cumbersome and had a number of
potential problems.
While looking like more overhead a separate spkg is much cleaner.
The gcc spkg still builds gfortran, and the gfortran spkg cannot be installed
if the gcc spkg is already installed. But you can install the gcc spkg to
replace the gfortran one.

There are a number of consequences to all that. In the past the versions
of gcc and gfortran needed to match otherwise building of the gcc package
would be triggered. Not anymore, and Vincent Delecroix successfully built
and doctested sage with gcc/g++ 6.3.0 and gfortran 7.1.0.
On OS X you can bring your own gfortran or your own gcc (gcc 6.3.0 from homebrew
seems to have issues however).

The support for clang also makes porting sage to freeBSD easier. But there is
still a few issue there.

The support added is not strictly clang only. A C/C++ compiler faking to
be gcc, like clang does (that means icc), will be enabled by this.

Lastly, it is also technically possible to use clang (or any other compiler
enabled by the move) on linux but the following ticket needs to be merged
for that to be possible:
https://trac.sagemath.org/ticket/23046

On the down side two standard packages fails their test suite with clang
eclib: https://github.com/JohnCremona/eclib/issues/19
and
giac - giac has a patch for one of its test when built against pari 2.9.x
because the order a result is presented changes. When compiled with clang
the test pass without the patch.

I am not sure this is material for 8.0 this far in the cycle. But we should
definitely think about it for 8.1.

Feedback and review of the above three sage tickets from more people
would be appreciated.

François

Dima Pasechnik

unread,
Jun 27, 2017, 7:23:24 AM6/27/17
to sage-devel
The recent update of #22679 shows that on FreeBSD 11.0 we are down to a couple of seemingly minor test failures for esoteric features, and a couple of test failures with numerical noise (also seen on OSX clang builds).

So as soon as #12426 is ready, we can also (re)enable Sage FreeBSD, I think.
Reply all
Reply to author
Forward
0 new messages