baalexig / javacv

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

No binaries for Linux on ARM (Gumstix, PandaBoard, Trim-Slice, Raspberry Pi, etc.) #184

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compiling and installing OpenCV on a Gumstix board with Linux.
2. Creating a javacv project on Windows Eclipse and exporting a .jar file.
3. Running the program with "java -jar test.jar" 

What is the expected output? What do you see instead?
I get the error:
"no jniopencv_core in java.library.path"

What version of the product are you using? On what operating system?

Please provide any additional information below.
The lib directory with the OpenCV .so files is in my PATH. javacv.jar, 
javacpp.jar, and javacv-linux-x86.jar are all in my project directory and added 
to the build path using Eclipse. 

Original issue reported on code.google.com by richdin...@gmail.com on 11 Apr 2012 at 8:13

GoogleCodeExporter commented 9 years ago
I don't think the Gumstix uses an x86 CPU... ? In addition to OpenCV, could you 
try to recompile JavaCV using the Gumstix's SDK as well and try again? Thank you

Original comment by samuel.a...@gmail.com on 15 Apr 2012 at 2:02

GoogleCodeExporter commented 9 years ago
So, did you get it working? I guess I will be marking this as a RFE... If you 
or anybody else could contribute any builds, they would be most welcome! Simply 
attach them here, thank you

Original comment by samuel.a...@gmail.com on 12 May 2012 at 11:59

GoogleCodeExporter commented 9 years ago
Jeremy, I am putting you in charge of this and will let you know when I'm ready 
to make a new release, but please let me know if you foresee any problems, 
thanks!

Others, current build available from Jeremy here: 
http://jeremy-nicola.info/files/RaspberryPi/

Original comment by samuel.a...@gmail.com on 8 Jul 2012 at 2:44

GoogleCodeExporter commented 9 years ago
JavaCV 0.2 now comes with a javacv-linux-arm.jar build provided by Jeremy. 
Enjoy!

Original comment by samuel.a...@gmail.com on 22 Jul 2012 at 5:35

GoogleCodeExporter commented 9 years ago
Can you please upload javaCV 0.3 version for linux-arm?

Original comment by shivaram...@gmail.com on 31 Dec 2012 at 7:48

GoogleCodeExporter commented 9 years ago
Issue 279 has been merged into this issue.

Original comment by samuel.a...@gmail.com on 13 Feb 2013 at 1:03

GoogleCodeExporter commented 9 years ago
Reopening due lack of build for JavaCV 0.3...

Original comment by samuel.a...@gmail.com on 13 Feb 2013 at 1:04

GoogleCodeExporter commented 9 years ago
JavaCV 0.3 for ARM-Linux can be found on this link: " 
http://hackberrya10.blogspot.in/2013/02/javacv-in-hackberry-a10-after.html "

Original comment by manojman...@gmail.com on 13 Feb 2013 at 11:48

GoogleCodeExporter commented 9 years ago
@Manoj Thanks!! If you could also compile it for FFmpeg, etc. I'd make 
available the binaries on this site for everyone to use. Let me know if you're 
like to do that, thanks!

Original comment by samuel.a...@gmail.com on 17 Feb 2013 at 12:47

GoogleCodeExporter commented 9 years ago
Ok,, I'll give it a try for FFmpeg, and reply to you with the results.

Original comment by manojman...@gmail.com on 18 Feb 2013 at 2:12

GoogleCodeExporter commented 9 years ago
So are there any plans to provide a linux-arm version of javacv? why is this 
not provided with javacv 0.5?

Original comment by sala...@gmail.com on 8 Jun 2013 at 5:21

GoogleCodeExporter commented 9 years ago
Because Jeremy is busy with other things...

Original comment by samuel.a...@gmail.com on 9 Jun 2013 at 1:05

