fusesource / rocksdbjni

A Java JNI driver to rocksdb
BSD 3-Clause "New" or "Revised" License
64 stars 17 forks source link

Problem with building platform specific jar #1

Open mateuszdyminski opened 10 years ago

mateuszdyminski commented 10 years ago

I made all previous steps, but I stacked on last one. Do you have any idea what's wrong?

Here is my maven output: [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for org.fusesource.rocksdbjni:rocksdbjni-linux64:jar:99-master-SNAPSHOT [WARNING] 'parent.relativePath' of POM org.fusesource.rocksdbjni:rocksdbjni-project:99-master-SNAPSHOT (/home/md/workspace/rocksDB/rocksdbjni/pom.xml) points at test:test instead of org.fusesource:fusesource-pom, please verify your project structure @ org.fusesource.rocksdbjni:rocksdbjni-project:99-master-SNAPSHOT, /home/md/workspace/rocksDB/rocksdbjni/pom.xml, line 36, column 11 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building rocksdbjni-linux64 99-master-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.3:clean (default-clean) @ rocksdbjni-linux64 --- [INFO] [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ rocksdbjni-linux64 --- [debug] execute contextualize [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /home/md/workspace/rocksDB/rocksdbjni/rocksdbjni-linux64/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ rocksdbjni-linux64 --- [INFO] No sources to compile [INFO] [INFO] --- maven-hawtjni-plugin:1.9:build (default) @ rocksdbjni-linux64 --- [INFO] Extracting /root/.m2/repository/org/fusesource/rocksdbjni/rocksdbjni/99-master-SNAPSHOT/rocksdbjni-99-master-SNAPSHOT-native-src.zip to /home/md/workspace/rocksDB/rocksdbjni/rocksdbjni-linux64/target/native-build-extracted [INFO] executing: /bin/sh -c ./configure --disable-ccache --prefix=/home/md/workspace/rocksDB/rocksdbjni/rocksdbjni-linux64/target/native-build/target --with-rocksdb=/home/md/workspace/rocksDB/rocksdb --with-snappy=/home/md/workspace/rocksDB/snappy-1.0.5 [INFO] executing: /bin/sh -c make install [INFO] CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/md/workspace/rocksDB/rocksdbjni/rocksdbjni-linux64/target/native-build/autotools/missing autoconf [INFO] /bin/bash ./config.status --recheck [INFO] running CONFIG_SHELL=/bin/bash /bin/bash ./configure --disable-ccache --prefix=/home/md/workspace/rocksDB/rocksdbjni/rocksdbjni-linux64/target/native-build/target --with-rocksdb=/home/md/workspace/rocksDB/rocksdb --with-snappy=/home/md/workspace/rocksDB/snappy-1.0.5 --no-create --no-recursion [INFO] configure: WARNING: unrecognized options: --disable-ccache [INFO] checking build system type... x86_64-unknown-linux-gnu [INFO] checking host system type... x86_64-unknown-linux-gnu [INFO] checking target system type... x86_64-unknown-linux-gnu [INFO] checking for g++... g++ [INFO] checking whether the C++ compiler works... yes [INFO] checking for C++ compiler default output file name... a.out [INFO] checking for suffix of executables... [INFO] checking whether we are cross compiling... no [INFO] checking for suffix of object files... o [INFO] checking whether we are using the GNU C++ compiler... yes [INFO] checking whether g++ accepts -g... yes [INFO] checking for a BSD-compatible install... /usr/bin/install -c [INFO] checking for gcc... gcc [INFO] checking whether we are using the GNU C compiler... yes [INFO] checking whether gcc accepts -g... yes [INFO] checking for gcc option to accept ISO C89... none needed [INFO] checking whether gcc understands -c and -o together... yes [INFO] checking for ar... ar [INFO] checking the archiver (ar) interface... ar [INFO] checking how to print strings... printf [INFO] checking for a sed that does not truncate output... /bin/sed [INFO] checking for grep that handles long lines and -e... /bin/grep [INFO] checking for egrep... /bin/grep -E [INFO] checking for fgrep... /bin/grep -F [INFO] checking for ld used by gcc... /usr/bin/ld [INFO] checking if the linker (/usr/bin/ld) is GNU ld... yes [INFO] checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B [INFO] checking the name lister (/usr/bin/nm -B) interface... BSD nm [INFO] checking whether ln -s works... yes [INFO] checking the maximum length of command line arguments... 3458764513820540925 [INFO] checking whether the shell understands some XSI constructs... yes [INFO] checking whether the shell understands "+="... yes [INFO] checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop [INFO] checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop [INFO] checking for /usr/bin/ld option to reload object files... -r [INFO] checking for objdump... objdump [INFO] checking how to recognize dependent libraries... pass_all [INFO] checking for dlltool... no [INFO] checking how to associate runtime and link libraries... printf %s\n [INFO] checking for archiver @FILE support... @ [INFO] checking for strip... strip [INFO] checking for ranlib... ranlib [INFO] checking for gawk... gawk [INFO] checking command to parse /usr/bin/nm -B output from gcc object... ok [INFO] checking for sysroot... no [INFO] checking for mt... mt [INFO] checking if mt is a manifest tool... no [INFO] checking how to run the C preprocessor... gcc -E [INFO] checking for ANSI C header files... yes [INFO] checking for sys/types.h... yes [INFO] checking for sys/stat.h... yes [INFO] checking for stdlib.h... yes [INFO] checking for string.h... yes [INFO] checking for memory.h... yes [INFO] checking for strings.h... yes [INFO] checking for inttypes.h... yes [INFO] checking for stdint.h... yes [INFO] checking for unistd.h... yes [INFO] checking for dlfcn.h... yes [INFO] checking for objdir... .libs [INFO] checking if gcc supports -fno-rtti -fno-exceptions... no [INFO] checking for gcc option to produce PIC... -fPIC -DPIC [INFO] checking if gcc PIC flag -fPIC -DPIC works... yes [INFO] checking if gcc static flag -static works... yes [INFO] checking if gcc supports -c -o file.o... yes [INFO] checking if gcc supports -c -o file.o... (cached) yes [INFO] checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes [INFO] checking whether -lc should be explicitly linked in... no [INFO] checking dynamic linker characteristics... GNU/Linux ld.so [INFO] checking how to hardcode library paths into programs... immediate [INFO] checking whether stripping libraries is possible... yes [INFO] checking if libtool supports shared libraries... yes [INFO] checking whether to build shared libraries... yes [INFO] checking whether to build static libraries... no [INFO] checking how to run the C++ preprocessor... g++ -E [INFO] checking for ld used by g++... /usr/bin/ld -m elf_x86_64 [INFO] checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes [INFO] checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes [INFO] checking for g++ option to produce PIC... -fPIC -DPIC [INFO] checking if g++ PIC flag -fPIC -DPIC works... yes [INFO] checking if g++ static flag -static works... yes [INFO] checking if g++ supports -c -o file.o... yes [INFO] checking if g++ supports -c -o file.o... (cached) yes [INFO] checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes [INFO] checking dynamic linker characteristics... (cached) GNU/Linux ld.so [INFO] checking how to hardcode library paths into programs... immediate [INFO] configure: JAVA_HOME was set, checking to see if it's a JDK we can use... [INFO] checking if '/opt/java/64/jdk1.7.0_40' is a JDK... yes [INFO] checking pthread.h usability... yes [INFO] checking pthread.h presence... yes [INFO] checking for pthread.h... yes [INFO] checking whether C++ compiler accepts "-std=c++0x"... yes [INFO] checking rocksdb/db.h usability... yes [INFO] checking rocksdb/db.h presence... no [INFO] configure: WARNING: rocksdb/db.h: accepted by the compiler, rejected by the preprocessor! [INFO] configure: WARNING: rocksdb/db.h: proceeding with the compiler's result [INFO] checking for rocksdb/db.h... yes [INFO] checking sys/errno.h usability... yes [INFO] checking sys/errno.h presence... yes [INFO] checking for sys/errno.h... yes [INFO] checking whether build environment is sane... yes [INFO] checking for a thread-safe mkdir -p... /bin/mkdir -p [INFO] checking whether make sets $(MAKE)... yes [INFO] checking whether make supports nested variables... yes [INFO] checking that generated files are newer than configure... done [INFO] configure: creating ./config.status [INFO] configure: WARNING: unrecognized options: --disable-ccache [INFO] INFO version 99-master-SNAPSHOT [INFO] Prefix.........: /home/md/workspace/rocksDB/rocksdbjni/rocksdbjni-linux64/target/native-build/target [INFO] C Compiler.....: gcc -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux [INFO] Linker.........: /usr/bin/ld -m elf_x86_64 -lrocksdb -L/home/md/workspace/rocksDB/rocksdb -lsnappy -L/home/md/workspace/rocksDB/snappy-1.0.5 -release 99-master-SNAPSHOT [INFO] [INFO] /bin/bash ./config.status [INFO] config.status: creating Makefile [INFO] config.status: creating src/config.h [INFO] config.status: src/config.h is unchanged [INFO] config.status: executing libtool commands [INFO] /bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -std=c++0x -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux -c -o src/rocksdbjni.lo src/rocksdbjni.cpp [INFO] libtool: compile: g++ -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -std=c++0x -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux -c src/rocksdbjni.cpp -fPIC -DPIC -o src/.libs/rocksdbjni.o [INFO] /bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -std=c++0x -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux -c -o src/rocksdbjni_stats.lo src/rocksdbjni_stats.cpp [INFO] libtool: compile: g++ -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -std=c++0x -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux -c src/rocksdbjni_stats.cpp -fPIC -DPIC -o src/.libs/rocksdbjni_stats.o [INFO] /bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -std=c++0x -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux -c -o src/rocksdbjni_structs.lo src/rocksdbjni_structs.cpp [INFO] libtool: compile: g++ -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -std=c++0x -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux -c src/rocksdbjni_structs.cpp -fPIC -DPIC -o src/.libs/rocksdbjni_structs.o [INFO] /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux -c -o src/buffer.lo src/buffer.c [INFO] libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux -c src/buffer.c -fPIC -DPIC -o src/.libs/buffer.o [INFO] /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux -c -o src/hawtjni.lo src/hawtjni.c [INFO] libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux -c src/hawtjni.c -fPIC -DPIC -o src/.libs/hawtjni.o [INFO] /bin/bash ./libtool --tag=CXX --mode=link g++ -g -O2 -I/home/md/workspace/rocksDB/rocksdb/include -std=c++0x -I/opt/java/64/jdk1.7.0_40/include -I/opt/java/64/jdk1.7.0_40/include/linux -lrocksdb -L/home/md/workspace/rocksDB/rocksdb -lsnappy -L/home/md/workspace/rocksDB/snappy-1.0.5 -release 99-master-SNAPSHOT -o librocksdbjni.la -rpath /home/md/workspace/rocksDB/rocksdbjni/rocksdbjni-linux64/target/native-build/target/lib src/rocksdbjni.lo src/rocksdbjni_stats.lo src/rocksdbjni_structs.lo src/buffer.lo src/hawtjni.lo
[INFO] libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.7/crtbeginS.o src/.libs/rocksdbjni.o src/.libs/rocksdbjni_stats.o src/.libs/rocksdbjni_structs.o src/.libs/buffer.o src/.libs/hawtjni.o -lrocksdb -L/home/md/workspace/rocksDB/rocksdb /home/md/workspace/rocksDB/snappy-1.0.5/.libs/libsnappy.a -L/home/md/workspace/rocksDB/snappy-1.0.5 -L/usr/lib/gcc/x86_64-linux-gnu/4.7 -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/4.7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crtn.o -O2 -Wl,-soname -Wl,librocksdbjni-99-master-SNAPSHOT.so -o .libs/librocksdbjni-99-master-SNAPSHOT.so [INFO] /usr/bin/ld: /home/md/workspace/rocksDB/rocksdb/librocksdb.a(db_impl.o): relocation R_X86_64_32S against `_ZTVN7rocksdb2DBE' can not be used when making a shared object; recompile with -fPIC [INFO] /home/md/workspace/rocksDB/rocksdb/librocksdb.a: could not read symbols: Bad value [INFO] collect2: error: ld returned 1 exit status [INFO] make: *\ [librocksdbjni.la] Error 1 [INFO] rc: 2 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 14.684s [INFO] Finished at: Sun Dec 15 21:32:10 CET 2013 [INFO] Final Memory: 9M/213M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.fusesource.hawtjni:maven-hawtjni-plugin:1.9:build (default) on project rocksdbjni-linux64: build failed: org.apache.maven.plugin.MojoExecutionException: make based build failed with exit code: 2 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

rxiadiya commented 10 years ago

I used the following and rebuild rocksDB library . then it worked after it export CC=”gcc -fPIC” export CXX=”g++ -fPIC”