【问题标题】:How to compile with boost library on cluster?如何在集群上使用 boost 库进行编译?
【发布时间】:2013-04-25 10:10:05
【问题描述】:

我正在尝试使用集群上的 boost 库编译我的程序。但我不知道如何链接集群上的库。

我使用以下命令在我的 Mac 上本地编译我的程序:

mpic++ -o local ods_v2.4.cpp -L/opt/local/lib/  -lboost_iostreams-mt -lz -I/opt/local/include

这是我集群上 boost 的信息:

-bash-4.1$ module avail boost

---------------------------------------------------------------- /opt/modules/modulefiles -----------------------------------------------------------------
boost/1.49.0_intel-12.0.084   boost/1.49.0_intel-13.0.1.117
-bash-4.1$ module show boost
-------------------------------------------------------------------
/opt/modules/modulefiles/boost/1.49.0_intel-13.0.1.117:

module-whatis    access boost ver. 1.49.0 header files and libraries 
module       load python/2.7.3_intel-13.0.1.117 
setenv       BOOST_HOME /apps/rhel6/boost/1.49.0_intel-13.0.1.117 
setenv       BOOST_ROOT /apps/rhel6/boost/1.49.0_intel-13.0.1.117 
setenv       BOOST_INCLUDE -I/apps/rhel6/boost/1.49.0_intel-13.0.1.117/include 
setenv       LINK_BOOST -L/apps/rhel6/boost/1.49.0_intel-13.0.1.117/lib -Xlinker -rpath -Xlinker /apps/rhel6/boost/1.49.0_intel-13.0.1.117/lib 
prepend-path     LD_LIBRARY_PATH /apps/rhel6/boost/1.49.0_intel-13.0.1.117/lib 
-------------------------------------------------------------------

-bash-4.1$ 

我想知道我应该使用什么命令行? 我正在尝试这个,但它不起作用:

-bash-4.1$ mpiCC -o cluster ods_v2.4.cpp  $LINK_BOOST $BOOST_INCLUDE -lz

【问题讨论】:

    标签: boost compilation static-libraries


    【解决方案1】:

    解决了

    -bash-4.1$ mpiCC -o cluster ods_v2.4.cpp  $LINK_BOOST -lboost_iostreams -lz $BOOST_INCLUDE
    

    我忘了-lbookst-XXXX

    谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-07-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-18
      • 1970-01-01
      相关资源
      最近更新 更多