application with library dependencies for Yocto Linux?

Discuss Ubuntu related items.

application with library dependencies for Yocto Linux?

Postby xandercage43 » Wed Sep 23, 2020 7:12 am

I wrote an application for my AI Project on my laptop (Ubuntu 14.04) that depends on GStreamer and would like to cross-compile it for my Yocto Linux target (iMX6S-Wandboard). How do I cross-compile the application so that it runs on the target board and is able to use the GStreamer libraries?

My Makefile:
Code: Select all
PACKAGES            = gstreamer-1.0

override CFLAGS     += `pkg-config --cflags $(PACKAGES)` -Wall -Wextra "-DDATADIR=\"$(DATADIR)/\"" -ffunction-sections -fdata-sections
override LIBS       += `pkg-config --libs $(PACKAGES)`
override LDFLAGS    += -Wl,--gc-sections

OBJS    = basic-tutorial-7.o
DEPS    = $(foreach file,$(OBJS),$(basename $(file)).d)
EXE     = basic-tutorial-7

DESTDIR     ?=
PREFIX      ?=  $(HOME)/.local/
BINDIR      ?=  $(PREFIX)bin
DATADIR     ?=  $(PREFIX)share/$(PKGNAME)

.PHONY : clean install uninstall

all:    $(EXE)

$(EXE)  :   $(OBJS)
    $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)

$(OBJS) : %.o   :   %.c %.d
    @[ -d "$(@D)" ] || mkdir -p "$(@D)"
    $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<

$(DEPS) : %.d : $(PROJECT_ROOT)%.c
    @[ -d "$(@D)" ] || mkdir -p "$(@D)"
    $(CC) $(CFLAGS) $(CPPFLAGS) -M -MF $@ -MT "$(basename $@).o" $<

clean:
    rm -fr $(EXE) $(OBJS) $(DEPS)

install : $(EXE)
    install -DT -m 0755 $(EXE) $(DESTDIR)$(BINDIR)/$(EXE)

uninstall :
    rm -v $(DESTDIR)$(BINDIR)/$(EXE)

ifneq ($(MAKECMDGOALS), clean)
-include $(DEPS)
endif


My *.bb file:

Code: Select all
DESCRIPTION = "Basic Tutorial 7"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""

DEPENDS = "gstreamer1.0 pkgconfig-native gstreamer1.0-plugins-base"

FILES_${PN} += "${bindir}/basic-tutorial-7 ${bindir}/basic-tutorial-7"

EXTRA_OEMAKE += "DESTDIR=${D}/ DATADIR=${datadir}/basic-tutorial-7 BINDIR=${bindir}"

do_compile () {
    oe_runmake install
}

do_install () {
    oe_runmake clean
}


Build log:

Code: Select all
devtool build basic-tutorial-7

NOTE: Starting bitbake server...
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 1298 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:00:00
Parsing of 773 .bb files complete (772 cached, 1 parsed). 1299 targets, 63 skipped, 0 masked, 0 errors.
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 1298 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:00:00
Parsing of 773 .bb files complete (772 cached, 1 parsed). 1299 targets, 63 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |#######################################| Time: 0:00:01
Sstate summary: Wanted 0 Found 0 Missed 0 Current 322 (0% match, 100% complete)
NOTE: Executing Tasks
NOTE: Setscene tasks completed
NOTE: Tasks Summary: Attempted 1480 tasks of which 1480 didn't need to be rerun and all succeeded.


Code: Select all
$ devtool deploy-target basic-tutorial-7 root@192.168.0.101

NOTE: Starting bitbake server...
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 1298 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:00:00
Parsing of 773 .bb files complete (772 cached, 1 parsed). 1299 targets, 63 skipped, 0 masked, 0 errors.
ERROR: No files to deploy - have you built the basic-tutorial-7 recipe? If so, the install step has not installed any files.


from trainer for ai course in chennai.
xandercage43
 
Posts: 1
Joined: Wed Sep 23, 2020 7:02 am

Return to Software - Ubuntu

Who is online

Users browsing this forum: No registered users and 8 guests