1) get macports. First requires XCode (https://developer.apple.com/xcode/) and XCode command line tools (http://guide.macports.org/#installing.xcode) 2) Install the macports "Suitesparse" package. Open terminal and type "port search suitesparse" to search for the package. Once you've found it, install the package. For me, typing "sudo port install SuiteSparse" did the trick. 2) Save C++ code aiyagari_diffusion_equilibrium.cpp and makefile into some directory 3) in terminal, navigate to folder with the C++ code. Type "make". This should generate an executable called "test" 4) To run it, type "./test" 5) When changing parameters, first type “make clean” to delete files created in the compilation process for previous parameterization. Then type “make” to compile with new parameters.