libdispatch-dev / Grand Central Dispatch (GCD) on the TX1?

Hi!

I’m trying to move some code from an old desktop development environment (Ubunu 14.04) to the Jetson TX1 (Jetpack 2.3/Ubuntu 16.04) that uses libraries from libdispatch-dev (http://packages.ubuntu.com/xenial/libdispatch-dev).

Using sudo apt-get install could not locate a repository for the Jetson/arm64 processor. Googling didn’t get me very far either. When I started to build this library from source, I ran into problems with the config file for libdispatch-dev and building the dependent packages (more details below the break).

Has anybody successfully installed libdispatch on their Jetson TX1? If so, could you kindly advise me on how to best setup this library?

Thanks!


I’ve experienced a few problems (most minor), but these are the two that held me up the most. The first one is solved, but the second one I’m still chipping away at. Before I wade deeper into this and burn more hours, I thought I’d reach out to the community for help. Thanks again!

Problem 1: As downloaded from ubuntu.com, the config file for libdispatch-dev did not recognize the Jetson TX1. Updating the config files from savannah.gnu.org solved this problem.

$ wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
$ wget -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'

Problem 2: The library libdispatch-dev is dependent on libkqueue, which also does not have a Jetson-ready version. The make file for libkqueue throws errors when building.

ubuntu@tegra-ubuntu:/usr/local/src/libkqueue-2.0.3$ make
make  all-am
make[1]: Entering directory '/usr/local/src/libkqueue-2.0.3'
/bin/bash ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I./src/common -I./include -Wall -Wextra -Wno-missing-field-initializers -Werror -g -O2 -std=c99 -D_XOPEN_SOURCE=600 -fvisibility=hidden -g -O2 -MT src/common/libkqueue_la-knote.lo -MD -MP -MF src/common/.deps/libkqueue_la-knote.Tpo -c -o src/common/libkqueue_la-knote.lo `test -f 'src/common/knote.c' || echo './'`src/common/knote.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./src/common -I./include -Wall -Wextra -Wno-missing-field-initializers -Werror -g -O2 -std=c99 -D_XOPEN_SOURCE=600 -fvisibility=hidden -g -O2 -MT src/common/libkqueue_la-knote.lo -MD -MP -MF src/common/.deps/libkqueue_la-knote.Tpo -c src/common/knote.c  -fPIC -DPIC -o src/common/.libs/libkqueue_la-knote.o
In file included from src/common/private.h:52:0,
                 from src/common/knote.c:21:
src/common/knote.c: In function 'knote_lookup':
src/common/debug.h:51:23: error: format '%u' expects argument of type 'unsigned int', but argument 6 has type 'uintptr_t {aka long unsigned int}' [-Werror=format=]
       fprintf(stderr, "%s [%d]: %s(): "fmt"\n",                     \
                       ^
src/common/knote.c:126:5: note: in expansion of macro 'dbg_printf'
     dbg_printf("id=%u ent=%p", ident, ent);
     ^
cc1: all warnings being treated as errors
Makefile:828: recipe for target 'src/common/libkqueue_la-knote.lo' failed
make[1]: *** [src/common/libkqueue_la-knote.lo] Error 1
make[1]: Leaving directory '/usr/local/src/libkqueue-2.0.3'
Makefile:585: recipe for target 'all' failed
make: *** [all] Error 2

Hi Mepix,

We are no experience with this library - libdispatch-dev, and suggest to contact the appropriate code owners from the open source project or canonical.

Thanks

I’d previously moved on with other projects, but recently revisited Grand Central Dispatch because it is a nice library for handling parallel tasks. For what it’s worth, Apple has worked on Grand Central Dispatch and refreshed the code base. (The official ubuntu repositories seem to be lagging.) I was able to get this library to compile from source on the TX2: https://apple.github.io/swift-corelibs-libdispatch/.

Clang is the recommended compiler, but it can be built with GCC if some modifications are made to generic_unix_base.h. The library API works with both C and Swift. I’ll be sticking with C/C++ for now, but here is a guide for those who would like to use Swift on the Jetson:
https://medium.com/@ynd/getting-swift-to-run-on-nvidia-jetson-tx2-ai-computing-platform-1d9bcd6559dc