This will install the latest develop branch of OpenBLAS. Julia will happily link against this new version, but unfortunately SuiteSparse will not, so we must recompile SuiteSparse and therefore Julia:
$ brew rm suite-sparse-julia julia
$ brew install julia
When installing OpenBLAS on that shiny new piece of hardware that just came out, note that OpenBLAS may not have the software available to autodetect your processor type. You can manually specify a CPU target architecture by specifying --target when building OpenBLAS. For instance, to specify the Sandybridge archiceture (a good fallback for most modern macs):
When building Julia, the file base/userimg.jl, if it exists, will be included in the cached of compiled code. If there are large libraries that you use often, it can be useful to require those in this file, for example:
By default, the userimg.jl file does not exist, but you can create it yourself and then rebuild the Julia system image. Place a userimg.jl file into /usr/local/Cellar/julia/<julia version>/share/julia/base (Assuming Homebrew has been installed to /usr/local), then run build_sysimg.jl (located in the folder immediatebly above the base directory) to rebuild the system image. The script has many options, to see them all run ./build_sysimg.jl --help, but if you just want to replace the current system image with the new one you're about to build (and most people do just want that) simply run:
$ ./build_sysimg.jl --force
To upgrade Julia, remove and reinstall (Typically you will be doing this when living on the latest development version, so we have included all --HEAD commands here):
$ brew rm julia
$ brew install --HEAD julia
Run tests after upgrading to make sure everything is functioning as expected. Even when Julia is able to build, the tests might still fail due to dependencies.
$ brew test -v --HEAD julia
If compilation of Julia fails, or the tests fail, you may have to remove these dependencies and recompile:
$ brew rm julia arpack-julia suite-sparse-julia openblas-julia
$ brew install -v --HEAD julia && brew test -v --HEAD julia
This procedure is necessary after upgrading gcc, as the location of the gfortran libraries changes.