-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow building on OpenBSD #1504
Conversation
With this change, OpenBLAS builds and all tests pass on OpenBSD 6.2 using Clang. Tested on x86-64 only, with and without DYNAMIC_ARCH=1.
WIthout wanting to start a "political" discussion, do you expect OpenBSD to deviate significantly from the already supported FreeBSD ? Else I think your PR could be simplified to affect much fewer files... |
I'm not sure what you mean, they're different systems. Can you elaborate?
Yes, OpenBSD 6.2, which I tested this on, ships with both Clang 4.0.0 and GCC 4.2.1. It uses Clang as the default compiler starting with OpenBSD 6.2, i.e. |
It just occured to me that many of your changes added OS_OPENBSD where there already is OS_FREEBSD, so if it would be sufficient to define OS_FREEBSD when the actual name is either FreeBSD or OpenBSD fewer files would need to be touched. |
Ah, I see. That may work, but I'm hesitant to say one way or another whether it's completely kosher, as I'm not familiar with all of the differences between the FreeBSD and OpenBSD kernels. It might be best to leave them separate for now and perhaps simplify things later if we find that they can be safely combined in full generality. Does that seem okay to you?
GNU Make, I didn't try using CMake. I just checked the output of |
It is probably OK to have OpenBSD defined as Some OpenBSD architectures ship with both gcc-4.2.1 and clang-5.0.1 but some ship with only clang. Additionally, clang is actively tracked and updated on OpenBSD as new releases come out. On systems where both are shipped, |
Something that may be a little more robust would be to define something like #if defined(__FreeBSD__) || defined(__OpenBSD__)
OS_BSD_COMMON
#endif then use that in place of all current uses of I can also just define |
Thank you very much for the detailed explanation. I guess at that point it is not useful to go through extra hoops just to avoid changing one or two of the files. |
On this branch:
|
Ah, the Makefile is setting the compiler to |
Since (nearly) the exact same edits are needed for supporting DragonFly BSD, I've added a separate commit that includes the appropriate changes for DragonFly. I tested it with the default compiler, GCC, on its only supported architecture, x86-64. |
OpenBSD clang defines |
Thank you both, @ibara and @martin-frbg! |
With this change, OpenBLAS builds and all tests pass on OpenBSD 6.2 using Clang. Tested on x86-64 only, with and without
DYNAMIC_ARCH=1
.The only quirk here is that Clang is the default compiler on OpenBSD 6.2, and yet I still had to use
CC=clang
when building, otherwise OpenBLAS uses GCC. The default GCC version on OpenBSD is very old, so we run into #875. Let me know if there's something in the Makefile that needs to be adjusted that I've overlooked.cc @ibara, who may be interested in this.