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
mumps 5.6.2 (new formula) #154418
base: master
Are you sure you want to change the base?
mumps 5.6.2 (new formula) #154418
Conversation
Thanks for contributing to Homebrew! 🎉 It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request. |
Formula/m/mumps.rb
Outdated
gcc_major_ver = Formula["gcc"].any_installed_version.major | ||
optf << "-fallow-argument-mismatch" if gcc_major_ver >= 10 |
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.
The current one is 13, so this doesn't have to be a conditional
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.
Forgive me, I'm not overly familiar with homebrew, but is there no scenario where a user could have an older GCC? Or is that a scenario that's just not covered?
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.
You're depending on gcc, so it'll never be lower than it is now (gcc 13)
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.
Makes sense, thanks! Was not aware that's how homebrew resolved deps.
@SMillerDev I have addressed most comments. The remaining point of uncertainty from the previous review is the "magic". I've removed all that I can while still allowing MUMPS to build for me. I've reached out to the MUMPS folks to see about upstreaming the install target, but AFAICT they have no public VCS so I just have the patch locally. I don't foresee the quick installation logic I have here presenting much of a maintenance issue, and on the off chance MUMPS modifies their installation tree in a way the recipe doesn't handle, it's a quick update. Maintaining the patch arbitrarily seems much harder and I'd rather not hold off this MR on a mailing list response. All other build system intervention is fairly site-specific (or are specific instructions from the MUMPS build docs) and as such can't really be upstreamed in a generic fashion. |
The errors in the compilation might be due to the fact that the present formula compiles with clang. Given the fact that it is a (mixture) of fortran and c, compiled with gfortran, the gcc compiler might be more appropriate. |
@fahasch Thanks for the insight, I was under the impression that this stanza: |
I'm not completely sure: it is true that I just tried your formula locally (on MacOS). It turns out that the problem is with the linker. The option |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
41516a7
to
2b6c84d
Compare
2b6c84d
to
9c61851
Compare
cc52899
to
4671ad3
Compare
@fahasch I believe I have made all requested edits and the package seems to be working now. |
Agreed! Let us see what @SMillerDev thinks about the formula. |
Formula/m/mumps.rb
Outdated
inreplace "Makefile.inc", ".so", ".dylib" unless OS.linux? | ||
inreplace "Makefile.inc", "# RPATH_OPT = -Wl,-rpath,/path/to/MUMPS_x.y.z/lib/", "RPATH_OPT = -Wl,-rpath,#{lib}" | ||
make_args = ["CDEFS=-DAdd_", "OPTF=-fallow-argument-mismatch"] | ||
make_args += ["CC=#{ENV["CC"]} -fPIC", |
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.
make_args += ["CC=#{ENV["CC"]} -fPIC", | |
make_args += ["CC=#{ENV.cc} -fPIC", |
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.
Addressed
4671ad3
to
9b681f4
Compare
@SMillerDev I believe I have either responded to or addressed your concerns/comments and this PR is ready for another round of review feedback. |
@SMillerDev @fahasch Just wanted to circle back on this to keep things moving forward, please let me know what I can do to promote the progressions of this MR. |
Formula/m/mumps.rb
Outdated
license "CECILL-C" | ||
|
||
# Core dependencies | ||
depends_on "gcc" |
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.
Does it depend on GCC at runtime?
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.
No, how do I express a build/link only dep?
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.
depends_on "gcc" => :build
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.
Thanks!
inreplace "Makefile.inc", "-soname", "-install_name" unless OS.linux? | ||
inreplace "Makefile.inc", ".so", ".dylib" unless OS.linux? | ||
inreplace "Makefile.inc", "# RPATH_OPT = -Wl,-rpath,/path/to/MUMPS_x.y.z/lib/", "RPATH_OPT = -Wl,-rpath,#{lib}" |
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.
Have these issues been reported/fixed upstream?
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 am discussing ln:16 and ln:17 with the MUMPS developers, ln:18 is not an issue, it's an expected and documented part of the MUMPS build workflow if you want to build w/ RPATHS.
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.
it's an expected and documented part of the MUMPS build workflow if you want to build w/ RPATHS.
Can you link to the documentation then here please?
inreplace "Makefile.inc", "-soname", "-install_name" unless OS.linux? | |
inreplace "Makefile.inc", ".so", ".dylib" unless OS.linux? | |
inreplace "Makefile.inc", "# RPATH_OPT = -Wl,-rpath,/path/to/MUMPS_x.y.z/lib/", "RPATH_OPT = -Wl,-rpath,#{lib}" | |
# Required to build with RPATH: | |
# https://some.li/nk | |
inreplace "Makefile.inc", "-soname", "-install_name" unless OS.linux? | |
inreplace "Makefile.inc", ".so", ".dylib" unless OS.linux? | |
inreplace "Makefile.inc", "# RPATH_OPT = -Wl,-rpath,/path/to/MUMPS_x.y.z/lib/", "RPATH_OPT = -Wl,-rpath,#{lib}" |
Formula/m/mumps.rb
Outdated
end | ||
|
||
test do | ||
cd testpath do |
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.
Tests are always in the testpath
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.
🤦♂️ That makes a lot of sense. Will remove.
make_args = ["CDEFS=-DAdd_", "OPTF=-fallow-argument-mismatch"] | ||
make_args += ["CC=#{ENV.cc} -fPIC", | ||
"FC=gfortran -fPIC -fopenmp", | ||
"FL=gfortran -fPIC -fopenmp"] | ||
# Default lib args | ||
# Note: MUMPS link cannot find LAPACK without these | ||
# lines | ||
blas_lib = "-L#{Formula["openblas"].opt_lib} -lopenblas" | ||
make_args << "LIBBLAS=#{blas_lib}" | ||
make_args << "LAPACK=#{blas_lib}" |
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.
Can you add a comment with the upstream issue report for this? Because it shouldn't need this much custom configuration to compile right?
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 find it pretty common that makefile systems rely on non-trivial user intervention to correctly setup the make variables for a given build environment. MUMPS seems to take that approach.
The OPTF
and CDEFS
args are actually specifically required by the MUMPS build instructions docs, as are the blas and lapack specs and most of the extra compile flags. From the MUMPS build docs: "in most cases, Makefile.inc should be adapted to fit with your architecture, libraries and compilers" . I absolutely agree there are improvements than can/should be made to the MUMPS build system, and I have reached out to the MUMPS devs.
I have reached out to the MUMPS devs about an install target, and a MacOS specific makefile, as well as a few of the places I do think we should not have to specify a make argument. However the MUMPS developers do not maintain as public facing issue tracker, VCS, or archive of any kind AFAICT (from googling and some communication on the general mailing list), so there unfortunately is nothing for you folks to monitor, track, or reference. I am communicating with them through their dev mailing list, and general mailing list, which is also how I will submit patches if and when there are any. I understand you would like to avoid the added maintenance of arguments specified to a build system, so how would you like to proceed here given this context?
To be clear, I am happy to upstream or iterate on whatever is definitively necessary to upstream to make this PR work for homebrew, but with no tracking, I think perhaps this PR can move in tandem with my upstreams to MUMPS.
Maybe there's someone at homebrew I can CC on some of the MUMPS threads?
Additionally, all that said, the lack of -lblas
in Make.inc/Makefile.G95.SEQ
is almost certainly a bug, and I will include that in my iterations with the MUMPS devs.
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 find it pretty common that makefile systems rely on non-trivial user intervention to correctly setup the make variables for a given build environment
No, it's really not that common if you look at the software inside of Homebrew.
# Makefile provides no install target, perform as needed install | ||
# Install libraries | ||
lib.install Dir["lib/#{shared_library("*")}"] | ||
lib.install Dir["libseq/libmpiseq#{shared_library("*")}"] | ||
# Install headers | ||
libexec.install "include" | ||
(libexec/"include").install Dir["libseq/*.h"] | ||
include.install_symlink Dir[libexec/"include/*"] | ||
# Install docs and examples | ||
doc.install Dir["doc/*.pdf"] | ||
pkgshare.install "examples" |
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.
Can we submit a patch upstream that adds an install target?
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 am discussing this with the MUMPS developers on their dev mailing list. AFAICT (and from a response on the general mailing list) there are 0 public facing resources/trackers for MUMPS development, and changes are submitted via that same mailing list, so there is nothing for homebrew to track/reference that would have any meaning.
1703368
to
2b5b418
Compare
@SMillerDev Apologies for the delay, I've been OOO for the past week. |
If there is a mailing list archive link, I think that would be good to add as reference. Otherwise this conversation will have to do. |
@SMillerDev I've been looking for an archive for a while now to no results. There's clearly an option to access the archive in the MUMPS mailing list signup UI, but the option appears non functional/enabled. At this point, it seems like this conversation is all we'll have to document this issue, so LGTM? |
I'd like to help push this over the finish line, if I can. What work still remains here before this can merge? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
@SMillerDev Last I understood these changes were ready for the upstream a few weeks ago, are there remaining blockers? What can we do to move this PR along and prevent stale-ness? |
Currently the only tap vendoring MUMPS is no longer maintained and is out of date. Packages currently in brew/core actually depend on MUMPS and vendor the package as a resource rather than a package in its own right, which has resulted in some users installing things like ipopt simply to get the mumps headers/etc. MUMPS should be a first class package. Add first class MUMPS support via a new formula for MUMPS 5.6.2
MUMPS has been added as a first class package from its actual source repository. Ipopt should depend on that rather than bringing in MUMPS as a resource from a third party repo.
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'm willing to change my mind here but: vendoring looks like a much better option here:
- the building and installation of this software is a mess
- it doesn't work with Clang (the default macOS compiler for an age)
- it seems extremely likely to break or have essential parts missed in future upgrades
Sorry @johnwparent, I appreciate all the effort here and am willing to change my mind here if there's enough documentation added and linked to that this all becomes obvious but, as-is, this seems like a lot of work to maintain and much more messy than the previous vendoring approach.
# Core dependencies | ||
depends_on "gcc" => :build | ||
depends_on "openblas" | ||
fails_with :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.
Does this fail always and unconditionally with Clang? Why is that?
inreplace "Makefile.inc", "-soname", "-install_name" unless OS.linux? | ||
inreplace "Makefile.inc", ".so", ".dylib" unless OS.linux? | ||
inreplace "Makefile.inc", "# RPATH_OPT = -Wl,-rpath,/path/to/MUMPS_x.y.z/lib/", "RPATH_OPT = -Wl,-rpath,#{lib}" |
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.
it's an expected and documented part of the MUMPS build workflow if you want to build w/ RPATHS.
Can you link to the documentation then here please?
inreplace "Makefile.inc", "-soname", "-install_name" unless OS.linux? | |
inreplace "Makefile.inc", ".so", ".dylib" unless OS.linux? | |
inreplace "Makefile.inc", "# RPATH_OPT = -Wl,-rpath,/path/to/MUMPS_x.y.z/lib/", "RPATH_OPT = -Wl,-rpath,#{lib}" | |
# Required to build with RPATH: | |
# https://some.li/nk | |
inreplace "Makefile.inc", "-soname", "-install_name" unless OS.linux? | |
inreplace "Makefile.inc", ".so", ".dylib" unless OS.linux? | |
inreplace "Makefile.inc", "# RPATH_OPT = -Wl,-rpath,/path/to/MUMPS_x.y.z/lib/", "RPATH_OPT = -Wl,-rpath,#{lib}" |
make_args = ["CDEFS=-DAdd_", "OPTF=-fallow-argument-mismatch"] | ||
make_args += ["CC=#{ENV.cc} -fPIC", | ||
"FC=gfortran -fPIC -fopenmp", | ||
"FL=gfortran -fPIC -fopenmp"] | ||
# Default lib args | ||
# Note: MUMPS link cannot find LAPACK without these | ||
# lines | ||
blas_lib = "-L#{Formula["openblas"].opt_lib} -lopenblas" | ||
make_args << "LIBBLAS=#{blas_lib}" | ||
make_args << "LAPACK=#{blas_lib}" |
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 find it pretty common that makefile systems rely on non-trivial user intervention to correctly setup the make variables for a given build environment
No, it's really not that common if you look at the software inside of Homebrew.
It does work with clang, compiling MUMPS on my machine with Clang absolutely works. Also it seems that all these environment modifications are not necessary - here is my
Works within a regular shell and just |
The |
Currently the only tap that I could find vendoring MUMPS is no longer maintained and is out of date. Packages currently in brew/core actually depend on MUMPS and vendor the package as a resource rather than a package in its own right, which has resulted in some users installing things like
ipopt
simply to get the mumps headers/etc.MUMPS should be a first class package.
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?