jstac / quantecon_nyu_2016

Quantitative Economics
BSD 3-Clause "New" or "Revised" License
134 stars 77 forks source link

Julia installation #18

Closed sglyon closed 7 years ago

sglyon commented 8 years ago

Hi class,

Tomorrow Chase and I will spend the 2 hour class period helping you learn Julia well enough to use it to solve economic problems.

In preparation for this class we would like you to run the following shell script in your virtual machines to install Julia:

#!/usr/bin/env sh

wget -O julia_binary.tar.gz https://julialang.s3.amazonaws.com/bin/linux/x64/0.4/julia-0.4-latest-linux-x86_64.tar.gz

mkdir -p $HOME/src

rm -rf $HOME/src/julia*
mkdir -p $HOME/src/julia
tar -C $HOME/src/julia -zxf julia_binary.tar.gz --strip-components=1
rm julia_binary.tar.gz

# prepend julia to path
echo "Adding julia to path"
echo "export PATH=$HOME/src/julia/bin:$PATH" >> $HOME/.bashrc

To do this you should create a new file in your linux box and copy/paste the script above. Then you should run bash install_julia, assuming that you saved the above script in a file named install_julia. To verify that installation succeeded, you can open a new terminal window or tab and type julia. If you are greeted with a banner similar to what is below, everything worked.

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.3-pre+6 (2015-12-11 00:38 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit adffe19 (84 days old release-0.4)
|__/                   |  x86_64-apple-darwin15.2.0

julia>

Given that we are trying to cover a new and exciting programming language in just two hours, we ask that you make an effort to do this before class tomorrow.

We will spend the first few minutes of class making sure that installation went smoothly and everyone can run julia. The less time we have to spend on this, the more time we will have to show you all the exciting things you can do with Julia!

sglyon commented 8 years ago

If you are trying to use PlotlyJS.jl and are having issues, try the following:

From the ubuntu terminal prompt:

sudo apt-get update
sudo apt-get install git cmake build-essential check install

Then in Julia

Pkg.rm("PlotlyJS")
Pkg.add("PlotlyJS")
Pkg.build("PlotlyJS")

# if you want to use PlotlyJS outside the notebook
using Blink; Blink.AtomShell.install()

The rm and build steps are probably not necessary, but will cause Julia's package manager to do a clean install of PlotlyJS and a clean build of all dependencies.

I tried exactly those steps on a completely fresh ubuntu install and everything was installed and set up for me without a problem.

If that sounds like too much effort you can try Gadfly.jl or PyPlot.jl. I feel I should warn you that those packages are easy to break so installing either of those isn't necessarily any easier