All of lore.kernel.org
 help / color / mirror / Atom feed
* Yocto and Google Protocol Buffers
@ 2012-07-25  8:35 Giovanni Foiani
  2012-07-25  8:41 ` Burton, Ross
  0 siblings, 1 reply; 7+ messages in thread
From: Giovanni Foiani @ 2012-07-25  8:35 UTC (permalink / raw)
  To: yocto

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

Hi,

does anyone have configured a recipe for make Google Protocol
Buffers working?
This is my recipe:

*SUMMARY = "Protocol Buffers - Google's data interchange format"*
*DESCRIPTION = "Protocol Buffers are a way of encoding structured data in
an efficient yet extensible format"*
*SECTION = "libs"*
*
*
*LICENSE = "LGPLv2.1"*
*#LIC_FILES_CHKSUM =
"file://../protobuf-2.4.1/COPYING.txt;md5=af6809583bfde9a31595a58bb4a24514"*
*LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780"
*
*
*
*PR = "r0"*
*
*
*SRC_URI = "http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz"*
*
*
*SRC_URI[md5sum] = "dc84e9912ea768baa1976cb7bbcea7b5"*
*SRC_URI[sha256sum] =
"eac6969b617f397247e805267da2b0db3ff9e5a9163b123503a192fbb5776567"*
*
*
*inherit autotools*
*
*
*do_configure() {*
* ./configure --host=arm*
*}*
*
*
bin/bash:
/home/gfoiani/yocto/fsl-community-bsp/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/protobuf-2.4.1-r0/protobuf-2.4.1/src/protoc:
cannot execute binary file
make[2]: *** [unittest_proto_middleman] Error 126

I also tried with *-with-protoc=protoc *option in configure command but
without success..
Does anyone can help me to write a correct recipe for Protobuf library (and
also for protobuf-c)?

Thanks

Giovanni
--

Dott. Ing. Giovanni Foiani

Cell:        +39-349-3577515
Phone:    +39-0532-97-4106
mail:        giovanni.foiani@unife.it
CenTec - Corso Guercino, 47 - 44042 Cento (FE)

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

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

* Re: Yocto and Google Protocol Buffers
  2012-07-25  8:35 Yocto and Google Protocol Buffers Giovanni Foiani
@ 2012-07-25  8:41 ` Burton, Ross
  2012-07-25  9:47   ` Giovanni Foiani
  0 siblings, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2012-07-25  8:41 UTC (permalink / raw)
  To: Giovanni Foiani; +Cc: yocto

On 25 July 2012 09:35, Giovanni Foiani <fnognn@unife.it> wrote:
> does anyone have configured a recipe for make Google Protocol Buffers
> working?

> do_configure() {
> ./configure --host=arm
> }

Don't do that, because what if you want to build gpc for another architecture?

> bin/bash:
> /home/gfoiani/yocto/fsl-community-bsp/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/protobuf-2.4.1-r0/protobuf-2.4.1/src/protoc:
> cannot execute binary file
> make[2]: *** [unittest_proto_middleman] Error 126

That's because you're (presumably) running on x86 hardware, but are
trying to execute an ARM binary.  You'll need to build a
protobuf-native first that installs protoc into the sysroot first.
Numerous packages have this requirement, such as gtk+.

Ross


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

* Re: Yocto and Google Protocol Buffers
  2012-07-25  8:41 ` Burton, Ross
@ 2012-07-25  9:47   ` Giovanni Foiani
  2012-07-25  9:49     ` Burton, Ross
  0 siblings, 1 reply; 7+ messages in thread
From: Giovanni Foiani @ 2012-07-25  9:47 UTC (permalink / raw)
  To: Burton, Ross; +Cc: yocto

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

Thanks Burton,

I forgot to say that I'm building for an iMX53QSB.
I edited my recipe in this way:

*SUMMARY = "Protocol Buffers - Google's data interchange format"*
*DESCRIPTION = "Protocol Buffers are a way of encoding structured data in
an efficient yet extensible format"*
*SECTION = "libs"*
*
*
*DEPENDS = "protobuf-native"*
*DEPENDS_virtclass-native = ""*
*BBCLASSEXTEND = "native"*
*
*
*LICENSE = "LGPLv2.1"*
*#LIC_FILES_CHKSUM =
"file://../protobuf-2.4.1/COPYING.txt;md5=af6809583bfde9a31595a58bb4a24514"*
*LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780"
*
*
*
*PR = "r0"*
*
*
*SRC_URI = "http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz"*
*
*
*SRC_URI[md5sum] = "dc84e9912ea768baa1976cb7bbcea7b5"*
*SRC_URI[sha256sum] =
"eac6969b617f397247e805267da2b0db3ff9e5a9163b123503a192fbb5776567"*
*
*
*inherit autotools*
*
*
The native library builds properly but it populates the wrong sysroot..I
can find protoc executable into tmp/sysroots/i686-linux but not into
imx53qsb sysroot, hence rebuilding the protobuf library it can't find the
executable..

Which configuration do I have to use to populate the  imx53qsb sysroot?

Thanks

