4

I'm trying to build Google Protocolbuffers and Kyotocabinet on a Blue Gene supercomputer, which is a PowerPC64 based machine, running Suse Linux, gcc 4.1.2.

When I compile my code, both Google Protocolbuffers and Kyotocabinet gave "skipping incompatible" error. Compile command line:

g++ -g -Xlinker -zmuldefs -I/some_path/include $sourceFile -o $fileName -L/some_path/lib -lkyotocabinet -lz -lstdc++ -lrt -lpthread -lm -lc -lprotobuf -lprotoc meta.pb.cc

Then I changed installation of them, by using ./configure --host=powerpc-bgp-linux, Google Protocolbuffers works this time, but Kyotocabinet still give that error as below:

/usr/bin/ld: skipping incompatible /some_path/lib/libkyotocabinet.so when searching for -lkyotocabinet
/usr/bin/ld: skipping incompatible /some_path/lib/libkyotocabinet.a when searching for -lkyotocabinet
/usr/bin/ld: cannot find -lkyotocabinet
collect2: ld returned 1 exit status

I checked config.status of them, Google Protocolbuffers has some thing like this

sys_lib_search_path_spec='/usr/lib/gcc/powerpc64-suse-linux/4.1.2 /usr/powerpc64-suse-linux/lib /usr/lib /lib'

Apparently it know how to find proper stuff to use. But Kyotocabinet doesn't have this kind of settings in config.status. Hope this tip will help.

Is there any solution so I can use Kyotocabinet on BlueGene? Or can I add some lines like mentioned above to tell Kyotocabinet where to find correct lib? Or could you recommend some fast key-value stores?

Tony
  • 453
  • 4
  • 7
  • 16

1 Answers1

2

Your problem is not in finding Kyotocabinet. Your problem is that the library you are pointing at: /some_path/lib/libkyotocabinet.so is built for incompatible architecture (most linkely ppc32).

Do file -L /some_path/lib/libkyotocabinet.so and see what it says. You must rebuilt it for the same architecture as what gcc produces by default.

Update: file says ELF 64-bit MSB shared object, 64-bit PowerPC. But does that match what your g++ outputs by default? What is the output from:

echo "int foo() { return 0; }" | g++ -xc++ - -c -o foo.o &&
file foo.o

I bet above will print 32-bit PowerPC, in which case you need to add -m64 to your command line.

Update 2:

Any idea for this problem??

You should not be so helpless. You understand that the problem is mis-matched libraries, so go and fix it.

  1. Decide whether you want the final binary to run in 32-bit or 64-bit mode
  2. Obtain or rebuild all the libraries your need in the bitness you desire
  3. Build the final binary
  4. Profit!
Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • It said libkyotocabinet.so: symbolic link to `libkyotocabinet.so.10.4.0'. any clue? – Tony Oct 26 '11 at 13:01
  • @Tony: if it is a symbolic link check again the file where it is pointing at (i.e. file libkyotocabinet.so.10.4.0). – flolo Oct 26 '11 at 13:26
  • libkyotocabinet.so.10.4.0: ELF 64-bit MSB shared object, 64-bit PowerPC or cisco 7500, version 1 (SYSV), not stripped. Seems like it did find correct architecture. – Tony Oct 26 '11 at 14:57
  • @Employed Russian: yes you were right. foo.o: ELF 32-bit MSB relocatable, PowerPC or cisco 4500, version 1 (SYSV). I add -m64 then Kyotocabinet works, I'm moving forward. But since then Google protocolbuffers stopped working and give "skipping incompatible". I checked the libprotobuf.so.6.0.0 with file, it was ELF 32-bit MSB shared object, PowerPC or cisco 4500, I tried give -m64 option to according to the configure help, when making it, gives error :/usr/bin/ld: skipping incompatible /usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../lib/libz.so when searching for -lz – Tony Oct 26 '11 at 20:46
  • Continued... /usr/bin/ld: skipping incompatible /usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../lib/libz.a when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/../lib/libz.so when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/../lib/libz.a when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../libz.so when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../libz.a when searching for -lz – Tony Oct 26 '11 at 20:47
  • @Employed Russian, thanks for your patience, finally I got Google protocol buffers and Kyotocabinet on the same version 64bit. The final binary too. Thank you very much! – Tony Oct 27 '11 at 21:54