Problems with Maven build for javacpp-presets on Raspberry Pi 3

212 views
Skip to first unread message

merle...@gmail.com

unread,
Apr 8, 2016, 8:23:52 PM4/8/16
to javacpp
I am trying to follow instructions at https://github.com/bytedeco/javacpp-presets/wiki/Build-Environments for building javacpp-presets for linux-arm.

First I build javacpp. The mvn command completes without problems.

Then I try building javacpp-presets with opencv and ffmpeg projects only:

mvn install --projects opencv,ffmpeg -Djavacpp.platform=linux-armhf -Djavacpp.platform.compiler=arm-linux-gnueabihf-g++ -Dplatform=linux-armhf -Dplatform.compiler=arm-linux-gnueabihf-g++

That doesn't work. Here's the error:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] JavaCPP Presets for OpenCV
[INFO] JavaCPP Presets for FFmpeg
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building JavaCPP Presets for OpenCV 3.1.0-1.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] JavaCPP Presets for OpenCV ........................ FAILURE [1.188s]
[INFO] JavaCPP Presets for FFmpeg ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.597s
[INFO] Finished at: Fri Apr 08 18:00:59 CDT 2016
[INFO] Final Memory: 11M/26M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project opencv: Could not resolve dependencies for project org.bytedeco.javacpp-presets:opencv:jar:3.1.0-1.2-SNAPSHOT: Could not find artifact org.bytedeco.javacpp-presets:opencv:jar:linux-armhf:3.1.0-1.2-SNAPSHOT -> [Help 1]

Any idea what I am missing?

Thanks.

Samuel Audet

unread,
Apr 8, 2016, 9:01:35 PM4/8/16
to javacpp...@googlegroups.com, merle...@gmail.com
On 04/09/2016 08:05 AM, merle...@gmail.com wrote:
[ERROR] Failed to execute goal on project opencv: Could not resolve dependencies for project org.bytedeco.javacpp-presets:opencv:jar:3.1.0-1.2-SNAPSHOT: Could not find artifact org.bytedeco.javacpp-presets:opencv:jar:linux-armhf:3.1.0-1.2-SNAPSHOT -> [Help 1]

Any idea what I am missing?
You're probably using an old version of Maven. It's only specified in the x86 section, but make sure to call the mvn command with the -Djavacpp.platform.dependency=false flag as well...

Samuel

merle...@gmail.com

unread,
Apr 9, 2016, 12:19:36 AM4/9/16
to javacpp
Upgraded Maven to the latest version (3.3.9), added the flag, added more modules and re-ran the build. Here's the command:

mvn install --projects .,opencv,ffmpeg,flandmark,artoolkitplus,libfreenect -Djavacpp.platform=linux-armhf -Djavacpp.platform.compiler=arm-linux-gnueabihf-g++ -Dplatform=linux-armhf -Dplatform.compiler=arm-linux-gnueabihf-g++ -Djavacpp.platform.dependency=false

This time it was successful... but it looks like the story didn't end there. Note that this build did not include flycapture and libdc1394: I don't need them, I'll never use them, and I really don't want to waste my time building them if possible.

So, next step... building javacv:

mvn install -Pffmpeg -Djavacpp.platform=linux-armhf -Djavacpp.platform.compiler=arm-linux-gnueabihf-g++ -Dplatform=linux-armhf -Dplatform.compiler=arm-linux-gnueabihf-g++ -Dmaven.test.skip=true

The command doesn't allow me to choose the list of modules to build. I suppose I could exclude certain parts of the source tree by choosing the appropriate profile. Here's the problem, though:

    <dependency>
      <groupId>org.bytedeco.javacpp-presets</groupId>
      <artifactId>flycapture</artifactId>
      <version>2.8.3.1-${javacpp.version}</version>
    </dependency>
    <dependency>
      <groupId>org.bytedeco.javacpp-presets</groupId>
      <artifactId>libdc1394</artifactId>
      <version>2.2.4-${javacpp.version}</version>
    </dependency>
    <dependency>
      <groupId>org.bytedeco.javacpp-presets</groupId>
      <artifactId>videoinput</artifactId>
      <version>0.200-${javacpp.version}</version>
    </dependency>

The first two I excluded from my javacpp-presets build. The last one... I am not even sure it's possible to build it under linux-armhf. Isn't it a win32-only thing? Anyway, the build fails -- predictably enough -- when it cannot find a flycapture artifact. Which I've never built.

What would be the best way to fix this? Should I edit pom.xml and simply remove dependencies that I have not built or cannot build? Or something else?

Thanks in advance!

v.f.b...@gmail.com

unread,
Apr 9, 2016, 5:06:37 AM4/9/16
to javacpp
Hi,

From what I found, the only one that was a little tricky was the flycapture part, as you have to download the SDK. For the other two, if you include them in the cpp and mvn earlier steps, it just builds an empty jar, and so the dependency is then found.

But, you're right, the other way is just to edit the pom.xml and tune it to your needs. I haven't even really tested any of the other components apart from opencv and ffmpeg, just added them to the build to try to make it compile straight out of the box.

Let us know how you get on, you might be the first person to try the build out so far! I've had it running on Pi3 for a few weeks now, I've noticed frame rate drops off the more functions you call on the frame, and there's probably tuning around the build flags that could be done for this, but we're seeing what peoples experiences are like first.

Thanks

merle...@gmail.com

unread,
Apr 9, 2016, 8:16:12 PM4/9/16
to javacpp
So. It looks like commenting out those unwanted dependencies was the correct course of action. Everything built just fine after that.

This concludes my "let's build everything directly on Raspberry Pi 3" exercise. I've already tried the resulting jars with my little video capture app and everything is working just like it should. For the most part, anyway. In the end, the exercise took quite a bit of time, but most of it was spent waiting for various builds and downloads to complete. I could have tried the cross-compiling route instead, but I didn't have a Linux box to play with and I wasn't in the mood for setting it up. It worked out just fine.

Stay tuned for the next episode in which I rant about Raspberry Pi 3's USB bandwidth limitations...

Reply all
Reply to author
Forward
0 new messages