sawpawan / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

javacv build to produce a single artifact file with the native libs included #268

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install OpenCV via *any method*
2. Include appropriate javacv jars in a project

What is the expected output? What do you see instead?
I can't get any javacv code to run. All I get is 
java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path. I've 
tried installing OpenCV via:
- MacPorts
- Manual compile via Unix makefiles, cmake
- Manual compile via Xcode, cmake

Additionally, I've tried using JavaCV via:
- Maven
- Cloning git source and compiling, (using this method it works fine using 
Macports, but I can't seem to figure out how to link to an arbitrary OpenCV 
instance).

What version of the product are you using? On what operating system?
0.3, latest
Mac OSX 10.7.5

Please provide any additional information below.
I put some displays into javacpp to attempt to debug the loading process, and 
this is what is displayed:
searching resource: macosx-x86_64/libopencv_core.dylib.2.4
searching resource: macosx-x86_64/libopencv_core.2.4.dylib
searching resource: macosx-x86_64/libopencv_core.dylib
found resource: null
searching file: /usr/local/lib/libopencv_core.dylib.2.4
searching file: /usr/local/lib/libopencv_core.2.4.dylib
searching file: /usr/local/lib/libopencv_core.dylib
searching file: /usr/local/lib64/libopencv_core.dylib.2.4
searching file: /usr/local/lib64/libopencv_core.2.4.dylib
searching file: /usr/local/lib64/libopencv_core.dylib
searching file: /opt/local/lib/libopencv_core.dylib.2.4
searching file: /opt/local/lib/libopencv_core.2.4.dylib
searching file: /opt/local/lib/libopencv_core.dylib
searching file: /opt/local/lib64/libopencv_core.dylib.2.4
searching file: /opt/local/lib64/libopencv_core.2.4.dylib
searching file: /opt/local/lib64/libopencv_core.dylib
last resort, attempting system load
searching resource: macosx-x86_64/libjniopencv_core.dylib
searching resource: macosx-x86_64/libjniopencv_core.dylib
searching resource: macosx-x86_64/libjniopencv_core.dylib
found resource: null
last resort, attempting system load
java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1045)
        at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:463)
        at com.googlecode.javacpp.Loader.load(Loader.java:377)
        at com.googlecode.javacpp.Loader.load(Loader.java:323)
        at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at com.googlecode.javacpp.Loader.load(Loader.java:342)
        at com.googlecode.javacpp.Loader.load(Loader.java:323)
        at com.googlecode.javacv.cpp.opencv_core$CvArr.<clinit>(opencv_core.java:163)
        at com.stainlesscode.adtools.detectors.OpenCvTestDetector.setCurrentFrame(OpenCvTestDetector.java:37)
        at com.stainlesscode.adtools.MultiVideoOutput.setCurrentFrame(MultiVideoOutput.java:53)
        at com.stainlesscode.mediapipeline.videoout.DefaultVideoPlayer.showNextFrame(DefaultVideoPlayer.java:225)
        at com.stainlesscode.mediapipeline.videoout.DefaultVideoPlayer.run(DefaultVideoPlayer.java:127)
        at java.lang.Thread.run(Thread.java:680)

Original issue reported on code.google.com by dstiegl...@stainlesscode.com on 2 Jan 2013 at 1:00

GoogleCodeExporter commented 8 years ago
This seems to have been an issue with our ivy build system integrating with 
maven output of javacv. Apparently having two files, one called javacv-0.3.jar 
and once called javacv-0.3-macosx-x86_64.jar was causing problems and native 
libraries were not being downloaded properly.

Is there any way to instruct the javacv build to produce a single artifact file 
with the native libs included?

Original comment by dstiegl...@stainlesscode.com on 3 Jan 2013 at 12:57

GoogleCodeExporter commented 8 years ago
No, because I do not know how something like that should work across 
platforms... Do you know of some feature in Maven that I don't know about that 
could help with that?

Original comment by samuel.a...@gmail.com on 3 Jan 2013 at 10:15

GoogleCodeExporter commented 8 years ago
BTW, has this issue been fixed with recent versions of Ivy?

If not, we should be reporting that upstream. 

Because this naming scheme is pretty standard with Maven.

Thanks for looking into that!

Original comment by samuel.a...@gmail.com on 29 Apr 2014 at 12:49