Last active
August 7, 2019 08:17
-
-
Save liusheng/c0630d3e6fcedc2225db9c6d21d941a3 to your computer and use it in GitHub Desktop.
leveldbjni issue on ARM64 server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Building leveldb | |
wget http://repository.timesys.com/buildsources/s/snappy/snappy-1.0.5/snappy-1.0.5.tar.gz | |
tar -xvf snappy-1.0.5.tar.gz -C /opt/ | |
git clone http://github.com/huangtianhua/leveldbjni /opt/leveldbjni | |
git clone http://github.com/huangtianhua/leveldb /opt/leveldb | |
export SNAPPY_HOME=/opt/snappy-1.0.5 | |
export LEVELDBJNI_HOME=/opt/leveldbjni | |
export LEVELDB_HOME=/opt/leveldb | |
cd ${SNAPPY_HOME} | |
# get the latest config.guess and config.sub | |
wget -O config.guess "git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" | |
wget -O config.sub "git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" | |
./configure --disable-shared --with-pic | |
make | |
cd ${LEVELDB_HOME} | |
export LIBRARY_PATH=${SNAPPY_HOME} | |
export C_INCLUDE_PATH=${LIBRARY_PATH} | |
export CPLUS_INCLUDE_PATH=${LIBRARY_PATH} | |
git apply ../leveldbjni/leveldb_aarch64.patch | |
make libleveldb.a | |
# fix the problem: 'aclocal-1.14' is missing on your system | |
cd ../ | |
sudo apt-get install autoconf -y | |
wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz | |
tar -zxvf automake-1.14.tar.gz | |
cd automake-1.14 | |
./bootstrap.sh | |
./configure | |
sudo make | |
sudo make install | |
cd ${LEVELDBJNI_HOME} | |
# fix error: configure.ac:36: error: required file 'autotools/compile' not found | |
mkdir -p ${LEVELDBJNI_HOME}/leveldbjni-linux64-aarch64/target/native-build/autotools/ | |
cp /usr/local/share/automake-1.14/compile ${LEVELDBJNI_HOME}/leveldbjni-linux64-aarch64/target/native-build/autotools/ | |
# build leveldbjni-linux64-aarch64 | |
mvn install -P download -P linux64-aarch64 | |
# build leveldbjni-all | |
mvn install -P download -P all | |
cd '{{ ansible_user_dir }}/{{ zuul.project.src_dir }}' | |
mvn install:install-file -DgroupId=org.fusesource.leveldbjni -DartifactId=leveldbjni-all -Dversion=1.8 -Dpackaging=jar -Dfile=/opt/leveldbjni/leveldbjni-all/target/leveldbjni-all-99-master-SNAPSHOT.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment