Re: RPM Spec File
Hmm, now I'm confused. They imply that libprotobuf should be linked with both -pthread *and* -lpthread, as the latter registers libpthread as some sort of auto-loaded dependency, I guess. The internet does not provide very much useful info on what the real best practice is. On Wed, Sep 9, 2009 at 3:40 PM, Kevin Deldycke wrote: > > On Wed, Aug 19, 2009 at 20:35, Kenton Varda wrote: > > Well, I haven't observed this problem on other platforms or distros. > What > > happens if you write a very basic program that uses pthread_once, then > try > > to compile it with -pthread (but not -lpthread)? If this doesn't work, I > > suspect something is wrong with the way GCC was built for your > distribution. > > FYI, I've just reported the issue in Mandriva's bug tracker: > https://qa.mandriva.com/show_bug.cgi?id=53578 > > -- > Kevin Deldycke > • blog: http://kevin.deldycke.com > • band: http://coolcavemen.com > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: RPM Spec File
On Wed, Aug 19, 2009 at 20:35, Kenton Varda wrote: > Well, I haven't observed this problem on other platforms or distros. What > happens if you write a very basic program that uses pthread_once, then try > to compile it with -pthread (but not -lpthread)? If this doesn't work, I > suspect something is wrong with the way GCC was built for your distribution. FYI, I've just reported the issue in Mandriva's bug tracker: https://qa.mandriva.com/show_bug.cgi?id=53578 -- Kevin Deldycke • blog: http://kevin.deldycke.com • band: http://coolcavemen.com --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: RPM Spec File
On Wed, Aug 19, 2009 at 20:35, Kenton Varda wrote: > In any case, the work-around you may want is to set PTHREAD_CFLAGS='-pthread > -lpthread' -- that is, pass both flags. Or better yet, set > PTHREAD_CFLAGS=-pthread and PTHREAD_LIBS=-lpthread -- this way -lpthread is > only passed while linking. Thanks for the tip ! I've tried the combination of PTHREAD_CFLAGS and PTHREAD_LIBS you suggested and it work well. Better: setting PTHREAD_LIBS alone is enough. You can find attached an updated version of my spec file. -- Kevin Deldycke • blog: http://kevin.deldycke.com • band: http://coolcavemen.com --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- protobuf.spec Description: Binary data
Re: RPM Spec File
On Wed, Aug 19, 2009 at 10:47 AM, Kevin Deldycke wrote: > BTW, should we continue packaging-related discussion of protobuf here ? > Please do. > Is this issue worth a bug report ? Well, I haven't observed this problem on other platforms or distros. What happens if you write a very basic program that uses pthread_once, then try to compile it with -pthread (but not -lpthread)? If this doesn't work, I suspect something is wrong with the way GCC was built for your distribution. In any case, the work-around you may want is to set PTHREAD_CFLAGS='-pthread -lpthread' -- that is, pass both flags. Or better yet, set PTHREAD_CFLAGS=-pthread and PTHREAD_LIBS=-lpthread -- this way -lpthread is only passed while linking. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: RPM Spec File
On Wed, Aug 19, 2009 at 02:19, Kenton Varda wrote: > The problem with these spec files is that they're large and complicated and > I just don't have time to learn how they work and maintain them. If someone > would like to commit to maintaining these things -- which means I'd call on > you to update them for each release, answer questions about them, etc., and > I'd need you to respond promptly (within a day or two) -- then we could add > them to the official package. Otherwise I'd prefer to stick with the > current decentralized approach. I think you are right regarding spec file management: maintaining a generic spec that work for each RPM-based distribution is a lot of work. These files became a big mess really fast: think about supporting different distributions, distribution versions and architectures... That's a lot of possible combination ! I understand why you require such commitment and I agree with you. So +1 for the decentralized approach. BTW, should we continue packaging-related discussion of protobuf here ? > BTW, Kevin, I'm confused about this line in your changelog: > >> - Add -lpthread option to environment (else configure set it to -pthread) > > -pthread is the correct option, and it implies -lpthread. -pthread ensures > that the C runtime library uses thread-safe functions (e.g. errno becomes > thread-local) whereas -lpthread merely links against libpthread.so. Why did > you change this? Here is what happened when I don't force the "-lpthread" option. First, "configure" guess that we should use "-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 the location of hash_map... configure: creating ./config.status (...) Then the compilation fail: (...) libtool: link: x86_64-mandriva-linux-gnu-g++ -shared -nostdlib /usr/lib/gcc/x86_64-manbo-linux-gnu/4.3.2/../../../../lib64/crti.o /usr/lib/gcc/x86_64-manbo-linux-gnu/4.3.2/crtbeginS.o .libs/common.o .libs/once.o .libs/hash.o .libs/extension_set.o .libs/generated_message_util.o .libs/message_lite.o .libs/repeated_field.o .libs/wire_format_lite.o .libs/coded_stream.o .libs/zero_copy_stream.o .libs/zero_copy_stream_impl_lite.o .libs/strutil.o .libs/substitute.o .libs/structurally_valid.o .libs/descriptor.o .libs/descriptor.pb.o .libs/descriptor_database.o .libs/dynamic_message.o .libs/extension_set_heavy.o .libs/generated_message_reflection.o .libs/message.o .libs/reflection_ops.o .libs/service.o .libs/text_format.o .libs/unknown_field_set.o .libs/wire_format.o .libs/gzip_stream.o .libs/printer.o .libs/tokenizer.o .libs/zero_copy_stream_impl.o .libs/importer.o .libs/parser.o -lz -L/usr/lib/gcc/x86_64-manbo-linux-gnu/4.3.2 -L/usr/lib/gcc/x86_64-manbo-linux-gnu/4.3.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-manbo-linux-gnu/4.3.2/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-manbo-linux-gnu/4.3.2/crtendS.o /usr/lib/gcc/x86_64-manbo-linux-gnu/4.3.2/../../../../lib64/crtn.o -pthread -Wl,--as-needed -Wl,--no-undefined -Wl,-z -Wl,relro -pthread -Wl,-soname -Wl,libprotobuf.so.4 -o .libs/libprotobuf.so.4.0.0 libtool: compile: x86_64-mandriva-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -pthread -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -MT python_generator.lo -MD -MP -MF .deps/python_generator.Tpo -c google/protobuf/compiler/python/python_generator.cc -o python_generator.o >/dev/null 2>&1 .libs/common.o: In function `InitShutdownFunctionsOnce': /home/kevin/rpm/BUILD/protobuf-2.2.0/src/./google/protobuf/stubs/once.h:115: undefined reference to `pthread_once' .libs/common.o: In function `GoogleOnceInit': /home/kevin/rpm/BUILD/protobuf-2.2.0/src/./google/protobuf/stubs/once.h:115: undefined reference to `pthread_once' .libs/common.o: In function `GoogleOnceInit': /home/kevin/rpm/BUILD/protobuf-2.2.0/src/google/protobuf/stubs/common.cc:137: undefined reference to `pthread_once' .libs/extension_set.o: In function `GoogleOnceInit': /home/kevin/rpm/BUILD/protobuf-2.2.0/src/./google/protobuf/stubs/once.h:115: undefined reference to `pthread_once' /usr/bin/ld: Dwarf Error: Offset (391001) greater than or equal to .debug_str size (366455). .libs/descriptor.o: In function `InitGeneratedPoolOnce': /home/kevin/rpm/BUILD/protobuf-2.2.0/src/./google/protobuf/stubs/once.h:115: undefin
Re: RPM Spec File
The problem with these spec files is that they're large and complicated and I just don't have time to learn how they work and maintain them. If someone would like to commit to maintaining these things -- which means I'd call on you to update them for each release, answer questions about them, etc., and I'd need you to respond promptly (within a day or two) -- then we could add them to the official package. Otherwise I'd prefer to stick with the current decentralized approach. BTW, Kevin, I'm confused about this line in your changelog: > - Add -lpthread option to environment (else configure set it to -pthread) -pthread is the correct option, and it implies -lpthread. -pthread ensures that the C runtime library uses thread-safe functions (e.g. errno becomes thread-local) whereas -lpthread merely links against libpthread.so. Why did you change this? On Tue, Aug 18, 2009 at 4:24 PM, Kevin Deldycke wrote: > On Wed, Aug 19, 2009 at 01:18, Kev wrote: > > And tonight I've managed to upgrade it, so you can find a RPM of > > Protocol Buffers 2.2.0 for Mandriva 2009.1 in my repository: > > http://kev.coolcavemen.com/static/repository/mandriva/2009.1/x86_64/ > > Oh, and FYI, please find attached my spec file. If you find strange or > bad things in it, please tell me, I'm far from being proficient in > C++... :] > > -- > Kevin Deldycke > • blog: http://kevin.deldycke.com > • band: http://coolcavemen.com > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: RPM Spec File
On Wed, Aug 19, 2009 at 01:18, Kev wrote: > And tonight I've managed to upgrade it, so you can find a RPM of > Protocol Buffers 2.2.0 for Mandriva 2009.1 in my repository: > http://kev.coolcavemen.com/static/repository/mandriva/2009.1/x86_64/ Oh, and FYI, please find attached my spec file. If you find strange or bad things in it, please tell me, I'm far from being proficient in C++... :] -- Kevin Deldycke • blog: http://kevin.deldycke.com • band: http://coolcavemen.com --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- protobuf.spec Description: Binary data
Re: RPM Spec File
On 17 août, 08:43, Anthony Foiani wrote: > Fedora 11 repos have an RPM for version 2.0.1 (or so). You should be > able to track down the spec file by finding the appropriate SRPM. > E.g., > > http://download.fedora.redhat.com/pub/fedora/linux/development/source... +1 ! I've used this Fedora's RPM too to build a RPM for Mandriva 2009.1. And tonight I've managed to upgrade it, so you can find a RPM of Protocol Buffers 2.2.0 for Mandriva 2009.1 in my repository: http://kev.coolcavemen.com/static/repository/mandriva/2009.1/x86_64/ Feel free to share ! :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: RPM Spec File
Well, I decided to build a spec file anyway because having the libraries everywhere fits our distribution model a little better. It builds a package containing just the protobuf shared libraries and another containing protoc, the headers, the protoc libraries and static libraries, and the pkgconfig files. Kenton, if you think this is worthwhile to include in the distribution I can make a patch with a Makefile target for the RPM. --Pete On Mon, Aug 17, 2009 at 5:47 PM, Peter Keen wrote: > That's a good point. I'm only going to be distributing a few binaries > that have to link against libprotobuf so that's probably a better > idea. > > Thanks, > Pete > > On Mon, Aug 17, 2009 at 1:13 PM, Kenton Varda wrote: >> FWIW, one way to make your life a lot easier might be to statically link >> against libprotobuf. That way you do not need to distribute anything, and >> you do not need to distribute a new package when you update to a new version >> of protocol buffers. This is the approach we take at Google -- we >> statically link everything except basic system libraries. >> >> On Wed, Aug 5, 2009 at 3:05 PM, Peter Keen wrote: >>> >>> Hi guys, >>> >>> I was wondering if anyone out there had built an RPM spec file for >>> protobuf. I'll be needing to distribute the C++ runtime library to a >>> set of machines and I'd like to be able to chuck something in a shared >>> yum repo and be done with it, rather than having to copy around a >>> tarball or something. >>> >>> Thanks, >>> Pete >>> >>> >> >> > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- protobuf.spec Description: Binary data
Re: RPM Spec File
That's a good point. I'm only going to be distributing a few binaries that have to link against libprotobuf so that's probably a better idea. Thanks, Pete On Mon, Aug 17, 2009 at 1:13 PM, Kenton Varda wrote: > FWIW, one way to make your life a lot easier might be to statically link > against libprotobuf. That way you do not need to distribute anything, and > you do not need to distribute a new package when you update to a new version > of protocol buffers. This is the approach we take at Google -- we > statically link everything except basic system libraries. > > On Wed, Aug 5, 2009 at 3:05 PM, Peter Keen wrote: >> >> Hi guys, >> >> I was wondering if anyone out there had built an RPM spec file for >> protobuf. I'll be needing to distribute the C++ runtime library to a >> set of machines and I'd like to be able to chuck something in a shared >> yum repo and be done with it, rather than having to copy around a >> tarball or something. >> >> Thanks, >> Pete >> >> > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: RPM Spec File
FWIW, one way to make your life a lot easier might be to statically link against libprotobuf. That way you do not need to distribute anything, and you do not need to distribute a new package when you update to a new version of protocol buffers. This is the approach we take at Google -- we statically link everything except basic system libraries. On Wed, Aug 5, 2009 at 3:05 PM, Peter Keen wrote: > > Hi guys, > > I was wondering if anyone out there had built an RPM spec file for > protobuf. I'll be needing to distribute the C++ runtime library to a > set of machines and I'd like to be able to chuck something in a shared > yum repo and be done with it, rather than having to copy around a > tarball or something. > > Thanks, > Pete > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: RPM Spec File
Peter -- (Sorry for the late reply, but I'm just now getting into protobuf, so I'm going back and reading old posts...) Fedora 11 repos have an RPM for version 2.0.1 (or so). You should be able to track down the spec file by finding the appropriate SRPM. E.g., http://download.fedora.redhat.com/pub/fedora/linux/development/source/SRPMS/protobuf-2.0.2-8.fc11.src.rpm HTH, t. On Aug 5, 4:05 pm, Peter Keen wrote: > Hi guys, > > I was wondering if anyone out there had built an RPM spec file for > protobuf. I'll be needing to distribute the C++ runtime library to a > set of machines and I'd like to be able to chuck something in a shared > yum repo and be done with it, rather than having to copy around a > tarball or something. > > Thanks, > Pete --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
RPM Spec File
Hi guys, I was wondering if anyone out there had built an RPM spec file for protobuf. I'll be needing to distribute the C++ runtime library to a set of machines and I'd like to be able to chuck something in a shared yum repo and be done with it, rather than having to copy around a tarball or something. Thanks, Pete --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---