Skip to content

Commit

Permalink
simplify julia install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed May 22, 2024
1 parent e9f6c36 commit 9ae0826
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 50 deletions.
51 changes: 9 additions & 42 deletions FIRST_STEPS.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,18 @@
# Installing Julia

**Important** When following the following **four steps**, be sure the version
of Julia you install is **version 1.10.x**, where **x** is any integer.
Follow these **four** steps to install Julia on your computer:

While Julia can be run in the cloud (see e.g.,
[here](https://juliahub.com/ui/Home)) we recommend installing Julia on
your machine when starting out:
1. If you are a Windows user, install [Windows Terminal](https://aka.ms/terminal) and make
sure you know how to open a new terminal process (window), into which you can type
commands. If the link doesn't work, try a different browser.

1. If you are a Windows user, install [Windows
Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-nz&gl=nz)
and make sure you know how to open a new terminal process, into which you can type
commands.

2. Install the julia compiler:
2. Follow [these official installation instructions](https://julialang.org/downloads/).

- Mac: Download the appropriate the file ending in `.dmg` appropriate to your processor
and follow [these instructions](https://julialang.org/downloads/platform/#macos).

- Ubuntu and other Linux distributions: Follow [these
instructions](https://ferrolho.github.io/blog/2019-01-26/how-to-install-julia-on-ubuntu)
**but replace "1.8" with "1.9", and "1.8.5" with "1.9.0"** in all commands (unless
this has already been updated in the post).

- Windows: Follow [these instructions](https://julialang.org/downloads/platform/#windows) (video below)

**It is very strongly recommended that you add `julia` to your `PATH`**, as described in
the instructions, so that Julia can be launched from a terminal/console. (On a Mac,
double clicking on the Julia application icon will also do.)

<br style="width:600px; height:480px">
<img src="./Julia_Installation.gif" />
</br>

An new alternative I have not tried or tested myself is to use
[juliaup](https://github.com/JuliaLang/juliaup).

3. Open the downloaded application in the usual way for your OS, or
type `julia` and press `return` from a terminal window. This launches a command-line
interface for interacting with julia called the
3. Open a terminal window and type `julia`, and press `RETURN` or `ENTER`. This
launches a command-line interface for interacting with julia called the
[REPL](https://en.wikipedia.org/wiki/Read–eval–print_loop).

4. *Testing.* At the `julia> ` prompt, type `println("Hello
world!")` and press `enter`. The words "Hello world!" should be repeated back to you:
4. *Testing.* At the `julia> ` prompt, type `println("Hello world!")` and press `RETURN`
or `ENTER`. The words "Hello world!" should be repeated back to you:

![Julia REPL screen shot](/assets/hello_world.png)

*Known issue*: If launching Julia on a Mac by clicking on the app icon, you may encounter
"Error: Not authorised to send Apple events to Terminal." Workaround: See [this
fix](https://apple.stackexchange.com/questions/393096/error-not-authorised-to-send-apple-events-to-terminal-when-starting-maxima)
or add `julia` to your `PATH` so you can launch Julia from the terminal .
23 changes: 18 additions & 5 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The following instructions only need to be executed successfully once:

- [Install a correct version of the Julia compiler](FIRST_STEPS.md).

- **In a new Julia session** type the following at the `julia>` prompt:
- **In a new Julia session** type the following at the `julia>` prompt, inlcuding a RETURN at the end of each line (or do copy/paste + one final RETURN):

```julia
ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0
Expand All @@ -30,23 +30,28 @@ Pkg.build("Conda")
Pkg.build("IJulia")
ENV["JULIA_PKG_PRECOMPILE_AUTO"]=1

using HelloJulia
using Pkg
Pkg.test("HelloJulia")
exit()
```

**IF YOU ARE PREPARING FOR A JULIA WORKSHOP** you can stop now. You're ready for the
workshop!


## Running the demos and tutorials

!!! Note

Running notebooks for the first time may involve delays due to
precompilation of newly installed packages.

After starting a new Julia session, do this:
After starting a new Julia session, enter these commands:

```julia
julia> using Pkg; Pkg.activate(joinpath(Pkg.devdir(), "HelloJulia"))
julia> using HelloJulia
using Pkg; Pkg.activate(joinpath(Pkg.devdir(), "HelloJulia"))
using HelloJulia
```

Then:
Expand All @@ -55,14 +60,22 @@ Then:

- Enter `pluto()` at the `julia>` prompt.

To kill the notebook server when finished, navigate to the window running Julia and enter
CONTROL-C.

### Option 2: To run as Jupyter notebooks

- Enter `juptyer()` at the `julia>` prompt.
- Enter `juptyer()` at the `julia>` prompt. If asked, agree to install Jupyter using
Conda.

- In the browser window that should appear, navigate to the folder of interest

- Choose the file called `notebook.unexecuted.ipynb` (or
`notebook.ipynb` to see pre-executed version)

To kill the notebook server when finished, navigate to the window running Julia and enter
CONTROL-C.


### Option 3: To run as script in your editor

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
## &#10024; Participating in ResBaz 2024?

Start
[here](https://github.com/ablaom/HelloJulia.jl/wiki/Preparing-for-your-ResBaz-2024-Julia-workshop)
for the **Getting Started With the Julia Programming Language** workshop.
Start [here](INSTALLATION.md) for the **Getting Started With the Julia Programming
Language** workshop.

---

Expand Down

0 comments on commit 9ae0826

Please sign in to comment.