Giovanni

--

Dott. Ing. Giovanni Foiani

Cell:        +39-349-3577515
Phone:    +39-0532-97-4106
mail:        giovanni.foiani@unife.it
CenTec - Corso Guercino, 47 - 44042 Cento (FE)



On Wed, Jul 25, 2012 at 10:41 AM, Burton, Ross <ross.burton@intel.com>wrote:

> On 25 July 2012 09:35, Giovanni Foiani <fnognn@unife.it> wrote:
> > does anyone have configured a recipe for make Google Protocol Buffers
> > working?
>
> > do_configure() {
> > ./configure --host=arm
> > }
>
> Don't do that, because what if you want to build gpc for another
> architecture?
>
> > bin/bash:
> >
> /home/gfoiani/yocto/fsl-community-bsp/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/protobuf-2.4.1-r0/protobuf-2.4.1/src/protoc:
> > cannot execute binary file
> > make[2]: *** [unittest_proto_middleman] Error 126
>
> That's because you're (presumably) running on x86 hardware, but are
> trying to execute an ARM binary.  You'll need to build a
> protobuf-native first that installs protoc into the sysroot first.
> Numerous packages have this requirement, such as gtk+.
>
> Ross
>

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

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

* Re: Yocto and Google Protocol Buffers
  2012-07-25  9:47   ` Giovanni Foiani
@ 2012-07-25  9:49     ` Burton, Ross
  2012-07-25 10:04       ` Giovanni Foiani
  0 siblings, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2012-07-25  9:49 UTC (permalink / raw)
  To: Giovanni Foiani; +Cc: yocto

On 25 July 2012 10:47, Giovanni Foiani <fnognn@unife.it> wrote:
> The native library builds properly but it populates the wrong sysroot..I can
> find protoc executable into tmp/sysroots/i686-linux but not into imx53qsb
> sysroot, hence rebuilding the protobuf library it can't find the
> executable..

That's what you want -- you want a protoc in the native sysroot.  I
guess you need to patch the makefile to use the sysroot protoc instead
of the one it just built.

Ross


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

* Re: Yocto and Google Protocol Buffers
  2012-07-25  9:49     ` Burton, Ross
@ 2012-07-25 10:04       ` Giovanni Foiani
  2012-07-25 10:08         ` Burton, Ross
  0 siblings, 1 reply; 7+ messages in thread
From: Giovanni Foiani @ 2012-07-25 10:04 UTC (permalink / raw)
  To: Burton, Ross; +Cc: yocto

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

Thanks Ross,

Protocol Buffer README file says:

*** Note for cross-compiling ***
*
*
*  The makefiles normally invoke the protoc executable that they just*
*  built in order to build tests.  When cross-compiling, the protoc*
*  executable may not be executable on the host machine.  In this case,*
*  you must build a copy of protoc for the host machine first, then use*
*  the --with-protoc option to tell configure to use it instead.  For*
*  example:*
*
*
*    ./configure --with-protoc=protoc*
*
*
*  This will use the installed protoc (found in your $PATH) instead of*
*  trying to execute the one built during the build process.  You can*
*  also use an executable that hasn't been installed.  For example, if*
*  you built the protobuf package for your host machine in ../host,*
*  you might do:*
*
*
*    ./configure --with-protoc=../host/src/protoc*
*
*
I think I have to use this last option and point to the executable into the
i696-linux sysroot..
Can I do this overriding do_configure task? Like this:

*do_configure() {*
*    ./configure --with-protoc=/path/to/sysroot/i686-linux/usr/bin/protoc*
*}*
*
*
I tried this way but I got a "permission denied" error..

*/bin/bash: line 8: ../-libtool: Permission denied*
*| make[3]: *** [install-libLTLIBRARIES] Error 126*

How can I solve this error?

Thanks

Giovanni
--

Dott. Ing. Giovanni Foiani

Cell:        +39-349-3577515
Phone:    +39-0532-97-4106
mail:        giovanni.foiani@unife.it
CenTec - Corso Guercino, 47 - 44042 Cento (FE)



On Wed, Jul 25, 2012 at 11:49 AM, Burton, Ross <ross.burton@intel.com>wrote:

> On 25 July 2012 10:47, Giovanni Foiani <fnognn@unife.it> wrote:
> > The native library builds properly but it populates the wrong sysroot..I
> can
> > find protoc executable into tmp/sysroots/i686-linux but not into imx53qsb
> > sysroot, hence rebuilding the protobuf library it can't find the
> > executable..
>
> That's what you want -- you want a protoc in the native sysroot.  I
> guess you need to patch the makefile to use the sysroot protoc instead
> of the one it just built.
>
> Ross
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>

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

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

