Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create install_julia.sh #157

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions scripts/install_julia.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
set -e

# Latest Julia version (this needs to be manually updated, periodically)
JULIA_LATEST=1.6-latest

JULIA_VERSION=${1:-${JULIA_VERSION:-latest}}

if [ "$JULIA_VERSION" = "latest" ]; then
JULIA_VERSION=$JULIA_LATEST
fi
JULIA_MAJOR_VERSION=${JULIA_VERSION:0:3}

# Download and extract Julia. We'll use a common /opt/julia/ location regardless of version
wget https://julialang-s3.julialang.org/bin/linux/x64/$JULIA_MAJOR_VERSION/julia-$JULIA_VERSION-linux-x86_64.tar.gz -O /opt/julia.tar.gz
mkdir /opt/julia
tar zxvf /opt/julia.tar.gz -C /opt/julia --strip-components 1
rm -rf /opt/julia.tar.gz

# Add to path
echo 'export PATH="/opt/julia/bin:$PATH"' >> .bashrc
source .bashrc
Comment on lines +21 to +22
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking other scripts, I think there is room for modification in the way the PATH is set.

# pipenv requires ~/.local/bin to be on the path...
echo "PATH=/opt/pyenv/bin:~/.local/bin:$PATH" >> ${R_HOME}/etc/Renviron
echo "PATH=/opt/pyenv/bin:~/.local/bin:$PATH" >> /etc/bash.bashrc

How to set environment variables is currently being discussed in #151 (comment), but the above description seems to be the standard at this time.

I am not an expert in these scripts or PATH settings, so if this comment is incorrect, please feel free to ignore it.


# Add RCall package for interoperability from Julia
julia -e 'using Pkg; Pkg.add("RCall")'

# Add R packages for interoperability the other way around
#Rscript -e 'install.packages(c("JuliaCall", "JuliaConnectoR")); JuliaCall::julia_setup()'
install2.r --error --skipinstalled JuliaCall JuliaConnectoR
Rscript -e 'JuliaCall::julia_setup()'

# Make sure we start in bash
CMD ["bash"]