Cscore TX1 compilation

We have been unable to compile the cscore library on the jetson TX1. When we run “./gradlew :arm:build -PcompilerPrefix=”, we get this error:

ubuntu@tegra-ubuntu:~/cscore-1.0.0$ ./gradlew :arm:build -PcompilerPrefix=
No .git was found in /home/ubuntu/cscore-1.0.0, or any parent directories of that directory.
No version number generated.
:outputVersions UP-TO-DATE
:arm:compileJava UP-TO-DATE
:arm:processResources UP-TO-DATE
:arm:classes UP-TO-DATE
:arm:jniHeadersCscore UP-TO-DATE
:downloadOpenCvHeaders UP-TO-DATE
:arm:unzipOpenCvHeaders UP-TO-DATE
:arm:downloadOpenCvJni_linux-arm UP-TO-DATE
:arm:unzipOpenCvJni_linux-arm UP-TO-DATE
:arm:downloadOpenCvNatives_linux-arm UP-TO-DATE
:arm:unzipOpenCvNatives_linux-arm UP-TO-DATE
:arm:downloadWpiUtil UP-TO-DATE
:arm:unzipWpiUtil UP-TO-DATE
:arm:compileCscoreSharedLibraryCscoreCpp
:arm:linkCscoreSharedLibrary/home/ubuntu/cscore-1.0.0/arm/build/wpiutil/Linux/arm/libwpiutil.a: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status

I’m having the exact same issue, any help would be appreciated

Did you have any errors with “linking camera vision executable”? We had some issues with that so we tried to compile with the Java version and it seemed to be working - but then we needed to download Java on the Jetson and that was a whole other issue. It seems that the c++ version is missing some libraries, so I would recommend trying the java version.

I believe FIRST hosts the precompiled libaries at http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/cscore/. You should use the armhf version of it.

The issue with this is the TX1 is an Aarch64 (64 bit) device, and not an armhf (32 bit) device. Because of this, the WPILib binaries do not work on the TX1. We do not currently have working binaries for the TX1. This is also the reason the cscore build is failing. It is attempting to load an external dependency, but it is attempting to load an incompatible version of that dependency. We don’t currently have an easy solution to fix this problem. Java has the same issue as well, since it uses native libraries that again the TX1 cannot read.

It is possible with a lot of manual editing of the build system for ntcore, opencv and cscore, but requires changing a fairly large amount of the build script setup. Sorry.

The Jetson has built in hardware supporting streaming - you can try changing the script to support an external camera. http://elinux.org/Jetson/H264_Codec

We ended up writing our own mjpeg streamer

Sent from my iPhone using Tapatalk

Nice!. Looks like we are both in the same boat with jetson problems. Any resources to start writing a custom mjpeg streamer?

Thanks!

This is because you need a version of wpiutil compiled for the TX1 as well. Grab the ntcore repo and run the same command, except use the publish task, and that should solve your problem.

Edit: you’ll need to rip out some of the native publish stuff, or you’ll get compile errors. In the ntcore publish.gradle, remove lines 71 to 113, and line 115.

How would we use the publish task to build ntcore?
And I am assuming that after we compile that we build cscore?

Much in the same way you ran the original build: ./gradlew publish

Thank you!

This thread is a few months old, but I’ve started working on this problem anticipating our team maybe using the TX1 next season. I got ntcore to build using fsilberberg’s tip about using gradlew publish with some lines removed from publish.gradle. I had to go back a github release - it looks like the gradle setup has changed since then and I could not line up fsilberberg’s line numbers with anything that looked like them in the newer release. Finally an ntcore example worked and I was able to add an entry to the NT and see it in the dashboard.

For cscore, gradlew publish did not work because, I think, it kept unzipping archives with libraries for arm32 and trying to use them to link to. I don’t know enough about gradle to modify this - I was able to build cscore by creating a clone of the whole directory, cleaning out all but the stuff that looked like code, and using cmake and make. Dependencies on opencv I replaced with the version already installed on TX1, and wpiutils with the newly built stuff from ntcore. I’m not that familiar with cmake either (why doesn’t include_directories() seem to do anything?), but I hacked at it until it built.

I can build one of the examples and get an MJPG stream that I can view on VLC media player (hint example for port 1182 - http://10.TE.AM.XX:1182/?action=stream), with a disturbingly long delay of about 2 sec, but can’t figure out how to see it in the dashboard yet.

Question: will I be able to use what I’ve built for 2018, or will I have to go through this process again? It looked like from comments in the recent ntcore release that wpilib was uncoupled from ntcore. Does that mean three builds in the future? Will there be changes to network tables or cscore that warrant rebuilding my current TX1 prototype libraries?