Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Support for downloading Julia instead of building from source.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbehrends committed Sep 4, 2020
1 parent d88b218 commit 4fee37a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get(Map args) {
} else if (args.scm == "git" || args.scm == null) {
rev = args.branch ?: "master"
if (rev.startsWith("tag:"))
rev = "refs/tags/" + rev[4..-1]
rev = "refs/tags/" + rev["tag:".length()..-1]
checkout([$class: "GitSCM",
userRemoteConfigs: [[url: url]],
branches: [[name: rev]],
Expand Down Expand Up @@ -90,8 +90,13 @@ node(label: nodeLabel) {
sh "meta/prepare.rb"
// Update repositories
if (rebuild != "none") {
get url: "https://github.com/julialang/julia",
branch: julia_version
if (julia_version.startsWith("download:")) {
raw_julia_version = julia_version["download:".length()..-1]
sh "meta/download-julia.rb $raw_julia_version"
} else {
get url: "https://github.com/julialang/julia",
branch: julia_version
}
get url: "https://github.com/gap-system/gap",
branch: gap_version
get url: "https://github.com/Singular/Singular",
Expand Down
18 changes: 18 additions & 0 deletions download-julia.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env ruby
require_relative "settings.rb"
require_relative "utils.rb"

version = ARGV.first
major_version = version.split(".")[0..1].join(".")
url = "https://julialang-s3.julialang.org/bin/linux/x64/#{major_version}/julia-#{version}-linux-x86_64.tar.gz"


Dir.chdir($WORKSPACE) do
system! "wget", "-q", "-t", "5", "-N", "--no-if-modified-since", url
FileUtils.rm_tree "julia"
FileUtils.mkdir_p "julia"
julia_tar_gz = File.basename(url)
Dir.chdir("julia") do
system! "tar", "xzf", "../#{julia_tar_gz}", "--strip-components=1"
end
end
6 changes: 4 additions & 2 deletions install/install-julia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
require_relative "../settings.rb"
require "fileutils"

system! "make -C julia -j#{ENV['BUILDJOBS'] || 4}"
FileUtils.ln_sf "#{$WORKSPACE}/julia/julia", "local/bin" or exit 1
if not (ENV["JULIA_VERSION"] || "").start_with?("download:") then
system! "make -C julia -j#{ENV['BUILDJOBS'] || 4}"
end
FileUtils.ln_sf "#{$WORKSPACE}/julia/bin/julia", "local/bin" or exit 1

0 comments on commit 4fee37a

Please sign in to comment.