Skip to content

Commit

Permalink
update README for begginers
Browse files Browse the repository at this point in the history
  • Loading branch information
terasakisatoshi committed Oct 22, 2021
1 parent 589a409 commit d3902ab
Showing 1 changed file with 84 additions and 7 deletions.
91 changes: 84 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,95 @@
- This repository aims to provide scripts that create sysimage via PackageCompiler.jl .
- It will reduce latency when working locally with packages that has a high startup time e.g. Plots.jl or StatsPlots.jl .

# Usage
# Usage: For 今北産業(TL;DR) users

## Setup
```console
$ git clone https://github.com/terasakisatoshi/sysimage_creator.git
$ pip install jupyter jupytext nbconvert ipykernel
$ cd sysimage_creator && make && jupyter notebook
```

Then open your jupyter notebook and select a kernel named `Julia-sys 1.6.3`

# Usage: For reasonable people

## Step 1: Install dependencies

- Almost people can skip this step because your are trying to improve your Jupyter IJulia.jl, to You know what to do.
- Install [Julia](https://julialang.org/downloads/) and Python
- Let's install `jupyter` (or `jupyterlab` instead) and `jupytext` via:
```console
$ pip install jupyter jupytext
$ pip install nbconvert ipykernel # for Windows users
$ julia setup.jl
$ pip install nbconvert ipykernel # I'm not sure, but you may need on Windows.
```

- After that, let's moving on to Step2!!!

### Step1-1: Help! I'm new to any kind of programming language.

- All right. Welcome to Julia! First of all please [install Julia from here](https://julialang.org/downloads/). Please see platform specific instructions for further installation instructions and if you have trouble installing Julia. You'll learn how to add a path of a program for Julia. Open your terminal and type `julia` command.

```console
$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.3 (2021-09-23)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> # congrats!
julia> exit() # exit from julia REPL
$ julia # you can start again.
```

- Moving on to the next step. Let's install PyCall and IJulia and then your environment can initialize jupyter notebook

```conosle
julia> ENV["PYTHON"]=""; ENV["JUPYTER"]=""
julia> using Pkg; Pkg.add(["PyCall", "IJulia", "Conda"])
julia> using Conda; Conda.add(["jupyter", "jupytext"], channel="conda-forge")
```

- Tips: you don't have to copy code above line by line. Copy the whole 3 lines. Don't hesitate to include prompt `julia>`. Then just do paste to your julia REPL.
- Tips: Setting `ENV["PYTHON"]=""; ENV["JUPYTER"]=""` makes julia select Python provided via [Conad.jl](https://github.com/JuliaPy/Conda.jl). Conda.jl uses the miniconda Python environment, which only includes conda and its dependencies. If you have LITTLE experience with Python, just follow the instructions above is fine.
- Tips: Ah, you've remembered you can use Python and Jupyter from your terminal e.g.

```console
$ python
>>>
```

```console
$ pip install numpy
```
or whatever

```console
$ jupyter notebook
```

If so, you may consider do the following command:

```julia
julia> run(`pip install jupyter jupytext nbconvert ipykernel`)
julia> ENV["PYTHON"]=Sys.which("python3"); ENV["JUPYTER"]=Sys.which("jupyter")
julia> using Pkg; Pkg.build(["PyCall", "IJulia"])
```

What does it do? Well, read the code: [deps/build.jl](https://github.com/JuliaLang/IJulia.jl/blob/master/deps/build.jl).

Anyway, after finished the installation, let's initialize Juptyer notebook:

```julia
julia> using IJulia; notebook(dir=pwd())
```

## Create sysimage
## Step 2: Create sysimage

- Ah... also make sure you can use `$ make` command on your terminal.
- Just run `make`. It will make sysimage named `sys.{DLEXT}`, where `DLEXT` is `dylib, dll or so`.

```
Expand Down Expand Up @@ -53,7 +130,7 @@ or just run `make test` :D.
$ jupyter notebook
```

- Then you'll see New kernel for Julia named `Julia-sys 1.6.0`.
- Then you'll see New kernel for Julia named `Julia-sys 1.6.3`.

![](assets/jupyter_kernel_list.png)

Expand All @@ -62,7 +139,7 @@ $ jupyter notebook
```console
$ cat ~/Library/Jupyter/kernels/julia-sys-1.6/kernel.json
{
"display_name": "Julia-sys 1.6.0",
"display_name": "Julia-sys 1.6.3",
"argv": [
"/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia",
"-i",
Expand Down

0 comments on commit d3902ab

Please sign in to comment.