GoogleCodeExporter commented 9 years ago
Hi Samuel,
We manage to get the linux-arm jar compiled but it's not working. 
For some reason we get an exception in the execution related with TBB. We have 
tried compiling opencv 2.4.5 with and without the TBB feature, but that wasn't 
helping. Does this ring some bell on your side? 
I'm looking forward to send the jar as soon as we get it working. 

Cheers

Original comment by sala...@gmail.com on 10 Jun 2013 at 7:48

GoogleCodeExporter commented 9 years ago
What is the error message?

Original comment by samuel.a...@gmail.com on 10 Jun 2013 at 8:05

GoogleCodeExporter commented 9 years ago
UnsatisfiedLinkError: no tbb library in java.library.path

I will get the stack trace and paste it here in 10 mins 

Original comment by sala...@gmail.com on 10 Jun 2013 at 8:07

GoogleCodeExporter commented 9 years ago
UnsatisfiedLinkError: no tbb library in java.library.path

I will get the stack trace and paste it here in 10 mins

Original comment by sala...@gmail.com on 10 Jun 2013 at 8:07

GoogleCodeExporter commented 9 years ago
This is the stack trace, any ideas?

Exception in thread "main" java.lang.UnsatisfiedLinkError: 
/tmp/javacpp2077159407095/libjniopencv_core.so: libjvm.so.0: cannot open shared 
object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1646)
    at java.lang.Runtime.load0(Runtime.java:787)
    at java.lang.System.load(System.java:1022)
    at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:566)
    at com.googlecode.javacpp.Loader.load(Loader.java:489)
    at com.googlecode.javacpp.Loader.load(Loader.java:431)
    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:264)
    at com.googlecode.javacpp.Loader.load(Loader.java:453)
    at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at com.googlecode.javacpp.Loader.load(Loader.java:453)
    at com.googlecode.javacv.cpp.opencv_objdetect.<clinit>(opencv_objdetect.java:97)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at com.googlecode.javacpp.Loader.load(Loader.java:453)
    at com.googlecode.javacpp.Loader.load(Loader.java:431)
    at com.googlecode.javacv.cpp.opencv_objdetect$CvHaarClassifierCascade.<clinit>(opencv_objdetect.java:176)
    at com.salaboy.camera.opencv.test.App.init(App.java:73)
    at com.salaboy.camera.opencv.test.App.<init>(App.java:38)
    at com.salaboy.camera.opencv.test.App.main(App.java:33)
Caused by: java.lang.UnsatisfiedLinkError: no tbb in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
    at java.lang.Runtime.loadLibrary0(Runtime.java:840)
    at java.lang.System.loadLibrary(System.java:1047)
    at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
    at com.googlecode.javacpp.Loader.load(Loader.java:481)

Original comment by sala...@gmail.com on 10 Jun 2013 at 8:38

GoogleCodeExporter commented 9 years ago
We are out of ideas here

Original comment by sala...@gmail.com on 10 Jun 2013 at 8:38

GoogleCodeExporter commented 9 years ago
Looking at the javacpp/src/main/java/com/googlecode/javacpp/Loader.java  class 
I've noticed that there could be a problem identifying the platform (linux-arm) 
there and for that reason the Loader tries to get the TBB libs in the mix. Any 
ideas where this could be invoked? Do you remember if inside JavaCV or JavaCPP 
the TBB classes are required to be loaded?

Original comment by sala...@gmail.com on 10 Jun 2013 at 8:53

GoogleCodeExporter commented 9 years ago
Is this really necessary? 

src/main/java/com/googlecode/javacv/cpp/opencv_core.java:127:        

include={"<opencv2/core/core.hpp>", "opencv_adapters.h"}, 
link="opencv_core@.2.4", preload="tbb"),

Original comment by sala...@gmail.com on 10 Jun 2013 at 1:28

GoogleCodeExporter commented 9 years ago
Hi everyone,
We get it working here after two modifications:
1) we removed the preload="tbb" sentence in the opencv_core.java:127 file
2) we manually create a soft link from libjvm.so to libjvm.so.0

