-
Notifications
You must be signed in to change notification settings - Fork 12
Setting up your environment
Matthew Sun edited this page Jul 27, 2020
·
5 revisions
- Install Julia. You can find a link to the appropriate installer at https://julialang.org/downloads/.
-
Check to make sure you can run Julia from the command line. Open up a Terminal/Command Prompt and type
juliaand press Enter. If this results in an error instead of the Julia interpreter, there may be aPATHissue. You can find official instructions on how to add Julia to yourPATHat this page. - 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.
-
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 toJuno > Settingsand change the Julia Path to the appropriate location. This should allow you start the Julia interpreter from the REPL.
-
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
juliato start the interpreter. -
Type
]into the REPL and pressEnter. Your command line prompt will change fromjulia>to(@vx.x) pkg>(wherex.xis the version of Julia you have installed; e.g.,1.4). This is the built-in Package ManagerPkg, which we will use to enter our environment. -
Type
activate .and pressEnter. The command line should change to (GerryChain) pkg>. -
Type
instantiateand pressEnter. This should install the dependencies we need for our GerryChain package. -
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. - Type
import GerryChainand pressEnter. -
Type
using Pkg; Pkg.test()and press Enter. If all tests pass, we are good to go!