Skip to content

Commit

Permalink
Do not let print in startup files to mess up with JuliaCall setup. Re…
Browse files Browse the repository at this point in the history
…lated to #105.
  • Loading branch information
Non-Contradiction committed May 28, 2019
1 parent 6a54852 commit 6907a8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/aaa.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ julia_locate <- function(JULIA_HOME = NULL){
julia_bin <- "julia"
}
}
tryCatch(system2(julia_bin, "-E \"try println(JULIA_HOME) catch e println(Sys.BINDIR) end;\"", stdout = TRUE)[1],
tryCatch(system2(julia_bin, "--startup-file=no -E \"try println(JULIA_HOME) catch e println(Sys.BINDIR) end;\"", stdout = TRUE)[1],
warning = function(war) {},
error = function(err) NULL)
}
else {
tryCatch(system2(file.path(JULIA_HOME, "julia"),
"-E \"try println(JULIA_HOME) catch e println(Sys.BINDIR) end;\"", stdout = TRUE)[1],
"--startup-file=no -E \"try println(JULIA_HOME) catch e println(Sys.BINDIR) end;\"", stdout = TRUE)[1],
warning = function(war) {},
error = function(err) NULL)
}
Expand All @@ -46,6 +46,7 @@ julia_locate <- function(JULIA_HOME = NULL){
## We need to call julia from the command line to precompile packages.
## It is currently used in julia_setup in zzz.R and julia_library in package.R
julia_line <- function(command, ...){
command <- c("--startup-file=no", command)
system2(file.path(.julia$bin_dir, "julia"), shQuote(command), ...)
}

Expand Down

0 comments on commit 6907a8d

Please sign in to comment.