Now the problem is to locate the raspberry camera device with the 
OpenCVFrameGrabber, that it doesn't seem to work using the following 
constructor OpenCVFrameGrabber(""). 
Any ideas on how to list all the available camera devices?

Cheers

Original comment by sala...@gmail.com on 11 Jun 2013 at 11:21

GoogleCodeExporter commented 9 years ago
The `libjvm` issue is related to this bug report, which I'll be working on 
shortly:
http://code.google.com/p/javacpp/issues/detail?id=33

Removing `preload="tbb"` shouldn't change anything. What error message do you 
get if you do not remove it?

IIRC what Jeremy said, I don't think Linux supports the camera device on the 
Raspberry Pi. He might have more info about that at this point, so please ask 
him about that, thanks.

Original comment by samuel.a...@gmail.com on 11 Jun 2013 at 1:25

GoogleCodeExporter commented 9 years ago
Hi folks,
I'm sorry that I can't provide the arm build atm.

For your information, direct access of the CSI camera module of the Raspberry 
Pi is not possible at the moment, as there is no V4L driver.
The Raspberry Pi foundation said they are working on it though.

The best workaround for the moment is to call their "raspistill" command from 
your programm and read the resulting .jpg image from OpenCV...

Original comment by jeremy.n...@gmail.com on 11 Jun 2013 at 3:51

GoogleCodeExporter commented 9 years ago
Hi Jeremy, 
We manage to get the build working and we can provide the linux-arm.jar to 
anyone interested in it.. it should be provided with the release file. 
We were looking at it and we reach at the same conclusion, it's not possible to 
access directly.
We were also trying to use raspivid which allows us to stream the video out and 
then pick up that streaming with java-cv. That seems to be working correctly, 
but with lots of delay. 
I'm looking forward to see what the Raspberry Pi foundation has to deliver. 
Samuel, thanks a lot for your help, let me know if you want me to write a wiki 
about how to install java cv in the Pi and also let me know if you wanted to 
get the linux-arm.jar. 

Cheers 

Original comment by sala...@gmail.com on 11 Jun 2013 at 4:00

GoogleCodeExporter commented 9 years ago
@salaboy Upload your files to Google Drive or something and post the URL here, 
thanks!!

As for a Wiki page, it would be great to have one that explains the build 
process in detail, yes. Could you also do it for Linux in general and maybe 
Android and what not? I'm sure you can manage :) In any case, I gave you Wiki 
edit access, so please feel free to contribute what you can, thanks!

Original comment by samuel.a...@gmail.com on 16 Jun 2013 at 1:26

GoogleCodeExporter commented 9 years ago
HI guys, I finally had time to finish the blog post about the installation 
process:
http://salaboy.com/2013/06/14/using-javacv-in-the-raspberry-pi-linux-arm/

Here are the direct links to the compiled jars: 
https://drive.google.com/folderview?id=0B0lFIImWo61bc3pTTHdZN3NmNkE&usp=sharing

I don't mind providing new versions of the jars for the next release of JavaCV. 
I believe that they should be delivered inside the distribution files, so 
please contact me back if you need me to produce those jars. 
The Raspberry Pi it's getting popular and having these jars out of the box can 
save people a lot of time.

Another thing is adding these compiled jars to the Maven repository, I think 
that it will be extremely useful if you just publish these artifacts there, so 
people just forget about all the compilation steps. 

Cheers

Original comment by sala...@gmail.com on 16 Jun 2013 at 12:51

GoogleCodeExporter commented 9 years ago
@salaboy If you can create a JAR file that contains all the binary files, and 
not just the ones for OpenCV, I'll be glad to upload it with all the rest to 
the little repo! Let me know if you get there, thanks.

Original comment by samuel.a...@gmail.com on 17 Jun 2013 at 1:10

