Can't install mxnet on Mac


#1

Hi,
I’m using Mac and RStudio and I’m absolute beginner in this field.
How should I install mxnet package in RStudio, because I’he tried many commands
like this:

ran <- getOption(“repos”)
cran[“dmlc”] <- “https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/
options(repos = cran)
install.packages(“mxnet”)

or this

cran <- getOption(“repos”)
cran[“dmlc”] <- “https://s3-us-west-2.amazonaws.com/apache-mxnet/R/CRAN/
options(repos = cran)
install.packages(“mxnet”,dependencies = T)

and some others

I see the name of the package among others in downloaded packages (as I understand),
BUT when I try to command
library(mxnet) or require(mxnet) I get the following error

Ошибка: .onLoad не удалось в loadNamespace() для ‘mxnet’, подробности:
вызов: dyn.load(file, DLLpath = DLLpath, …)
ошибка: не могу загрузить разделяемый объект ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so’:
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so, 10): Library not loaded: /usr/local/opt/openblas/lib/libopenblasp-r0.3.1.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so
Reason: image not found

What to deal with this???
I don’t know R much and don’t understand what to do?

Could anyone explain step by step what should I do???, commands I should use and other
stuff.
I read topics and forums on this issue (something about CPU, GPU), but I really don’t understand.


#2

Hi,

The easiest way to install R on mac is by using a prebuilt binary by following this instructions

Alternatively, here are the instructions to build the mxnet shared library and the R language bindings from source

First you have to install the mxnet engine from source with the following instructions - http://mxnet.incubator.apache.org/install/build_from_source.html

After which you can then install the R language bindings by following the instructions specifically for R.


#3

Thank you!
I’s sorry for such questions but I really don’t understand

Could you explain how should I add a soft link to the OpenBLAS installation???

Should I just copy the following line:

ln -sf /usr/local/opt/openblas/lib/libopenblasp-r0.3.* /usr/local/opt/openblas/lib/libopenblasp-r0.3.1.dylib

past it in the terminal and press Enter???


#4

You can and should be able to just copy paste the line and press enter


#5

Thank you!

I tried to do such things:

copy paste the line:
ln -sf /usr/local/opt/openblas/lib/libopenblasp-r0.3.5 /usr/local/opt/openblas/lib/libopenblasp-r0.3.5.dylib
(I replaced * and 1 with 5 as the latest version of openblas is 0.3.5)

then I installed latest R ( R 3.5.2) according to the link in the instructions and

run the command:

cran <- getOption(“repos”)
cran[“dmlc”] <- “https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/
options(repos = cran)
install.packages(“mxnet”)

I got this massage:

trying URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/bin/macosx/el-capitan/contrib/3.5/mxnet_1.3.0.tgz
Content type ‘application/x-tar’ length 10369234 bytes (9.9 MB)
==================================================
downloaded 9.9 MB

tar: Failed to set default locale

and when I run:
library(mxnet) I get the following error:

Error: package or namespace load failed for ‘mxnet’:
.onLoad failed in loadNamespace() for ‘mxnet’, details:
call: dyn.load(file, DLLpath = DLLpath, …)
error: unable to load shared object ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so’:
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so, 10): Library not loaded: /usr/local/opt/openblas/lib/libopenblasp-r0.3.1.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so
Reason: image not found