Closed GoogleCodeExporter closed 8 years ago
Where is `jni.h` file located on your system?
Original comment by samuel.a...@gmail.com
on 5 Feb 2014 at 11:19
Hi,
the jni.h is located at /usr/lib/jvm/jdk-7-oracle-armhf/include.
I just wonder why I don't see this path in the call of the g++-Compiler.
There's only /usr/local/include. As said before JAVA_HOME is set with
/usr/lib/jvm/jdk-7-oracle-armhf. Is there any possibility to configure the
paths used by g++? I saw in other blogs that the path to Java installation is
included in the call of the g++-Compiler.
Thanks in advance
Original comment by mifun...@gmx.de
on 5 Feb 2014 at 7:14
JavaCPP isn't using JAVA_HOME, because it's not usually set by default and we
can get a path from the "java.home" system property anyway, so I'm guessing the
problem is that you installed Oracle JDK, but you're actually using OpenJDK on
the command line. If this is the case, then try to uninstall OpenJDK. That
should do the trick. If you only have Oracle JDK installed, can you tell me the
path to you `java` binary? It should be in
`/usr/lib/jvm/jdk-7-oracle-armhf/jre/bin/`, but if it's somewhere else, we'll
need to do something about that, thanks
Original comment by samuel.a...@gmail.com
on 6 Feb 2014 at 1:06
Hi, Samuel. Thanks for your advice. It solved my issue. Now I run in another
problem:
g++ -I/usr/local/include/ -I/usr/lib/jvm/jdk-7-oracle-armhf/include
-I/usr/lib/jvm/jdk-7-oracle-armhf/include/linux
/usr/opt/prj/javacv/target/classes/com/googlecode/javacv/cpp/jnicvkernels.cpp
-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mfpu=neon -ffast-math
-Wl,-rpath,$ORIGIN/ -Wall -O3 -fPIC -shared -s -o
/usr/opt/prj/javacv/target/classes/com/googlecode/javacv/cpp/linux-arm/libjnicvk
ernels.so -L/usr/local/lib/ -Wl,-rpath,/usr/local/lib/ -lopencv_core
/usr/bin/ld: error:
/usr/opt/prj/javacv/target/classes/com/googlecode/javacv/cpp/linux-arm/libjnicvk
ernels.so uses VFP register arguments, /tmp/ccJzsIWo.o does not
/usr/bin/ld: failed to merge target specific data of file /tmp/ccJzsIWo.o
collect2: ld returned 1 exit status
I saw a solution on Stackoverflow
http://stackoverflow.com/questions/9753749/arm-compilation-error-vpf-registered-
used-by-executable-not-object-file.
So my question is how do I add the compiler settings which are advised to solve
this issue. Somewhere in the pom-File?
Thanks in advance
Original comment by mifun...@gmx.de
on 7 Feb 2014 at 9:52
Oh, it looks like unlike Android, most Linux distributions on ARM uses hardfp.
I'll have to change that. Check these files here:
https://javacpp.googlecode.com/git/src/main/resources/com/googlecode/javacpp/pro
perties/
We can set these properties individually on the command line, or point the
builder to another file entirely.
Original comment by samuel.a...@gmail.com
on 9 Feb 2014 at 1:56
Can you try the attached file with this command for me?
$ mvn clean package -Djavacpp.options="-propertyfile linux-arm.properties"
Thanks!
Original comment by samuel.a...@gmail.com
on 10 Feb 2014 at 12:52
Attachments:
Thanks for the properties. I compiled javacpp with your properties and after
that javacv
with mvn clean package -Djavacpp.options="-propertyfile
../javacpp/src/main/resources/com/googlecode/javacpp/properties/linux-arm.proper
ties" -Dplatform.name=linux-arm
But the compilation fails with
"/usr/opt/prj/javacv/target/classes/com/googlecode/javacv/cpp/jniopencv_imgproc.
cpp: In function 'void
Java_com_googlecode_javacv_cpp_opencv_1imgproc_adaptiveBilateralFilter(JNIEnv*,
jclass, jobject, jobject, jobject, jdouble, jdouble, jobject, jint)':
/usr/opt/prj/javacv/target/classes/com/googlecode/javacv/cpp/jniopencv_imgproc.c
pp:8976:9: error: 'adaptiveBilateralFilter' is not a member of 'cv'" (full
trace see below. Is it possible that something on the path is still missing?
Thanks in advance
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building JavaCV 0.7
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.3:clean (default-clean) @ javacv ---
[INFO] Deleting file set: /usr/opt/prj/javacv/target (included: [**], excluded:
[])
[INFO]
[INFO] --- maven-dependency-plugin:2.3:properties (properties) @ javacv ---
[INFO]
[INFO] --- maven-dependency-plugin:2.3:copy-dependencies (copy-dependencies) @
javacv ---
[INFO] Copying javacpp-0.7.jar to /usr/opt/prj/javacv/target/javacpp.jar
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ javacv ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3:compile (default-compile) @ javacv ---
[INFO] Compiling 44 source files to /usr/opt/prj/javacv/target/classes
[INFO]
[INFO] --- exec-maven-plugin:1.2:exec (javacpp) @ javacv ---
....
g++ -I/usr/local/include/ -I/usr/lib/jvm/jdk-7-oracle-armhf/include
-I/usr/lib/jvm/jdk-7-oracle-armhf/include/linux
/usr/opt/prj/javacv/target/classes/com/googlecode/javacv/cpp/jniopencv_imgproc.c
pp -Wl,-rpath,$ORIGIN/ -march=armv7-a -Wall -O3 -fPIC -shared -s -o
/usr/opt/prj/javacv/target/classes/com/googlecode/javacv/cpp/linux-arm/libjniope
ncv_imgproc.so -L/usr/local/lib/ -Wl,-rpath,/usr/local/lib/ -lopencv_imgproc
-lopencv_core
/usr/opt/prj/javacv/target/classes/com/googlecode/javacv/cpp/jniopencv_imgproc.c
pp: In function 'void
Java_com_googlecode_javacv_cpp_opencv_1imgproc_adaptiveBilateralFilter(JNIEnv*,
jclass, jobject, jobject, jobject, jdouble, jdouble, jobject, jint)':
/usr/opt/prj/javacv/target/classes/com/googlecode/javacv/cpp/jniopencv_imgproc.c
pp:8976:9: error: 'adaptiveBilateralFilter' is not a member of 'cv'
Original comment by mifun...@gmx.de
on 10 Feb 2014 at 9:22
I had the same issue, using your separate properties file the build exists
successfully
Original comment by rog...@in-ventid.nl
on 10 Feb 2014 at 9:22
Ok, the properties seems to be working, good. I've tried to make it a bit more
general, so please try again with the attached one just to confirm, thanks.
As for the remaining compile error, you should try to upgrade to OpenCV 2.4.8.
Original comment by samuel.a...@gmail.com
on 11 Feb 2014 at 1:16
Attachments:
Hi Samuel,
with your new settings and the switch to OpenCV 2.4.8 the compilation is
successful. My VM cores when I first access OpenCV in Java but I think it's
another issue because my build system isn't clean anymore. So I will build it
on a clean system. If it still fails I'll come back to you :-). Neverthenless
many thanks for your support.
Original comment by mifun...@gmx.de
on 13 Feb 2014 at 9:22
The fix has been included in the latest release of JavaCPP and JavaCV 0.8. This
new version also comes with easier to use build scripts, so please take
advantage of that to try out different sets of options to satisfy your needs.
A lot of other things have changed with this new version, so please make sure
to read the news release here:
http://bytedeco.org/release/2014/04/28/first-release.html
Incidentally, the project is now hosted on GitHub:
https://github.com/bytedeco/javacv
Thanks for all your help on this issue! I am also looking for someone to
provide builds for the "linux-arm" platform, so if you'd like to help out that
way, please let me know, it would be very welcome.
Original comment by samuel.a...@gmail.com
on 29 Apr 2014 at 1:19
Original issue reported on code.google.com by
mifun...@gmx.de
on 3 Feb 2014 at 8:36