Note: Providing complete information in the most concise form is the best way 
to get help. This issue template serves as the checklist for essential 
information to most of the technical issues and bug reports. For non-technical 
issues and feature requests, feel free to present the information in what you 
believe is the best form.

For Q & A and discussion, please start a discussion thread at 
https://discuss.mxnet.io 

## Description

The mxnet scala in intellij instructions at 
http://mxnet.incubator.apache.org/tutorials/scala/mxnet_scala_on_intellij.html 
do not work because of an opencv library path error.

```
Package used (Python/R/Scala/Julia):
mxnet-scala

For Scala user, please provide:
1. Java version: 1.8.0_171
2. Maven version:  3.3.9 
3. Scala runtime if applicable: 2.11.8

For R user, please provide R `sessionInfo()`:
```

## Error Message:
```
Exception in thread "main" java.lang.UnsatisfiedLinkError: 
/private/var/folders/nz/57cdgtr11pdg01rgzyzhjxvmqwmxjn/T/mxnet4117240061172168094/mxnet-scala:
 
dlopen(/private/var/folders/nz/57cdgtr11pdg01rgzyzhjxvmqwmxjn/T/mxnet4117240061172168094/mxnet-scala,
 1): Library not loaded: /usr/local/opt/opencv/lib/libopencv_stitching.3.4.dylib
  Referenced from: 
/private/var/folders/nz/57cdgtr11pdg01rgzyzhjxvmqwmxjn/T/mxnet4117240061172168094/mxnet-scala
  Reason: image not found
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at 
org.apache.mxnet.util.NativeLibraryLoader$.loadLibraryFromStream(NativeLibraryLoader.scala:140)
    at 
org.apache.mxnet.util.NativeLibraryLoader$.loadLibrary(NativeLibraryLoader.scala:93)
    at org.apache.mxnet.Base$.<init>(Base.scala:70)
    at org.apache.mxnet.Base$.<clinit>(Base.scala)
    at org.apache.mxnet.NDArray$.initNDArrayModule(NDArray.scala:151)
    at org.apache.mxnet.NDArray$.<init>(NDArray.scala:38)
    at org.apache.mxnet.NDArray$.<clinit>(NDArray.scala)
    at mxnet.App$.delayedEndpoint$mxnet$App$1(App.scala:9)
    at mxnet.App$delayedInit$body.apply(App.scala:6)
    at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at scala.App$$anonfun$main$1.apply(App.scala:76)
    at scala.App$$anonfun$main$1.apply(App.scala:76)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at 
scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
    at scala.App$class.main(App.scala:76)
    at mxnet.App$.main(App.scala:6)
    at mxnet.App.main(App.scala)
```

## Steps to reproduce

1. Follow tutorial to "Step 7. Run Sample MXNet Code in the App" and run the app
2. App fails with stack trace shown above.

## What have you tried to solve it?

1. Replacing the `brew install opencv@2` command in the mac prequisite setup 
section with `brew install opencv` fixes the problem and lets the example app 
run successfully. So either the example doc needs to be revised to use the 
other opencv version, or mxnet scala needs to look for different lib path.


[ Full content available at: 
https://github.com/apache/incubator-mxnet/issues/12416 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to