[Rprotobuf-yada] alternative to pkg-config

Dirk Eddelbuettel edd at debian.org
Wed Apr 7 15:28:57 CEST 2010


On 7 April 2010 at 14:30, Romain Francois wrote:
| Hi,
| 
| It looks like I don't have pkg-config on OSX, so I see:
| 
| checking for pkg-config... no

Uh-oh. 

I just noticed yesterday that Uwe et al's fftw package also uses pkg-config.

That is news to me. So we can not assume pkg-config. Sucky.

| ./configure: line 3527: pkg-config: command not found
| ./configure: line 3528: pkg-config: command not found
| ...
| checking google/protobuf/stubs/common.h usability... yes
| checking google/protobuf/stubs/common.h presence... yes
| checking for google/protobuf/stubs/common.h... yes
| checking google/protobuf/compiler/code_generator.h usability... yes
| checking google/protobuf/compiler/code_generator.h presence... yes
| checking for google/protobuf/compiler/code_generator.h... yes

Did you just get lucky ie did you install protobuf in a common location?

| but then :
| 
| g++-4.2 -arch x86_64 -o RProtoBuf.dylib addressbook.pb.o 
| ConnectionCopyingInputStream.o ConnectionCopyingOutputStream.o 
| ConnectionInputStream.o ConnectionOutputStream.o DescriptorPoolLookup.o 
| EnumDescriptor_wrapper.o FieldDescriptor_wrapper.o RSourceTree.o 
| RWarningErrorCollector.o RconnectionCopyingInputStream.o 
| ServiceDescriptor_wrapper.o SocketCopyingInputStream.o 
| ZeroCopyInputStreamWrapper.o ZeroCopyOutputStreamWrapper.o add.o 
| add_person_R.o as.o ascharacter.o aslist.o clear.o clear_person_R.o 
| clone.o completion.o constructors.o containing_type.o exceptions.o 
| extractors.o field_count.o fileDescriptor.o has.o identical.o 
| initialized.o length.o list_people_R.o lookup.o merge.o methods.o 
| mutators.o name.o read.o rpc_over_http.o rprotobuf.o serialize.o set.o 
| size.o streams.o swap.o update.o -dynamiclib 
| -Wl,-headerpad_max_install_names  -undefined dynamic_lookup 
| -single_module -multiply_defined suppress 
| /Library/Frameworks/R.framework/Resources/library/Rcpp/lib/x86_64/libRcpp.a
| g++-4.2 -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names 
| -undefined dynamic_lookup -single_module -multiply_defined suppress 
| -L/usr/local/lib -o RProtoBuf.so ConnectionCopyingInputStream.o 
| ConnectionCopyingOutputStream.o ConnectionInputStream.o 
| ConnectionOutputStream.o DescriptorPoolLookup.o EnumDescriptor_wrapper.o 
| FieldDescriptor_wrapper.o RSourceTree.o RWarningErrorCollector.o 
| RconnectionCopyingInputStream.o ServiceDescriptor_wrapper.o 
| SocketCopyingInputStream.o ZeroCopyInputStreamWrapper.o 
| ZeroCopyOutputStreamWrapper.o add.o add_person_R.o as.o ascharacter.o 
| aslist.o clear.o clear_person_R.o clone.o completion.o constructors.o 
| containing_type.o exceptions.o extractors.o field_count.o 
| fileDescriptor.o has.o identical.o initialized.o length.o 
| list_people_R.o lookup.o merge.o methods.o mutators.o name.o read.o 
| rpc_over_http.o rprotobuf.o serialize.o set.o size.o streams.o swap.o 
| update.o 
| /Library/Frameworks/R.framework/Resources/library/Rcpp/lib/x86_64/libRcpp.a 
| -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework 
| -Wl,CoreFoundation
| installing to 
| /Library/Frameworks/R.framework/Resources/library/RProtoBuf/libs/x86_64
| 
| ** R
| ** demo
| ** inst
| ** preparing package for lazy loading
| ** help
| *** installing help indices
| ** building package indices ...
| ** testing if installed package can be loaded
| Error in dyn.load(file, DLLpath = DLLpath, ...) :
|    impossible de charger la bibliothèque partagée 
| '/Library/Frameworks/R.framework/Resources/library/RProtoBuf/libs/x86_64/RProtoBuf.so':
|  
| dlopen(/Library/Frameworks/R.framework/Resources/library/RProtoBuf/libs/x86_64/RProtoBuf.so, 
| 6): Symbol not found: 
| __ZN6google8protobuf15FieldDescriptor17kTypeToCppTypeMapE
|    Referenced from: 
| /Library/Frameworks/R.framework/Resources/library/RProtoBuf/libs/x86_64/RProtoBuf.so
|    Expected in: flat namespace
|   in 
| /Library/Frameworks/R.framework/Resources/library/RProtoBuf/libs/x86_64/RProtoBuf.so
| ERREUR : loading failed
| * removing ‘/Library/Frameworks/R.framework/Resources/library/RProtoBuf’
| 
| 
| It seems I can install pkg-config from fink, but maybe some other would 
| not, can we do it without pkg-config ?
| 
| (.... installing pkg-config through fink.)

I have no idea. OS X is all yours. Maybe you could ask on the protobuf list
how they expect to be tested for on OS X?
 
| Now I get a different error:
| 
| ** testing if installed package can be loaded
| Error in dyn.load(file, DLLpath = DLLpath, ...) :
|    impossible de charger la bibliothèque partagée 
| '/Library/Frameworks/R.framework/Resources/library/RProtoBuf/libs/x86_64/RProtoBuf.so':
|  
| dlopen(/Library/Frameworks/R.framework/Resources/library/RProtoBuf/libs/x86_64/RProtoBuf.so, 
| 6): Symbol not found: __ZN8tutorial18Person_PhoneNumber16_default_number_E
|    Referenced from: 
| /Library/Frameworks/R.framework/Resources/library/RProtoBuf/libs/x86_64/RProtoBuf.so
|    Expected in: flat namespace
|   in 
| /Library/Frameworks/R.framework/Resources/library/RProtoBuf/libs/x86_64/RProtoBuf.so
| ERREUR : loading failed
| * removing ‘/Library/Frameworks/R.framework/Resources/library/RProtoBuf’
| 
| Using protobuf 2.3.0 freshly compiled and "make check" happy.

Ack.

On 7 April 2010 at 14:52, Romain Francois wrote:
| Le 07/04/10 14:30, Romain Francois a écrit :
[...]
| 
| Right. Something to do with the file generated by protoc.
| 
| If I remove the addressbook.cc, and all the files that use it 
| (clear_person, ...) it works fine.

Can you explain that in a tad more detail? I haven't looked at Proto in a
while. What happens now, what does it break, what do you suggest.

| Is there any point about keeping these around, thy are sort of an 
| outlier compared to the rest of the code. It would also simplify the 
| Makevars to these two lines:
| 
| PKG_CPPFLAGS=		@PKG_CPPFLAGS@
| PKG_LIBS=		@PKG_LIBS@
| 
| which might facilitates porting the package to windows, etc ...

Again, I am not yet on the same page but maybe this is not an urgent matter.

Dirk


-- 
  Registration is open for the 2nd International conference R / Finance 2010
  See http://www.RinFinance.com for details, and see you in Chicago in April!


More information about the Rprotobuf-yada mailing list