概述
anna地址:
https://github.com/ucbrise/anna
安装步骤代码:
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
输入命令过程中可能会出现以下错误:E: 无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时不可用);解决方法:参考连接 点这里
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.安装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
这里的安装问题可参考这里
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)
出现了这个问题:
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
解决方法如下:
- 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文件下有相关的配置属性)
解决掉一个问题,又出现了一个问题:
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,没有安装正确。
运行:bash scripts/build_release.sh
提示:scripts/build_debug.sh: 行 4: cmake: 未找到命令
make: *** 没有指明目标并且找不到 makefile。 停止。
这个原因是环境变量没有配置。
解决方法:可以使用临时环境变量export PATH=$PATH:/usr/bin/cmake/bin
或者将环境变量写入文件中。
代码如下:
vim ~/.bashrc
添加环境变量
source ~/.bashrc
未完待续
最后
以上就是虚幻长颈鹿为你收集整理的anna的安装与安装过程遇到的问题的全部内容,希望文章能够帮你解决anna的安装与安装过程遇到的问题所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复