zoukankan      html  css  js  c++  java
  • [移植"myslam"到zynq上的arm手记] 1

    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

  • 相关阅读:
    Redis 实现队列优先级
    Redis 实现安全队列
    快速理解linux流编辑器sed命令
    Varnish 简介
    手机访问本地服务器
    javascript类的类比详解-大白话版
    优秀前端工程师应该掌握的内容(转自:github)
    mongodb初步使用
    Markdown 语法速查表
    pace.js和NProgress.js两个加载进度插件的一点小总结
  • 原文地址:https://www.cnblogs.com/dreamingsheep/p/8621090.html
Copyright © 2011-2022 走看看