All of lore.kernel.org
 help / color / mirror / Atom feed
* error while compiling hello_2.7.bb
@ 2016-12-19 12:40 praveen vattipalli
  2016-12-19 12:42 ` praveen vattipalli
  2016-12-19 13:55 ` Richard Purdie
  0 siblings, 2 replies; 6+ messages in thread
From: praveen vattipalli @ 2016-12-19 12:40 UTC (permalink / raw)
  To: poky

[-- Attachment #1: Type: text/plain, Size: 2228 bytes --]

Hi All,
I have hello_2.7.bb file which contains as below
vim hello_2.7.bb
DESCRIPTION = "GNU Helloworld application"
SECTION = "test"
LICENSE = "BSD"

LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/BSD;md5=3775480a712fc46a69647678acb234cb"
SRC_DIR ?=
"/home/rajesh/poky-krogoth-15.0.2/meta/recipes-support/hello/hello_2.7"
SRC_URI = "file://${SRC_DIR}"

S = "${SRC_DIR}"

do_compile (){
        make prog
}

do_install(){
        install -d ${D}${bindir}
        install -m 0755 ${S}/hello  ${D}${bindir}
}

in hello_2.7 folder i have two files hello.c and Makefile
vim hello.c
#include<stdio.h>
int main()
{
        printf("hello YOCTO POKY\n");
        return 0;
}

Vim Makefile
prog:
        gcc -o hello hello.c

Now when i am building "bitbake hello", I am  getting below error in
poky-krogoth-15.0.2.
The same hello_2.7.bb  is compiling fine without any error in
"poky-dora-10.0.0".
The strange thing i observe in poky-krogoth-15.0.2. is that hello.c and
Makefile are getting erased in hello_2.7 dir.
Am i missing some thing in poky-krogoth-15.0.2? Please help.

Error msg:
ERROR: hello-2.7-r0 do_compile: Function failed: do_compile (log file is
located at
/home/rajesh/poky-krogoth-15.0.2/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/hello/2.7-r0/temp/log.do_compile.13763)
ERROR: Logfile of failure stored in:
/home/rajesh/poky-krogoth-15.0.2/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/hello/2.7-r0/temp/log.do_compile.13763
Log data follows:
| DEBUG: Executing shell function do_compile
| make: *** No rule to make target 'prog'.  Stop.
| WARNING: exit code 2 from a shell command.
| ERROR: Function failed: do_compile (log file is located at
/home/rajesh/poky-krogoth-15.0.2/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/hello/2.7-r0/temp/log.do_compile.13763)
ERROR: Task 6 (/home/rajesh/poky-krogoth-15.0.2/meta/recipes-support/hello/
hello_2.7.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 351 tasks of which 345 didn't need to be
rerun and 1 failed.
No currently running tasks (351 of 358)

Summary: 1 task failed:
  /home/rajesh/poky-krogoth-15.0.2/meta/recipes-support/hello/hello_2.7.bb,
do_compile

[-- Attachment #2: Type: text/html, Size: 2905 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* error while compiling hello_2.7.bb
  2016-12-19 12:40 error while compiling hello_2.7.bb praveen vattipalli
@ 2016-12-19 12:42 ` praveen vattipalli
  2016-12-19 13:41   ` Alexander Kanavin
  2016-12-19 13:55 ` Richard Purdie
  1 sibling, 1 reply; 6+ messages in thread
From: praveen vattipalli @ 2016-12-19 12:42 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 2236 bytes --]

Hi All,
I have hello_2.7.bb file which contains as below
vim hello_2.7.bb
DESCRIPTION = "GNU Helloworld application"
SECTION = "test"
LICENSE = "BSD"

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/BSD;md5=
3775480a712fc46a69647678acb234cb"
SRC_DIR ?= "/home/rajesh/poky-krogoth-15.0.2/meta/recipes-support/
hello/hello_2.7"
SRC_URI = "file://${SRC_DIR}"

S = "${SRC_DIR}"

do_compile (){
        make prog
}

do_install(){
        install -d ${D}${bindir}
        install -m 0755 ${S}/hello  ${D}${bindir}
}

in hello_2.7 folder i have two files hello.c and Makefile
vim hello.c
#include<stdio.h>
int main()
{
        printf("hello YOCTO POKY\n");
        return 0;
}

Vim Makefile
prog:
        gcc -o hello hello.c

Now when i am building "bitbake hello", I am  getting below error in
poky-krogoth-15.0.2.
The same hello_2.7.bb  is compiling fine without any error in
"poky-dora-10.0.0".
The strange thing i observe in poky-krogoth-15.0.2. is that hello.c and
Makefile are getting erased in hello_2.7 dir.
Am i missing some thing in poky-krogoth-15.0.2? Please help.

Error msg:
ERROR: hello-2.7-r0 do_compile: Function failed: do_compile (log file is
located at /home/rajesh/poky-krogoth-15.0.2/build/tmp/work/cortexa8hf-
neon-poky-linux-gnueabi/hello/2.7-r0/temp/log.do_compile.13763)
ERROR: Logfile of failure stored in: /home/rajesh/poky-krogoth-15.
0.2/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/hello/
2.7-r0/temp/log.do_compile.13763
Log data follows:
| DEBUG: Executing shell function do_compile
| make: *** No rule to make target 'prog'.  Stop.
| WARNING: exit code 2 from a shell command.
| ERROR: Function failed: do_compile (log file is located at
/home/rajesh/poky-krogoth-15.0.2/build/tmp/work/cortexa8hf-
neon-poky-linux-gnueabi/hello/2.7-r0/temp/log.do_compile.13763)
ERROR: Task 6 (/home/rajesh/poky-krogoth-15.0.2/meta/recipes-support/hello/
hello_2.7.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 351 tasks of which 345 didn't need to be
rerun and 1 failed.
No currently running tasks (351 of 358)

Summary: 1 task failed:
  /home/rajesh/poky-krogoth-15.0.2/meta/recipes-support/hello/hello_2.7.bb,
do_compile

[-- Attachment #2: Type: text/html, Size: 3156 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: error while compiling hello_2.7.bb
  2016-12-19 12:42 ` praveen vattipalli
@ 2016-12-19 13:41   ` Alexander Kanavin
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Kanavin @ 2016-12-19 13:41 UTC (permalink / raw)
  To: yocto

On 12/19/2016 02:42 PM, praveen vattipalli wrote:
> I have hello_2.7.bb <http://hello_2.7.bb> file which contains as below
> vim hello_2.7.bb <http://hello_2.7.bb>
> DESCRIPTION = "GNU Helloworld application"
> SECTION = "test"
> LICENSE = "BSD"
>
> LIC_FILES_CHKSUM =
> "file://${COMMON_LICENSE_DIR}/BSD;md5=3775480a712fc46a69647678acb234cb"
> SRC_DIR ?=
> "/home/rajesh/poky-krogoth-15.0.2/meta/recipes-support/hello/hello_2.7"
> SRC_URI = "file://${SRC_DIR}"
>
> S = "${SRC_DIR}"
>
> do_compile (){
>         make prog
> }

You probably need to use externalsrc facility:
http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#building-software-from-an-external-source

Alex


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: error while compiling hello_2.7.bb
  2016-12-19 12:40 error while compiling hello_2.7.bb praveen vattipalli
  2016-12-19 12:42 ` praveen vattipalli
@ 2016-12-19 13:55 ` Richard Purdie
  2016-12-21 10:52   ` praveen vattipalli
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2016-12-19 13:55 UTC (permalink / raw)
  To: praveen vattipalli, poky

On Mon, 2016-12-19 at 18:10 +0530, praveen vattipalli wrote:
> Hi All,
> I have hello_2.7.bb file which contains as below
> vim hello_2.7.bb
> DESCRIPTION = "GNU Helloworld application"
> SECTION = "test"
> LICENSE = "BSD"
> 
> LIC_FILES_CHKSUM =
> "file://${COMMON_LICENSE_DIR}/BSD;md5=3775480a712fc46a69647678acb234c
> b"
> SRC_DIR ?= "/home/rajesh/poky-krogoth-15.0.2/meta/recipes-
> support/hello/hello_2.7"
> SRC_URI = "file://${SRC_DIR}"
> 
> S = "${SRC_DIR}"

You don't want to set S to this as you're then building things in your
metadata directory. I suspect the code in more recent versions cleans
${S} before fetching/unpacking and this is wiping out your files.

You probably want S = "${WORKDIR}" or maybe S = "${WORKDIR}/hello_2.7",
I can't remember exactly where the fetcher places a directory of files.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: error while compiling hello_2.7.bb
  2016-12-19 13:55 ` Richard Purdie
@ 2016-12-21 10:52   ` praveen vattipalli
  2016-12-21 12:32     ` Alexander Kanavin
  0 siblings, 1 reply; 6+ messages in thread
From: praveen vattipalli @ 2016-12-21 10:52 UTC (permalink / raw)
  To: Richard Purdie; +Cc: poky

[-- Attachment #1: Type: text/plain, Size: 1654 bytes --]

Hi Richard,
setting S = "${WORKDIR}/hello_2.7" or S = "${WORKDIR}"  didn't work. I used

in build/conf/local.conf

INHERIT += "externalsrc"
EXTERNALSRC_pn-hello =
"/home/rajesh/Downloads/poky-krogoth-15.0.2/meta/recipes-extended/hello/hello_2.7"
EXTERNALSRC_BUILD_pn-hello =
"/home/rajesh/Downloads/poky-krogoth-15.0.2/meta/recipes-extended/hello/hello_2.7"

in hello_2.7.bb

EXTERNALSRC =
"/home/rajesh/Downloads/poky-krogoth-15.0.2/meta/recipes-extended/hello/hello_2.7"
EXTERNALSRC_BUILD =
"/home/rajesh/Downloads/poky-krogoth-15.0.2/meta/recipes-extended/hello/hello_2.7"

now i could compile.

Thanks,
Praveen.


On Mon, Dec 19, 2016 at 7:25 PM, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Mon, 2016-12-19 at 18:10 +0530, praveen vattipalli wrote:
> > Hi All,
> > I have hello_2.7.bb file which contains as below
> > vim hello_2.7.bb
> > DESCRIPTION = "GNU Helloworld application"
> > SECTION = "test"
> > LICENSE = "BSD"
> >
> > LIC_FILES_CHKSUM =
> > "file://${COMMON_LICENSE_DIR}/BSD;md5=3775480a712fc46a69647678acb234c
> > b"
> > SRC_DIR ?= "/home/rajesh/poky-krogoth-15.0.2/meta/recipes-
> > support/hello/hello_2.7"
> > SRC_URI = "file://${SRC_DIR}"
> >
> > S = "${SRC_DIR}"
>
> You don't want to set S to this as you're then building things in your
> metadata directory. I suspect the code in more recent versions cleans
> ${S} before fetching/unpacking and this is wiping out your files.
>
> You probably want S = "${WORKDIR}" or maybe S = "${WORKDIR}/hello_2.7",
> I can't remember exactly where the fetcher places a directory of files.
>
> Cheers,
>
> Richard
>

[-- Attachment #2: Type: text/html, Size: 2580 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: error while compiling hello_2.7.bb
  2016-12-21 10:52   ` praveen vattipalli
@ 2016-12-21 12:32     ` Alexander Kanavin
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Kanavin @ 2016-12-21 12:32 UTC (permalink / raw)
  To: poky

On 12/21/2016 12:52 PM, praveen vattipalli wrote:
> in build/conf/local.conf
>
> INHERIT += "externalsrc"
> EXTERNALSRC_pn-hello =
> "/home/rajesh/Downloads/poky-krogoth-15.0.2/meta/recipes-extended/hello/hello_2.7"
> EXTERNALSRC_BUILD_pn-hello =
> "/home/rajesh/Downloads/poky-krogoth-15.0.2/meta/recipes-extended/hello/hello_2.7"
>
> in hello_2.7.bb <http://hello_2.7.bb>
>
> EXTERNALSRC =
> "/home/rajesh/Downloads/poky-krogoth-15.0.2/meta/recipes-extended/hello/hello_2.7"
> EXTERNALSRC_BUILD =
> "/home/rajesh/Downloads/poky-krogoth-15.0.2/meta/recipes-extended/hello/hello_2.7"
>
> now i could compile.

I don't see why you would need to modify the global local.conf. Just put 
'inherit externalsrc' to the recipe file.

Alex



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-12-21 12:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-19 12:40 error while compiling hello_2.7.bb praveen vattipalli
2016-12-19 12:42 ` praveen vattipalli
2016-12-19 13:41   ` Alexander Kanavin
2016-12-19 13:55 ` Richard Purdie
2016-12-21 10:52   ` praveen vattipalli
2016-12-21 12:32     ` Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.