* Re: Yocto and Google Protocol Buffers
  2012-07-25 10:04       ` Giovanni Foiani
@ 2012-07-25 10:08         ` Burton, Ross
  2012-07-25 14:55           ` Giovanni Foiani
  0 siblings, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2012-07-25 10:08 UTC (permalink / raw)
  To: Giovanni Foiani; +Cc: yocto

On 25 July 2012 11:04, Giovanni Foiani <fnognn@unife.it> wrote:
> Can I do this overriding do_configure task? Like this:
>
> do_configure() {
>     ./configure --with-protoc=/path/to/sysroot/i686-linux/usr/bin/protoc
> }
>
> I tried this way but I got a "permission denied" error..
>
> /bin/bash: line 8: ../-libtool: Permission denied
> | make[3]: *** [install-libLTLIBRARIES] Error 126

By explicitly calling configure you've thrown away all the special
options that are required to cross-compile.  Delete  your
do_configure() block and just set EXTRA_OECONF = "
--with-protoc=protoc" (as the sysroot is in your PATH, and you can't
predict where sysroot is).

Ross


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

* Re: Yocto and Google Protocol Buffers
  2012-07-25 10:08         ` Burton, Ross
@ 2012-07-25 14:55           ` Giovanni Foiani
  0 siblings, 0 replies; 7+ messages in thread
From: Giovanni Foiani @ 2012-07-25 14:55 UTC (permalink / raw)
  To: Burton, Ross; +Cc: yocto

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

Using EXTRA_OECONF = "--with-protoc=protoc" it builds properly..

My final .bb file is:

*SUMMARY = "Protocol Buffers - Google's data interchange format"*
*DESCRIPTION = "Protocol Buffers are a way of encoding structured data in
an efficient yet extensible format"*
*SECTION = "libs"*
*
*
*DEPENDS = "protobuf-native"*
*DEPENDS_virtclass-native = ""*
*BBCLASSEXTEND = "native"*
*
*
*LICENSE = "LGPLv2.1"*
*#LIC_FILES_CHKSUM =
"file://../protobuf-2.4.1/COPYING.txt;md5=af6809583bfde9a31595a58bb4a24514"*
*LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780"
*
*
*
*PR = "r0"*
*
*
*SRC_URI = "http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz"*
*
*
*SRC_URI[md5sum] = "dc84e9912ea768baa1976cb7bbcea7b5"*
*SRC_URI[sha256sum] =
"eac6969b617f397247e805267da2b0db3ff9e5a9163b123503a192fbb5776567"*
*
*
*EXTRA_OECONF = "--with-protoc=protoc"*
*
*
*inherit autotools*
*
*
*
*
*
*
I also built the C binding of Google Protocol Buffer and this is the
recipe.. (I disabled protoc_c creation)

*SUMMARY = "C bindings for Google's Protocol Buffers"*
*DESCRIPTION = "This package provides a code generator and runtime
libraries to use Protocol Buffers from pure C (not C++)."*
*SECTION = "libs"*
*
*
*DEPENDS = "protobuf-c-native"*
*DEPENDS_virtclass-native = ""*
*BBCLASSEXTEND = "native"*
*
*
*DEPENDS += "protobuf"*
*
*
*LICENSE = "LGPLv2.1"*
*LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780"
*
*
*
*PR = "r0"*
*
*
*SRC_URI = "http://protobuf-c.googlecode.com/files/protobuf-c-0.15.tar.gz"*
*
*
*SRC_URI[md5sum] = "73ff0c8df50d2eee75269ad8f8c07dc8"*
*SRC_URI[sha256sum] =
"8fcb538e13a5431c46168fc8f2e6ad2574e2db9b684c0c72b066e24f010a0036"*
*
*
*EXTRA_OECONF = "--disable-protoc"*
*
*
*inherit autotools*
*
*
Giovanni
--

Dott. Ing. Giovanni Foiani

Cell:        +39-349-3577515
Phone:    +39-0532-97-4106
mail:        giovanni.foiani@unife.it
CenTec - Corso Guercino, 47 - 44042 Cento (FE)



On Wed, Jul 25, 2012 at 12:08 PM, Burton, Ross <ross.burton@intel.com>wrote:

> On 25 July 2012 11:04, Giovanni Foiani <fnognn@unife.it> wrote:
> > Can I do this overriding do_configure task? Like this:
> >
> > do_configure() {
> >     ./configure --with-protoc=/path/to/sysroot/i686-linux/usr/bin/protoc
> > }
> >
> > I tried this way but I got a "permission denied" error..
> >
> > /bin/bash: line 8: ../-libtool: Permission denied
> > | make[3]: *** [install-libLTLIBRARIES] Error 126
>
> By explicitly calling configure you've thrown away all the special
> options that are required to cross-compile.  Delete  your
> do_configure() block and just set EXTRA_OECONF = "
> --with-protoc=protoc" (as the sysroot is in your PATH, and you can't
> predict where sysroot is).
>
> Ross
>

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

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

end of thread, other threads:[~2012-07-25 14:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-25  8:35 Yocto and Google Protocol Buffers Giovanni Foiani
2012-07-25  8:41 ` Burton, Ross
2012-07-25  9:47   ` Giovanni Foiani
2012-07-25  9:49     ` Burton, Ross
2012-07-25 10:04       ` Giovanni Foiani
2012-07-25 10:08         ` Burton, Ross
2012-07-25 14:55           ` Giovanni Foiani

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.