Boost 的编译(交叉)安装 & cmake find_package(Boost)
来源:互联网 发布:学校预算编制软件 编辑:程序博客网 时间:2024/06/04 20:09
- 下载 boost 1.59的源码,执行:
bootstrap.sh
编辑文件 project-config.jam,用 “using gcc : arm : arm-linux-gnueabihf-g++-4.8” 替换 “using gcc”, 行尾的分号前有个空格!
执行编译安装:
./bjam install toolset=gcc-arm --prefix=/path/to/install --disable-sNO_ZLIB=1 -sNO_BZIP2=1 --without-python如果需要编译 Boost.Coroutine 和 Boost.Context (For Arm):./bjam install toolset=gcc-arm architecture=arm address-model=32 abi=aapcs binary-format=elf --disable-sNO_ZLIB=1 -sNO_BZIP2=1 --without-python --prefix=/home/i5/boost-1.59.0或者,修改project-config.jam后, 对4核cpu ( b2 比 bjam 新一点):./b2 install toolset=gcc-arm --prefix=/path/to/install --disable-sNO_ZLIB=1 -sNO_BZIP2=1 --without-python -j 4
如果只需要编译某几个特定的库:
cd boost./bootstrap.sh --with-libraries=coroutine,context,thread,system./b2 -j4// where `-j4 specifies a parallel build using 4 jobs. // You may want to increase or decrease the number of parallel jobs, // depending on the number of cores available on your system. // If you prefer to build all Boost libraries, then leave out the --with-libraries option.
若使用cmake编译项目,编辑 FindBoost.cmake 文件
vi /usr/share/cmake-2.8/Modules/FindBoost.cmake
在前面添加:
SET(Boost_ADDITIONAL_VERSIONS "1.59" "1.59.0")SET(BOOST_ROOT "/path/to/boost1.59.0")
这样 find_package 就可以找到新的boost库了。
或者直接在项目中添加,例如:
SET(Boost_ADDITIONAL_VERSIONS "1.59" "1.59.0")SET(BOOST_ROOT "/usr/local/boost1.59.0")# optionset(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) find_package(Boost 1.59.0 COMPONENTS filesystem regex REQUIRED) # 最好是加上REQUIRED,否则找不到某些库也不会报错,链接会出问题if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) add_executable(progname file1.cxx file2.cxx) target_link_libraries(progname ${Boost_LIBRARIES})endif()
0 0
- Boost 的编译(交叉)安装 & cmake find_package(Boost)
- 交叉编译boost
- boost arm 交叉编译
- boost交叉编译
- boost库交叉编译
- 交叉编译boost库
- boost交叉编译
- boost 的安装和编译
- Boost库的编译安装
- boost 交叉编译(arm)
- boost交叉编译之iOS
- 交叉编译部分boost库
- 交叉编译boost和opencv
- mac 安装 cmake boost kenlm
- Boost-Boost库的编译
- boost的编译安装 以及boost regex的使用
- 在ubuntu上编译boost,boost的安装目录设置
- CMake的交叉编译
- form 转json最佳示例
- frameset替代控件
- mpich
- JS修改元素样式
- .getcClass .forName .calss 详解
- Boost 的编译(交叉)安装 & cmake find_package(Boost)
- 求树的直径(最长路径)
- 路灯修改是否加载boot的修改小纪
- 二叉树(java实现)
- 获取android签名相关信息
- mysql linux 定时备份
- js jquery 改变css样式
- webview和js 交互
- 从2-3-4树谈到Red-Black Tree(红黑树)