Many high energy physics programs require special installation instructions for Mac OS X, and their issue trackers are often filled with unresolved Mac issues. Problems are also encountered when trying to link all these programs together.
Homebrew-hep is a Mac package manager for HEP programs, based on Homebrew, which tries to make life easier. In Homebrew language, it is a tap. From the end-user's perspective it is nice because it:
- keeps things organised in
/usr/local
- automatically handles package dependencies
- is easy to update programs
- Install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Tap homebrew-hep:
brew tap davidchall/hep
- Find out about package:
brew info <package>
- Install HEP packages:
brew install <package>
(e.g.brew install fastjet
)
Remember to regularly brew update
! More detailed installation instructions are found below.
All packages are tested on OS X 10.9 (Mavericks) on Travis CI virtual machines. The build status of each package can be viewed here - just click on an individual job to see a build log for that package.
Thanks to braumeister.org, package metadata can now be browsed visually! Here is a quick list though:
applgrid
fastjet
fastnlo
fjcontrib
hepmc
herwig
hoppet
jetvheto
lhapdf
madgraph5_amcatnlo
mcfm
mcgrid
nlojet++
openloops
pythia8
qcdnum
rivet
sacrifice
sherpa
thepeg
topdrawer
vbfnlo
vincia
whizard
yoda
Other useful Homebrew packages:
root
(brew tap homebrew/science
)python
(see here for why)bash-completion
(enables tab-completion for some HEP packages)
If your favourite package is missing, please request it on the issues page or consider making a contribution.
More documentation can be found through brew help
, man brew
, or the Homebrew wiki.
brew list
List installed packagesbrew update
Fetch the latest versions of the install scriptsbrew outdated
Show packages that have an updated version availablebrew upgrade
Upgrade all outdated packagesbrew cleanup
Remove old versions of packagesbrew doctor
Check your system for potential problemsbrew search <string>
Substring search for package
brew info <package>
Display package info (e.g. install options, dependencies)brew home <package>
Open package websitebrew install <package>
Install a specific packagebrew upgrade <package>
Upgrade a specific packagebrew uninstall <package>
Uninstall a specific packagebrew test <package>
Perform a quick test on the package
OS X doesn't provide compilers by default, so you must manually download these before starting. If you've already worked with C++ on your Mac then you probably have done this. There are two possible methods:
- Xcode: Download the full IDE from the App Store and install the command line tools from the menu: Preferences->Downloads.
- Command Line Tools for Xcode: Xcode is a big download, but you can download a package containing only the compilers. You will need to register with Apple Developers.
Homebrew-hep is just an extension ("tap") of the Homebrew package manager, so this must be installed. More detailed information on installing Homebrew is available on their wiki.
Quick install: Paste this into your terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Homebrew will keep all your packages organised within /usr/local
. This is great because this is one of the locations automatically searched for programs, libraries, etc.
- Executables are stored in
/usr/local/bin
- Libraries are stored in
/usr/local/lib
- Headers are stored in
/usr/local/include
- Other files are stored in
/usr/local/share
A central part of Homebrew is its list of formulae. A formula gives Homebrew a set of instructions to follow to install a package. A tap is just an external list of formulae to be added to Homebrew's central list.
To add a list of HEP packages to Homebrew, type brew tap davidchall/hep
.
You are now ready to use Homebrew to install HEP programs!
- Physics problems should be reported to the package developers (please
brew home <package>
) - Installation problems can be reported on the issue tracker
Any kind of contribution is welcome, but will require a GitHub account (GitHub is pretty awesome though). If you're unfamiliar with git version control, I suggest you spend a few minutes with this tutorial. The basic workflow is:
- make contribution locally
brew edit <package>
orbrew create http://example.com/<package>-0.1.0.tar.gz
- test, e.g.
brew install <package>
,brew test <package>
- conforms to style?
brew audit <package>
- fork homebrew-hep
cp /usr/local/Library/Formula/<package>.rb /path/to/your/repo
git commit <package>.rb && git push
- open pull request
The Homebrew files which control the package installations are written in Ruby. I realise that this is a language unfamiliar to most high energy physicists, so I am willing to help people to add new packages. If you are struggling with a contribution or have a package request, please open an issue to discuss.
This might be as simple as updating the url
and sha1
variables, but check the dependencies haven't changed and it still builds.
You can add a new dependency with depends_on
, and then usually pass the location to the configure
script (see the Herwig formula for an example). You can also add other options with option
. Again, it's a good idea to browse existing formulae for ideas, and even search through the main Homebrew repository.
- The
brew create http://example.com/foo-0.1.0.tar.gz
command will download the source tarball and create a template formula for you in the Homebrew repository:/usr/local/Library/Formula/foo.rb
. - You will need to edit the formula:
brew edit foo
. Homebrew maintains a guide on writing formulae. It might also be a good idea to browse other HEP formulae or the main Homebrew repository.