rJava package in r-devel 3.5
rJava package used /usr/local/clang4 folder to search bin/clang compiler.
However clang4 is relatively old now. We will use most recent version of clang:
brew install llvm
clang 5.0.1 (at the time of writing this note) will be install in:
/usr/local/opt/llvm/bin/clang
Then, do:
cd /usr/local
sudo ln -s /usr/local/opt/llvm clang4
However, it fails to find the libomp
Do:
sudo ln -s /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libomp.dylib libomp.dylib
Now you can do in R:
install.packages("rJava")
Still two problems to solve:
- do not setup JAVA_HOME in your .profile or it will make an error when you load the library
- If you use Rstudio, you must enter these commands due to a bug in Rstudio
cd /usr/local/lib
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/server/libjsig.dylib libjsig.dylib
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/server/libjvm.dylib libjvm.dylib
However clang4 is relatively old now. We will use most recent version of clang:
brew install llvm
clang 5.0.1 (at the time of writing this note) will be install in:
/usr/local/opt/llvm/bin/clang
Then, do:
cd /usr/local
sudo ln -s /usr/local/opt/llvm clang4
However, it fails to find the libomp
Do:
sudo ln -s /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libomp.dylib libomp.dylib
Now you can do in R:
install.packages("rJava")
Still two problems to solve:
- do not setup JAVA_HOME in your .profile or it will make an error when you load the library
- If you use Rstudio, you must enter these commands due to a bug in Rstudio
cd /usr/local/lib
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/server/libjsig.dylib libjsig.dylib
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/server/libjvm.dylib libjvm.dylib
replacing /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home with the return of
echo $(/usr/libexec/java_home)
When you update java, you must do again this step.
Commentaires
Enregistrer un commentaire