[移植"myslam"到zynq上的arm手记] 1 - 移植sophus库

1. 撸一个 toolchain.cmake

set( CMAKE_SYSTEM_NAME Linux )  
set( CMAKE_SYSTEM_PROCESSOR arm )  
set( CMAKE_C_COMPILER arm-linux-gnueabihf-gcc )  
set( CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++ )  
set( CMAKE_INSTALL_PREFIX /home/albireo/lib_arm/sophus) 

 2. cmake

source /media/albireo/backup/opt/Xilinx/SDK/2017.1/settings64.sh
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake -DCMAKE_INSTALL_PREFIX=/home/albireo/lib_arm/sophus ..

 3. make

报错

cc1plus: error: include location "/usr/include/eigen3" is unsafe for cross-compilation [-Werror=poison-system-directories]
...

/home/albireo/lib/ARM/Sophus/sophus/so2.cpp:32:26: error: lvalue required as left operand of assignment
   unit_complex_.real() = 1.;
                          ^~
/home/albireo/lib/ARM/Sophus/sophus/so2.cpp:33:26: error: lvalue required as left operand of assignment
   unit_complex_.imag() = 0.;
...

cc1plus: all warnings being treated as errors

 4. 神马?warnings being treated as errors?

修改CMakeLists.txt

16行:

ADD_DEFINITIONS("-Wall -Werror -Wno-unused-variable
                   -Wno-unused-but-set-variable -Wno-unknown-pragmas ")

去掉-Werror

5. 修改so2.cpp

SO2::SO2()
{
  unit_complex_= std::complex<double>(1,0);
  // unit_complex_.real() = 1.;
  // unit_complex_.imag() = 0.;
}

如上修改

伊克斯kiu死米?喵喵喵???这什么鬼语法???为啥之前编译能通过的我很好骑

6. make, make install

 

转载于:https://www.cnblogs.com/dreamingsheep/p/8621090.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值