You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the configure script, having GCC on the user's PATH takes precedence over Clang or cc. This ends up picking up OpenBSD's default GCC 4.2.1 installation, which is too old to build BLIS. GCC is actually no longer the default compiler on OpenBSD; cc now points to clang as of OpenBSD 6.2.
This poses a subtly different problem on FreeBSD, where Clang is the default compiler as of FreeBSD 11.0 and GCC is no longer installed by default. If someone installs GCC from the Ports Collection then reconfigures BLIS without specifying CC=, they will suddenly be using GCC instead of Clang.
It seems like the best course of action across all platforms would be to check ccfirst rather than last, and fall back to looking for GCC or Clang if that fails.
One possible problem is that using cc will pick up the system compiler on macOS (which is a problem for homebrew users who would prefer gcc or non-Apple clang) and on Linux (where a user-built or -loaded compiler will be skipped). I see three options:
Pick the "least bad" ordering and stick with it.
Use different ordering for different operating systems.
On Mac, BLIS is doing the right thing, because the system compiler is crippled (e.g. has no OpenMP). For OpenBSD, we should prioritize cc over compilers PATH.
Thanks for breaking it down for us, Devin. Also, thanks for your suggestion, Jeff.
I've never used OpenBSD, nor do I have access to a system with it installed. Can someone tell me if we can rely on uname to detect OpenBSD, and if so, what is the expected output of uname -s? Is it simply OpenBSD?
@ararslan Okay, give 55ebf24 a shot. The normal search list/order is now gcc clang cc, except on OpenBSD, where it is cc gcc clang. (And if CC is set, it is added to the beginning of the search list automatically.)
Is cc updated when a newer version of clang is installed (via ports?)? If not, then perhaps clang gcc cc would make the most sense on *BSD (or gcc last).
No, cc always points to the system's default compiler, which remains static for each version of the OS. The same is true of clang, at least on FreeBSD (with which I'm more familiar than OpenBSD but I assume they're the same in this regard). On FreeBSD, when you install a new version of Clang from Ports, it's actually not available in your PATH; you have to fully qualify it in order to use it. This avoids shadowing the system's clang.
I haven't tried BLIS on NetBSD or DragonFly, but it may be worthwhile to note that they use GCC as their default compiler; it's only FreeBSD and OpenBSD that use Clang by default at the moment.
Activity
devinamatthews commentedon May 11, 2018
One possible problem is that using
ccwill pick up the system compiler on macOS (which is a problem for homebrew users who would prefergccor non-Appleclang) and on Linux (where a user-built or -loaded compiler will be skipped). I see three options:jeffhammond commentedon May 11, 2018
On Mac, BLIS is doing the right thing, because the system compiler is crippled (e.g. has no OpenMP). For OpenBSD, we should prioritize
ccover compilersPATH.fgvanzee commentedon May 13, 2018
Thanks for breaking it down for us, Devin. Also, thanks for your suggestion, Jeff.
I've never used OpenBSD, nor do I have access to a system with it installed. Can someone tell me if we can rely on
unameto detect OpenBSD, and if so, what is the expected output ofuname -s? Is it simplyOpenBSD?ararslan commentedon May 14, 2018
Yes,
uname -sis OpenBSD on OpenBSD.fgvanzee commentedon May 14, 2018
@ararslan Okay, give 55ebf24 a shot. The normal search list/order is now
gcc clang cc, except on OpenBSD, where it iscc gcc clang. (And ifCCis set, it is added to the beginning of the search list automatically.)ararslan commentedon May 14, 2018
Any chance it could be
cc clang gcc(Clang before GCC) on both OpenBSD and FreeBSD?ararslan commentedon May 14, 2018
Looks like 55ebf24 fixes this on OpenBSD. Thanks!
fgvanzee commentedon May 14, 2018
@ararslan Yes, I will change it to
cc clang gccfor OpenBSD and FreeBSD.fgvanzee commentedon May 14, 2018
Okay, try 9dbce16.
devinamatthews commentedon May 15, 2018
Is
ccupdated when a newer version ofclangis installed (via ports?)? If not, then perhapsclang gcc ccwould make the most sense on *BSD (orgcclast).ararslan commentedon May 15, 2018
No,
ccalways points to the system's default compiler, which remains static for each version of the OS. The same is true ofclang, at least on FreeBSD (with which I'm more familiar than OpenBSD but I assume they're the same in this regard). On FreeBSD, when you install a new version of Clang from Ports, it's actually not available in your PATH; you have to fully qualify it in order to use it. This avoids shadowing the system'sclang.ararslan commentedon May 15, 2018
I haven't tried BLIS on NetBSD or DragonFly, but it may be worthwhile to note that they use GCC as their default compiler; it's only FreeBSD and OpenBSD that use Clang by default at the moment.