GoogleCodeExporter commented 9 years ago
Hi Samuel,
I'm definitely a newbie here, what do you mean with all the binary files and 
not just the OpenCV ones? as far as I understand the only new thing that I've 
provided is the javacv-linux-arm.jar which contains the binary files for 
OpenCV, can you specify which other binaries do you want me to deliver?
Cheers

Original comment by sala...@gmail.com on 17 Jun 2013 at 9:40

GoogleCodeExporter commented 9 years ago
That's one of the reasons why we need better build instructions :) Try to 
compile with this command:
    $ mvn package -Pall -Djavacpp.options="-Xcompiler -fpermissive"
and when that succeeds you should get everything.

Original comment by samuel.a...@gmail.com on 17 Jun 2013 at 9:50

GoogleCodeExporter commented 9 years ago
I will try that and let you know! thanks for the guidance.
Cheers

Original comment by sala...@gmail.com on 17 Jun 2013 at 9:53

GoogleCodeExporter commented 9 years ago
Hi Samuel, it seems that there are libs that are not present in the raspberry 
pi JVM, look at the following paste bin with the missing classes: 
http://pastebin.com/ijbLH0Se

Any ideas?

Original comment by sala...@gmail.com on 17 Jun 2013 at 3:32

GoogleCodeExporter commented 9 years ago
The pom.xml file doesn't seem to have any dependency with jogl or anything else 
related with OpenGL 

Original comment by sala...@gmail.com on 17 Jun 2013 at 3:45

GoogleCodeExporter commented 9 years ago
AFAIK, JOGL doesn't have any Maven artifact. That's why it's not in the pom.xml 
file. You could limit the dependencies to only the set required to get a full 
build of the native libraries:
    $ mvn package -Pmarkers,ffmpeg,dc1394,flycapture,openkinect,videoinput -Djavacpp.options="-Xcompiler -fpermissive"

Original comment by samuel.a...@gmail.com on 18 Jun 2013 at 1:17

GoogleCodeExporter commented 9 years ago
BTW, here's an update of JavaCPP that should fix the libjvm (and libtbb?) issue:
http://code.google.com/p/javacpp/source/detail?r=81a627b83de1e76d491297299265a76
736f747fd
Let me know if you still have problem with that without your modifications, 
thanks.

Original comment by samuel.a...@gmail.com on 22 Jun 2013 at 5:26

GoogleCodeExporter commented 9 years ago
Hi Samuel,
I'm still fighting with installing all the other libs, I'm getting this now:
maven-compiler-plugin:2.3:compile (default-compile) @ javacv ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- exec-maven-plugin:1.2:exec (javacpp) @ javacv ---
Generating source file: 
/home/pi/projects/javacv/target/classes/com/googlecode/javacv/cpp/jniARToolKitPl
us.cpp
Building library file: 
/home/pi/projects/javacv/target/classes/com/googlecode/javacv/cpp/linux-arm/libj
niARToolKitPlus.so
g++ -I/usr/lib/jvm/java-6-openjdk-armhf/include 
-I/usr/lib/jvm/java-6-openjdk-armhf/include/linux 
/home/pi/projects/javacv/target/classes/com/googlecode/javacv/cpp/jniARToolKitPl
us.cpp -mfpu=vfp -mfpu=neon -ffast-math -fpermissive -Wl,-rpath,$ORIGIN/ -Wall 
-O3 -fPIC -shared -s -o 
/home/pi/projects/javacv/target/classes/com/googlecode/javacv/cpp/linux-arm/libj
niARToolKitPlus.so -L/usr/lib/jvm/java-6-openjdk-armhf/jre/lib/arm/jamvm 
-Wl,-rpath,/usr/lib/jvm/java-6-openjdk-armhf/jre/lib/arm/jamvm -ljvm 
/home/pi/projects/javacv/target/classes/com/googlecode/javacv/cpp/jniARToolKitPl
us.cpp:58:36: fatal error: ARToolKitPlus/template.h: No such file or directory

I've already built ARToolKit in the raspberry pi, but I'm now sure how javacv 
is looking for it.. any hint??

Cheers

