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

julia_setup() cannot find Julia #91

Closed
aguang opened this issue Mar 5, 2019 · 5 comments
Closed

julia_setup() cannot find Julia #91

aguang opened this issue Mar 5, 2019 · 5 comments

Comments

@aguang
Copy link

aguang commented Mar 5, 2019

This may be related to the many other issues that appear to be open with julia_setup(). When I run it with no arguments as described in Basic Usage I get that Julia is not found. It is fine when I supply my own path, but this suggests that julia_setup() has issues actually finding my Julia installation.

> julia <- julia_setup()
sh: NA: command not found
Error in julia_setup() : Julia is not found.
In addition: Warning message:
In system2("bash", "-l -c 'which julia'", stdout = TRUE) :
  running command ''bash' -l -c 'which julia'' had status 1

> julia <- julia_setup(JULIA_HOME= "/Applications/Julia-1.1.app/Contents/Resources/julia/bin/")
Julia version 1.1.0 at location /Applications/Julia-1.1.app/Contents/Resources/julia/bin will be used.
Loading setup script for JuliaCall...
Finish loading setup script for JuliaCall.
Session Info

sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14.3

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] JuliaCall_0.16.4

loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1 yaml_2.2.0 Rcpp_1.0.0 knitr_1.21 xfun_0.5

@aguang aguang changed the title julia_setup() cannot find Juilia julia_setup() cannot find Julia Mar 5, 2019
@Non-Contradiction
Copy link
Owner

Thanks for the feedback!

It seems that there is no Julia installation on PATH, and the Julia installation can't be invoked by just julia in the terminal, which is why there is the warning message running command ''bash' -l -c 'which julia'' had status 1.
This is the current design of julia_setup, which either looks for Julia at the location provided by the user or looks for Julia in the PATH, which is a reasonable solution plausible on all os systems (but not ideal). Also, it is documented in README and the R package documentation.

An ideal solution is to try to find Julia harder in a system specific way if the current mechanism fails. For example, JuliaCall may look at /Applications/ folder on mac for Julia, and it can invoke that Julia if there is only one Julia at paths like /Applications/Julia-x.x.app (since it is possible to have multiple versions of Julia at the same time).

I will try to implement the ideal solution step by step when I have time. Thank you for the suggestion!

@aguang
Copy link
Author

aguang commented Mar 6, 2019

That sounds fine to me. I would also suggest either

  1. documenting that julia_setup() will look within PATH earlier in the Basic Usage section, so that if it can't find it it means that Julia is not within your PATH (for example, I use the alias solution to run from terminal with OSX), or
  2. referencing the Troubleshooting section in Basic Usage for any errors with julia_setup().

I understand that this seems to be a OSX specific issue, since all other OSes will allow you to run from command line immediately.

@aguang
Copy link
Author

aguang commented Mar 6, 2019

Linking to openjournals/joss-reviews#1284

@Non-Contradiction
Copy link
Owner

I will add the reference to the Troubleshooting section in the Basic Usage section. Thanks for the suggestion. BTW, JuliaCall should support the alias solution. This sounds like a bug to me. I will investigate more on the issue.

Non-Contradiction added a commit that referenced this issue Mar 7, 2019
…for julia_setup problems, related to #91. [skip ci]
@aguang
Copy link
Author

aguang commented Mar 8, 2019

Looks good to me. No pressure on the alias issue, it is also trivial to make a symbolic link in /usr/local/bin or add Julia to my PATH.

@aguang aguang closed this as completed Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants