博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
boost 1.39编译安装手记
阅读量:2437 次
发布时间:2019-05-10

本文共 2498 字,大约阅读时间需要 8 分钟。

Boost 1.39使用笔记

Boost大部分还是以code的形势提供给用户使用的,但是涉及的三个库ICU、EXPAT、MPI是分别在实现regex、graph和mpi的时候所依赖的。先介绍Linux环境下的编译过程。
Easy Build and Install
在官方的帮助手册里会给你写着这么一段安装的介绍:Easy Build and Install
Issue the following commands in the shell (don't type $; that represents the shell's prompt):
$ cd path/to/boost_1_39_0
$ ./bootstrap.sh --help
Select your configuration options and invoke ./bootstrap.sh again without the --help option. Unless you have write permission in your system's /usr/local/ directory, you'll probably want to at least use
$ ./bootstrap.sh --prefix=path/to/installation/prefix
to install somewhere else. Also, consider using the --show-libraries and --with-libraries= options to limit the long wait you'll experience if you build everything. Finally,
$ ./bjam install
will leave Boost binaries in the lib/ subdirectory of your installation prefix. You will also find a copy of the Boost headers in the include/ subdirectory of the installation prefix, so you can henceforth use that directory as an #include path in place of the Boost root directory.
看到了么,生成了一个bjam,你可以把这个bjam拷贝到boost的解压目录里。是相当简单的Easy Build and install。
更为完备的编译参数配置
显然这样的编译设置我们是不能满足的,如果你希望能够拥有一个功能完备boost库来使用的参数的话,你就需要做一下参数的调整。
在解压目录中存在tools/build/v2/user-config.jam文件,该文件是专门配置变异参数的用户定义的配置文件。我们的编译器用的是gcc然后就把using gcc ;参数打开,在最后增加一个参数using mpi ;。增加此参数是为了生成MPI模块使用的。
第三方类库的准备
mpic++的支持
由于要生成MPI模块这里要依赖OpenMPI,可以参考一下下边连接中的一段内容:(http://www.nabble.com/MPI-auto-detection-failed:-unknown-wrapper-compiler-mpic%2B%2B-td23090203.html)
First, you need to install the package "openmpi-devel". Do this as root:
  # yum install openmpi-devel
This should bring in a number of dependencies, including a package named
"mpi-selector". Once the installation has finished, done, use the MPI selector
tool to choose the MPI toolset you've just installed. You can get a list
of available MPI implementations using the command "mpi-selector". As an
example, here's how it looks on my 64-bit CentOS 5.3 system:
  # mpi-selector --list
  openmpi-1.2.7-gcc-i386
  openmpi-1.2.7-gcc-x86_64
Then, while still logged in as root, set the system-wide default by
  # mpi-selector --system openmpi-1.2.7-gcc-x86_64
Log out, then open a new terminal window (as your normal user) and try
  $ which mpic++
  /usr/lib64/openmpi/1.2.7-gcc/bin/mpic++
安装expat
yum install expat*
安装ICU
可编译安装也可以用yum安装
设置环境变量,编译安装
export ICU_PATH=/usr/include<icu_include_path>
export EXPAT_INCLUDE=/usr/include<expat_include_path>
export EXPAT_LIBPATH=/usr/lib<expat_lib_path>
./bjam install
至此,结束

转载地址:http://fpgmb.baihongyu.com/

你可能感兴趣的文章
Linux下硬盘分区的最佳方案 (转)
查看>>
足球战术之Builder篇 (转)
查看>>
什么是邮件转发(mail relay) (转)
查看>>
linux环境下的"蚂蚁"-wget使用简介 (转)
查看>>
给mm的一封信 (转)
查看>>
一些非常有用的JAVA常用方法,可以省力很多啊!! (转)
查看>>
足球战术->中场发动机之mediator篇 (转)
查看>>
MYSQL的操作类(修改后的新版本) (转)
查看>>
EJB 技术的数据库应用 (转)
查看>>
《Windows 程序设计》学习笔记(四) (转)
查看>>
C语言程序书写规范 (转)
查看>>
delphi中的时间操作技术(1) (转)
查看>>
delphi中的时间操作技术(2) (转)
查看>>
(译)win32asm教程-11 (转)
查看>>
关于字符串的几个有用函数 (转)
查看>>
CreateFileMapping的MSDN翻译和使用心得 (转)
查看>>
从另一个考虑来看代码的风格 (转)
查看>>
AMD建立新研究中心:看准Linux(转)
查看>>
Linux网络编程--原始套接字(转)
查看>>
自己做个迷你型linux(转)
查看>>