Original comment by sala...@gmail.com on 22 Jun 2013 at 10:14

GoogleCodeExporter commented 9 years ago
You won't need to build ARToolKitPlus, just have it under the same parent 
directory as javacv. In any case, the path is indicated in annotations at the 
beginning of ARToolKitPlus.java.

Original comment by samuel.a...@gmail.com on 22 Jun 2013 at 10:28

GoogleCodeExporter commented 9 years ago
Can you be a little bit more specific? I've downloaded ARToolKitPlus from the 
JavaCV webpage, and then I've placed in these 3 places to see if it work 
without any luck (projects is my root dir): 

1) projects/javacv/ARToolKitPlus/

2) projects/ARToolKitPlus/

3) projects/javacv/target/ARToolKitPlus/

Any idea?
I notice that template.h is inside the include dir in the file that you provide 
in the main page.

Original comment by sala...@gmail.com on 22 Jun 2013 at 2:15

GoogleCodeExporter commented 9 years ago
None of the above: You would have to put it in "projects", but you can also 
change ARToolKitPlus.java to fit your system.

Original comment by samuel.a...@gmail.com on 22 Jun 2013 at 2:24

GoogleCodeExporter commented 9 years ago
So inside projects is the second options.. you mean before Projects? 
or you mean that needs to be something like

x) ARToolKitPlus/javacv/ ?

Original comment by sala...@gmail.com on 22 Jun 2013 at 2:28

GoogleCodeExporter commented 9 years ago
Please, put it wherever you want, and modify ARToolKitPlus.java instead.

Original comment by samuel.a...@gmail.com on 22 Jun 2013 at 2:30

GoogleCodeExporter commented 9 years ago
I've managed to get that working but now this error related with avcodec.. any 
idea which libraries are involved in that error? -> http://pastebin.com/GT6C6vaf

Original comment by sala...@gmail.com on 22 Jun 2013 at 6:58

GoogleCodeExporter commented 9 years ago
Good!

It simply looks like this isn't FFmpeg 1.2.x. Could you make sure you installed 
FFmpeg 1.2.x? Thanks

Original comment by samuel.a...@gmail.com on 23 Jun 2013 at 12:16

GoogleCodeExporter commented 9 years ago
ouch , this is the version that comes with the Raspberry Pi : 

pi@raspberrypi ~ $ ffmpeg -h
ffmpeg version 0.8.6-6:0.8.6-1+rpi1, Copyright (c) 2000-2013 the Libav 
developers
  built on Mar 31 2013 13:58:10 with gcc 4.6.3

I will try to build 1.2.x myself and see how it goes.. but I expect a lot of 
issues there .. I will keep you posted

Original comment by sala...@gmail.com on 23 Jun 2013 at 8:37

GoogleCodeExporter commented 9 years ago
I have the same problem when running project 
https://github.com/vanevery/javacv-stream-test on android. It works with the 
old libraries 0.2, but with 0.6 and 0.5 I get this: 

Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: 
soinfo_link_image(linker.cpp:1636): could not load library "libopencv_core.so" 
needed by "libjniopencv_core.so"; caused by find_library(linker.cpp:890): 
"libopencv_core.so" failed to load previously

Probably me doing something wrong..

Original comment by triDav...@gmail.com on 27 Sep 2013 at 9:15

GoogleCodeExporter commented 9 years ago
@triDave79 Maybe the cause of this is the same as issue #366? Check it out! 
Thanks

Original comment by samuel.a...@gmail.com on 4 Jan 2014 at 2:39

GoogleCodeExporter commented 9 years ago
Hi Jeremy, I'm currently moving everything related to native builds to the 
JavaCPP Presets:
    https://code.google.com/p/javacpp/wiki/Presets
Could you make the few necessary modifications to the build scripts and what 
not to add support for the "linux-arm" platform? Thanks in advance for your 
time!

Original comment by samuel.a...@gmail.com on 29 Mar 2014 at 2:39