Skip to content

Commit

Permalink
Use compareVersion, which resolves potential future bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Non-Contradiction committed Aug 31, 2017
1 parent 771b0a4 commit 14234f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ URL: https://github.com/Non-Contradiction/JuliaCall
BugReports: https://github.com/Non-Contradiction/JuliaCall/issues
Encoding: UTF-8
LazyData: true
Imports: inline
Imports: inline,
utils
RoxygenNote: 6.0.1
SystemRequirements: Julia >= 0.5.0, RCall.jl
Suggests: testthat
2 changes: 2 additions & 0 deletions R/aaa.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ julia_check <- function(){
warning = function(war){},
error = function(err) FALSE)
}

newer <- function(x, y) utils::compareVersion(x, y) >= 0
4 changes: 2 additions & 2 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ julia_setup <- function(verbose = TRUE, force = FALSE) {

if (verbose) message(paste0("Julia version ", .julia$VERSION, " found."))

if (.julia$VERSION < "0.6.0") {
if (!newer(.julia$VERSION, "0.6.0")) {
.julia$init_ <- .julia$compile(
sig = c(dir = "character"),
body = "jl_init(CHAR(STRING_ELT(dir, 0))); return R_NilValue;"
)

.julia$init <- function() .julia$init_(.julia$bin_dir)
}
if (.julia$VERSION >= "0.6.0") {
if (newer(.julia$VERSION, "0.6.0")) {
.julia$init <- .julia$compile(
sig = c(),
body = "jl_init(); return R_NilValue;"
Expand Down

0 comments on commit 14234f4

Please sign in to comment.