anna address:
https://github.com/ucbrise/anna
Installation step code:
1.Install Clang and libc++, run:
sudo apt-get update
sudo apt-get install -y build-essential autoconf automake libtool curl make g++ unzip pkg-config wget clang-3.9
The following error may occur during the command input: E: Unable to obtain the lock /var/lib/dpkg/lock-frontend-open (11: The resource is temporarily unavailable); Solution: Refer to the connection point here
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 1
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.9 1
sudo apt-get install -y libc++-dev libc++abi-dev libtbb-dev
2. Install cmake
wget https://cmake.org/files/v3.9/cmake-3.9.4-Linux-x86_64.tar.gz
tar xvzf cmake-3.9.4-Linux-x86_64.tar.gz
sudo mv cmake-3.9.4-Linux-x86_64 /usr/bin/cmake
export PATH=$PATH:/usr/bin/cmake/bin
rm cmake-3.9.4-Linux-x86_64.tar.gz
3.Install protobuf: after cloning the protobuf repo, run:
sudo apt-get install autoconf automake libtool curl make g++ unzip
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g'
make
make check
sudo make install
ldconfig
For installation problems here, please refer to here
4.Build KVS, run:
git clone https://github.com/ucbrise/anna.git
cd anna
bash scripts/build_release.sh
(This command will build a KVS that provides last-writer-win consistency. Lattice composition for other consistency levels can be found in kvs/include)
This problem occurred:
CMakeFiles/Makefile2:423: recipe for target 'kvs/CMakeFiles/kvs_server.dir/all' failed
make[1]: *** [kvs/CMakeFiles/kvs_server.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
The solution is as follows:
- open file vendor/tbb/CMakeLists.txt
- for the last two cmake 'set' cmd in this file, which are using fixed value 'linux_intel64_clang_cc4.8_libc2.19_kernel3.13.0_release'. This is what you got in your error msg, and also the reason why you got this error msg.
- change this value to be the same as your env. For example, I am using clang 5.4.0, libc 2.23, kernel 4.4.0 , so I changed this value to 'linux_intel64_clang_cc5.4.0_libc2.23_kernel4.4.0_release' .
Tips: If you can't make sure what this value in your env should be, you can just run 'scripts/build_release.sh' for once. Yeah, the build will fail, but then you can check the generated folder by the build process, which is 'build/vendor/tbb/src/tbb/build'. Under this folder, you will find a sub folder, its name is just the value you need.(在anna文件下有相关的配置属性)
After solving a problem, another problem appeared:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
kvs/CMakeFiles/kvs_server.dir/build.make:181: recipe for target 'kvs/kvs_server' failed
make[2]: *** [kvs/kvs_server] Error 1
CMakeFiles/Makefile2:423: recipe for target 'kvs/CMakeFiles/kvs_server.dir/all' failed
make[1]: *** [kvs/CMakeFiles/kvs_server.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
解决方法:重新安装protobuf,没有安装正确。
Run: bash scripts/build_release.sh
Tip: scripts/build_debug.sh: line 4: cmake: command not found
make: *** No target specified and makefile not found. stop.
The reason is that the environment variables are not configured.
Solution: You can use the temporary environment variable export PATH=$PATH:/usr/bin/cmake/bin
Or write environment variables into a file.
code show as below:
vim ~/.bashrc
Add environment variables
source ~/.bashrc
To be continued