Question

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?

Était-ce utile?

La solution

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!
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top