anna的安装与安装过程遇到的问题

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

解决方法如下:

  1. open file vendor/tbb/CMakeLists.txt
  2. 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.
  3. 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

未完待续

 

 

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值