-
Notifications
You must be signed in to change notification settings - Fork 259
Look for for homebrew packages in the right places #3986
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
base: development
Are you sure you want to change the base?
Conversation
M2/cmake/check-libraries.cmake
Outdated
# TODO: replace gdbm, see https://github.com/Macaulay2/M2/issues/594 | ||
find_package(GDBM REQUIRED QUIET) # See FindGDBM.cmake | ||
|
||
list(APPEND CMAKE_PREFIX_PATH "$(brew --prefix libomp)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't read what you're doing in the autotools build but this should certainly not be hardcoded. It's up to the user to add brew directories to the path or not, and further there's a reason keg-only bottles are keg-only! e.g this may break depending on whether you build with GCC or clang.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My goal was to make it simpler for the user with a reasonable set of default search paths so that the build should work out of the box most of the time on common systems without fiddling with flags. And we're already hardcoding several other brew paths in the cmake build: 50ea574
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are hints for standard libraries without multiple implementations, which are used only if a library wasn't found elsewhere on the path. Appending the prefix directory of libomp can determine whether the compiler uses libomp or libgomp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that makes sense -- I'll remove the cmake changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note -- do we even need to deal with OpenMP on most builds? According to a comment in configure.ac:
This is required for building the library csdp and good for building the library normaliz
Most of the time, we'll be using existing system packages for these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fflas-ffpack, which is a header-only library, uses it, and if it's not found correctly you get a warning when building M2:
#warning "openmp was not detected correctly at configure time, please report this bug"
Fixing this on all homebrew builds was quite a headache, and I think at some point all cmake builds here were also working correctly but I see that the ubuntu one is failing now.
Let the build systems figure them out!
306b151
to
c6884a1
Compare
We add various homebrew package directories to the appropriate flags so that we can detect them at the beginning of the build without needing to set any variables ahead of time. The cmake build was already doing a pretty good job of this (it was just missing openmp), and we bring autotools in line with it.
This is on top of #3984 so that the macOS builds will actually work.
Cc: @mikestillman