Hi Kenton,

I've crosscompiled the tests and ran them on the target board, here are the
results...  everything appears to have passed!  I'm assuming some of those
tests verify the threading (pthreads)?  Is there anything else I should run?

-Rob

root:~>
> ./protobuf-lite-test
> PASS
>



And...

> root:~>
> ./protobuf-lazy-descriptor-test
> Running main() from
> gtest_main.cc
> [==========] Running 34 tests from 3 test
> cases.
> [----------] Global test environment
> set-up.
> [----------] 30 tests from
> GeneratedMessageTest
> [ RUN      ]
> GeneratedMessageTest.Defaults
> [       OK ] GeneratedMessageTest.Defaults (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.FloatingPointDefaults
> [       OK ] GeneratedMessageTest.FloatingPointDefaults (0
> ms)
> [ RUN      ]
> GeneratedMessageTest.Accessors
> [       OK ] GeneratedMessageTest.Accessors (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.MutableStringDefault
> [       OK ] GeneratedMessageTest.MutableStringDefault (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.Clear
> [       OK ] GeneratedMessageTest.Clear (0
> ms)
> [ RUN      ]
> GeneratedMessageTest.EmbeddedNullsInBytesCharStar
> [       OK ] GeneratedMessageTest.EmbeddedNullsInBytesCharStar (0
> ms)
> [ RUN      ]
> GeneratedMessageTest.ClearOneField
> [       OK ] GeneratedMessageTest.ClearOneField (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.StringCharStarLength
> [       OK ] GeneratedMessageTest.StringCharStarLength (0
> ms)
> [ RUN      ]
> GeneratedMessageTest.CopyFrom
> [       OK ] GeneratedMessageTest.CopyFrom (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.SwapWithEmpty
> [       OK ] GeneratedMessageTest.SwapWithEmpty (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.SwapWithSelf
> [       OK ] GeneratedMessageTest.SwapWithSelf (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.SwapWithOther
> [       OK ] GeneratedMessageTest.SwapWithOther (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.CopyConstructor
> [       OK ] GeneratedMessageTest.CopyConstructor (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.CopyAssignmentOperator
> [       OK ] GeneratedMessageTest.CopyAssignmentOperator (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.UpcastCopyFrom
> [       OK ] GeneratedMessageTest.UpcastCopyFrom (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.NonEmptyMergeFrom
> [       OK ] GeneratedMessageTest.NonEmptyMergeFrom (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.MergeFromSelf
>
>
> [WARNING] src/gtest-death-test.cc:743: Death tests use fork(), which is
> unsafe .
> Abort
>
>

And Finally...

> root:~>
> ./protobuf-test
>
> Running main() from
> gtest_main.cc
>
> [==========] Running 684 tests from 94 test
> cases.
>
> [----------] Global test environment
> set-up.
>
> [----------] 1 test from
> GeneratedDescriptorTest
>
> [ RUN      ]
> GeneratedDescriptorTest.IdenticalDescriptors
>
> [       OK ] GeneratedDescriptorTest.IdenticalDescriptors (258
> ms)
> [----------] 1 test from GeneratedDescriptorTest (258 ms
> total)
>
>
> [----------] 34 tests from
> GeneratedMessageTest
>
> [ RUN      ]
> GeneratedMessageTest.Defaults
>
> [       OK ] GeneratedMessageTest.Defaults (1
> ms)
>
> [ RUN      ]
> GeneratedMessageTest.FloatingPointDefaults
>
> [       OK ] GeneratedMessageTest.FloatingPointDefaults (0
> ms)
> [ RUN      ]
> GeneratedMessageTest.Accessors
>
> [       OK ] GeneratedMessageTest.Accessors (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.MutableStringDefault
>
> [       OK ] GeneratedMessageTest.MutableStringDefault (0
> ms)
> [ RUN      ]
> GeneratedMessageTest.Clear
>
> [       OK ] GeneratedMessageTest.Clear (1
> ms)
>
> [ RUN      ]
> GeneratedMessageTest.EmbeddedNullsInBytesCharStar
>
> [       OK ] GeneratedMessageTest.EmbeddedNullsInBytesCharStar (0
> ms)
> [ RUN      ]
> GeneratedMessageTest.ClearOneField
>
> [       OK ] GeneratedMessageTest.ClearOneField (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.StringCharStarLength
>
> [       OK ] GeneratedMessageTest.StringCharStarLength (0
> ms)
> [ RUN      ]
> GeneratedMessageTest.CopyFrom
>
> [       OK ] GeneratedMessageTest.CopyFrom (1
> ms)
>
> [ RUN      ]
> GeneratedMessageTest.SwapWithEmpty
>
> [       OK ] GeneratedMessageTest.SwapWithEmpty (2
> ms)
> [ RUN      ]
> GeneratedMessageTest.SwapWithSelf
>
> [       OK ] GeneratedMessageTest.SwapWithSelf (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.SwapWithOther
>
> [       OK ] GeneratedMessageTest.SwapWithOther (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.CopyConstructor
>
> [       OK ] GeneratedMessageTest.CopyConstructor (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.CopyAssignmentOperator
>
> [       OK ] GeneratedMessageTest.CopyAssignmentOperator (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.UpcastCopyFrom
>
> [       OK ] GeneratedMessageTest.UpcastCopyFrom (0
> ms)
> [ RUN      ]
> GeneratedMessageTest.DynamicMessageCopyFrom
>
> [       OK ] GeneratedMessageTest.DynamicMessageCopyFrom (2
> ms)
> [ RUN      ]
> GeneratedMessageTest.NonEmptyMergeFrom
>
> [       OK ] GeneratedMessageTest.NonEmptyMergeFrom (1
> ms)
> [ RUN      ]
> GeneratedMessageTest.MergeFromSelf
>
>
>
> [WARNING] src/gtest-death-test.cc:743: Death tests use fork(), which is
> unsafe particularly in a threaded context. For thi.
> Abort
>

On Wed, Oct 21, 2009 at 12:32 PM, Kenton Varda <ken...@google.com> wrote:

> It seems there's some ambiguity as to whether -pthread implies -lpthread.
>  Are you able to compile and run the tests?
>
> On Wed, Oct 21, 2009 at 12:29 PM, Rob <r...@rmdashr.com> wrote:
>
>>
>> Hmm... not sure if my last msg got eaten or not, but the issue was
>> specifying '-pthread' instead of '-lpthread'.  Not sure why the
>> protobuf requires this when nothing else does...  but regardless,
>> thanks for the pointer to pkg-config... it helped solve the problem
>> for me!  :)
>>
>> Thanks again!
>>
>> -Rob
>>
>> On Oct 21, 11:13 am, Kenton Varda <ken...@google.com> wrote:
>> > When you compile a program against libprotobuf, you need to use
>> pkg-config
>> > to find out what additional cflags and libs are necessary.  Example:
>> >
>> >   g++ -c my_prog.cc `pkg-config --cflags protobuf`
>> >   g++ -o my_prog my_prog.o `pkg-config --libs protobuf`
>> >
>> > Your specific problem is probably that you are not linking against
>> > libpthread.
>> >
>> > On Wed, Oct 21, 2009 at 10:42 AM, Rob <r...@rmdashr.com> wrote:
>> >
>> > > Hi,
>> >
>> > > This is my build script to cross compile protobuf 2.2.0:
>> > > ================
>> > > #!/bin/sh
>> >
>> > > FLAGS="--disable-shared --disable-crypto-auth --without-gnutls --
>> > > without-ssl --without-zlib \
>> > >    --without-libssh2 --disable-ipv6 --disable-manual --disable-telnet
>> > > --disable-tftp \
>> > >    --disable-ldap --disable-file --disable-ftp"
>> >
>> > > cd $1
>> > > make distclean
>> > > mkdir host
>> > > cd host
>> > > make distclean
>> > > ../configure $FLAGS --prefix=`pwd`/install && make -j4 && make install
>> > > cd ..
>> > > ./configure --with-protoc=host/src/protoc --host=bfin-uclinux $FLAGS
>> --
>> > > prefix=`pwd`/bfin CPPFLAGS="-DUCLINUX" LDFLAGS="-Wl,-elf2flt" &&
>> > > make -j4 && make install
>> > > ================
>> >
>> > > When I go to link something against it I get all kinds of errors like
>> > > "undefined reference to `_pthread_once'"
>> >
>> > > The configure script output regarding pthreads looks like this:
>> > > t...@godbox:~/work/blackfin/trunk/lib/protobuf$ ./configure --with-
>> > > protoc=host/src/protoc --host=bfin-linux-uclibc --disable-shared --
>> > > disable-crypto-auth --without-gnutls --without-ssl --without-zlib
>> > > --without-libssh2 --disable-ipv6 --disable-manual --disable-telnet --
>> > > disable-tftp     --disable-ldap --disable-file --disable-ftp --
>> > > prefix=`pwd`/bfin CPPFLAGS="-DUCLINUX" LDFLAGS="-Wl,-elf2flt" 2>&1 |
>> > > grep -i pthread
>> > > checking for the pthreads library -lpthreads... no
>> > > checking whether pthreads work without any flags... no
>> > > checking whether pthreads work with -Kthread... no
>> > > checking whether pthreads work with -kthread... no
>> > > checking for the pthreads library -llthread... no
>> > > checking whether pthreads work with -pthread... yes
>> > > checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
>> > > checking if more special flags are required for pthreads... no
>> > > checking whether to check for GCC pthread/shared inconsistencies...
>> > > yes
>> > > checking whether -pthread is sufficient with -shared... yes
>> > > checking for the pthreads library -lpthreads... no
>> > > checking whether pthreads work without any flags... no
>> > > checking whether pthreads work with -Kthread... no
>> > > checking whether pthreads work with -kthread... no
>> > > checking for the pthreads library -llthread... no
>> > > checking whether pthreads work with -pthread... yes
>> > > checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
>> > > checking if more special flags are required for pthreads... no
>> > > checking whether to check for GCC pthread/shared inconsistencies...
>> > > yes
>> > > checking whether -pthread is sufficient with -shared... yes
>> >
>> > > I'm somewhat confused what the issue is - I'm assuming the configure
>> > > script isn't working quit right with the bfin toolchain?  Here is the
>> > > full configure results:
>> > >http://pastie.org/private/prkft9dz5v2t6harphyw
>> >
>> > > Anything else I can do to help figure out what's going on?
>> >
>> > > Thanks!
>> >
>> >
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to