Hey all, recently posted about using juliaup in NixOS. Now I’m investigating it in GUIX which is a similar OS but using guile scheme as the configuration language.
In GUIX you can run foreign compiled binaries in a container that has a “normal” FHS filesystem hierarchy using guix shell --container --emulate-fhs
here’s what’s working for me:
- log into your machine, and at a minimum
guix install curl
and add ~/bin to PATH - install juliaup using the commands on julialang.org
- create bin/juliacontainer in your home directory containing something similar to:
#!/usr/bin/env bash
guix shell --container --emulate-fhs --preserve="(TERM)|(LANG)" --network --expose=/etc/bashrc=/etc/bashrc\
--expose=/run/current-system/locale=/run/current-system/locale\
--share=/home/dlakelan/.bash_profile=/home/dlakelan/.bash_profile\
--share=/home/dlakelan/.bashrc=/home/dlakelan/.bashrc\
--share=/home/dlakelan/.julia=/home/dlakelan/.julia\
--share=/home/dlakelan/juliaprojects=/home/dlakelan/juliaprojects -m .config/guix/juliamanifest.scm
- write a manifest in .config/guix/juliamanifest.scm like this. This was the minimum to get comfortably into julia and debug stuff, feel free to add packages you want.
(specifications->manifest
(list "emacs-no-x" "curl" "wget" "git" "coreutils" "less" "bash"))
- at your command line type
juliacontainer
- in the new shell type
bash
because I’m not sure why but it doesn’t read .bashrc etc - profit!
works for me!
Method 2
Ok, so there’s an easier way… we just need to patch the ELF file to point to the proper library:
patchelf --set-interpreter "$(patchelf --print-interpreter $(which sh))" .julia/juliaup/julia-1.11.5+0.x64.linux.gnu/bin/julia
and then you can run julia not in a special container… seems to work. but you’ll need to patch it every time you install a new version. Also, you might want to create a separate patched version and a bin/julia
script that calls that patched version