-
Notifications
You must be signed in to change notification settings - Fork 217
JuliaCustom
The following are steps how to setup a custom installation of Julia on Cocalc
-
Get a 64 bit linux tarball: https://julialang.org/downloads/ From a Terminal file in your project:
$ cd ~ $ wget "https://julialang-s3.julialang.org/bin/linux/x64/0.5/julia-0.5.2-linux-x86_64.tar.gz"
adjusting the link if necessary.
-
Extract it, and symlink from your
~/bin/julia
to it'sbin/julia
:$ tar -xzvf julia-0.5.2-linux-x86_64.tar.gz $ cd; mkdir bin; cd bin $ ln -s ~/<extracted-tarball-dir>/bin/julia julia
-
Make sure
~/bin
is in yourPATH
, e.g. by appendingexport PATH=$HOME/bin:$HOME/.local/bin:$PATH
to your~/.bashrc
file.$ echo export PATH=$HOME/bin:$HOME/.local/bin:$PATH >> ~/.bashrc
-
Tell Julia to use a package directory inside your project, add this line to your
~/.bashrc
:export JULIA_PKGDIR=$HOME/.julia
$ echo export JULIA_PKGDIR=$HOME/.julia >> ~/.bashrc
-
Restart the terminal and test you got the correct julia:
~$ which julia /projects/<your-project-uuid>/bin/julia ~$ julia --version julia version 0.5.2 ~$ echo $JULIA_PKGDIR /projects/<your-project-uuid>/.julia
-
For running Julia in the Jupyter Notebook, you also need to install IJulia and your own jupyter kernel:
$ julia > Pkg.init() > Pkg.add("IJulia")
-
This should automatically add a kernel file at
~/.local/share/jupyter/kernels/julia-XXX/kernel.json
containing information like this. You have to add the JULIA_PKGDIR env variable:
{
"display_name": "Julia (XXX)",
"argv": [
"/projects/<YOUR-PROJECT-UUID>/bin/julia",
"-i",
"--startup-file=yes",
"--color=yes",
"/projects/<YOUR-PROJECT-UUID>/.julia/v0.5/IJulia/src/kernel.jl",
"{connection_file}"
],
"language": "julia",
"env": {
"JULIA_PKGDIR": "/projects/<YOUR-PROJECT-UUID>/.julia"
}
}
(and don't forget the comma after "language": "julia"
)
Hence, after maybe refreshing the kernel list, an entry "Julia (XXX)" should show up.
This Wiki is for CoCalc.com.
A more structured documentation is the CoCalc User Manual.
For further questions, please contact us.