Repository navigation
Description
Ciao! As discussed with @oschulz, I wrote a homebrew formula for BAT. The package manager is widely used on MacOS and there's also a Linux fork, less used but still nice!
For now the formula is hosted in a local repository: bat.rb. It's very easy to install it:
brew tap gipert/physics
brew install bat
or simply
brew install gipert/physics/bat
one can browse the available building options with brew info bat, as you see I made the formula depend on cuba.rb.
The advantage for the BAT team to maintain such a formula would be to be able to offer an embarrassingly easy installing procedure to OSX users (but also Linux, as I said)
The formula could be even submitted to the official core repository, but as I experienced the editors are quite pedantic on syntax etc. so it could be a bit painful. This would avoid to ask to use an external repo, but actually the big advantage for BAT to be hosted in homebrew-core would be to offer the user to install a binary package ("bottle" in the homebrew jargon) instead of building from source every time. All this is done automatically! There are also a bunch of other nice features, in general Homebrew is a great package manager.
I didn't test the formula on Linux yet, but it should work straightforwardly. The main difference is that the --with-multithreading flag should appear only on Linux systems (because OSX Clang does not support OpenMP clauses yet)
Coming now to the questions: looking at how I wrote the formula here,
1. I install also examples and docs like this:
(share/"BAT/examples").install Dir["examples/basic"]
(share/"BAT/examples").install Dir["examples/advanced"]
(share/"BAT").install Dir["doc"]Do you think it's necessary?
2. A test section needs to be defined, such that the user can test the installation with brew test bat. As you see right now I run basic/binomial/runEfficiency as a check, but I know there's make check which should be more proper to run. The problem is that, on OSX it fails with:
/Library/Developer/CommandLineTools/usr/bin/make check-TESTS
PASS: BCParameter.TEST
PASS: test.TEST
PASS: BCAux.TEST
PASS: BCMath.TEST
PASS: parallel.TEST
PASS: BCHistogram.TEST
PASS: BCPrior.TEST
../test-driver: line 107: 63373 Abort trap: 6 "$@" > $log_file 2>&1
FAIL: BCIntegrate.TEST
PASS: BCFitter.TEST
PASS: BCSummaryTool.TEST
PASS: BCEngineMCMC.TEST
PASS: BCModel.TEST
============================================================================
Testsuite summary for BAT 1.0.0-RC2
============================================================================
# TOTAL: 12
# PASS: 11
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
============================================================================
See test/test-suite.log
============================================================================
make[3]: *** [test-suite.log] Error 1
make[2]: *** [check-TESTS] Error 2
make[1]: *** [check-am] Error 2
make: *** [check-recursive] Error 1
and on Linux it remains stuck here:
PASS: BCParameter.TEST
PASS: test.TEST
PASS: BCAux.TEST
PASS: BCMath.TEST
PASS: BCHistogram.TEST
PASS: BCPrior.TEST
Another problem is that this check can be done only in the build directory and not on the actual installation, so it can't be used like this in a test do ... end section because of how homebrew works...
Activity
fredRos commentedon May 8, 2018
Dear @gipert , thanks a lot for your effort. I think it's great if life is easier for mac users, at least for those using homebrew. Obviously we have to iron out a few things here and there but the target should certainly be to make it part of homebrew core. I had similar experience with picky maintainers of the conda forge channel and it took a few weeks until my package galario had made its way but it was worth it because the maintainers did help to improve the build robustness.
Thanks again for preparing the formula, great job!
Personally I would not install the docs. We are in the process of converting our documentation to all html that we want to host on github. The new manual will link with the reference guide. We will still have a PDF manual built from the same sources but I wouldn't want users to have to install all the dependencies to be able to build the docs themselves. I haven't decided yet if we put the self-contained PDF into the release. In any case, I think users will find the html docs more fun to use. Here is a preview https://fredros.github.io/bat-docs/master/manual/html/cha-basics.html
That seems to be a separate issue. We definitely have to get the tests to also pass on mac os. We have to get our test mac box up and running again to check this out
gipert commentedon May 8, 2018
I absolutely agree about the docs, I'm removing that installation part for now. The HTML docs look much nicer (and handy)!
Se let's wait for BAT 1.0 to update the formula and submit it to homebrew-core (I'm already trying to do that with cuba here, but no one is caring right now)
I don't know if it would be better to move the repository with the BAT (and cuba or whatever) formula under the bat organisation, so that it will be easier for any developer in the future to maintain it...
Do you know why the test suite gets stuck on Linux? After 10 minutes or so it was still doing stuff (without any output):
gipert commentedon Jun 16, 2018
Just opened a PR on
homebrew-core-> Homebrew/homebrew-core#29116
Let's see what happens...