Skip to content

Setting up your environment

Matthew Sun edited this page Jul 27, 2020 · 5 revisions

Installing Julia

  1. Install Julia. You can find a link to the appropriate installer at https://julialang.org/downloads/.
  2. Check to make sure you can run Julia from the command line. Open up a Terminal/Command Prompt and type julia and press Enter. If this results in an error instead of the Julia interpreter, there may be a PATH issue. You can find official instructions on how to add Julia to your PATH at this page.
  3. Install a code editor. For development in Julia, we recommend Juno, which requires the installation of Atom. You can find instructions on the steps to install Juno here.
  4. Check that you can run the Julia REPL in Atom. Open Atom and then click Juno > Open REPL. If you see an error, you may need to navigate to Juno > Settings and change the Julia Path to the appropriate location. This should allow you start the Julia interpreter from the REPL.

Setting up the GerryChain environment

  1. Open a Julia REPL. If you are using Atom as your IDE, open the GerryChainJulia directory in Atom and then start the REPL. Otherwise, go to the GerryChain Julia directory and type julia to start the interpreter.
  2. Type ] into the REPL and press Enter. Your command line prompt will change from julia> to (@vx.x) pkg> (where x.x is the version of Julia you have installed; e.g., 1.4). This is the built-in Package Manager Pkg, which we will use to enter our environment.
  3. Type activate . and press Enter. The command line should change to (GerryChain) pkg>.
  4. Type instantiate and press Enter. This should install the dependencies we need for our GerryChain package.
  5. Hit the backspace key. The command line prompt should change to julia>. We are back to our interpreter, but now we are in the GerryChain environment.
  6. Type import GerryChain and press Enter.
  7. Type using Pkg; Pkg.test() and press Enter. If all tests pass, we are good to go!

Clone this wiki locally