MPI compile 设置 centos 7

需要使用openmpi的mpi.h文件才能成功compile,因此要安装openmpi:

sudo yum install openmpi-devel

简易方式

sudo yum install environment-modules
source /etc/profile.d/modules.sh
module add openmpi-x86_64

加入path

export PATH=$PATH:/usr/lib/openmpi/bin

将possum下makefile中加一行

CXX=mpicxx

若报错mpicc: error while loading shared libraries: libopen-pal.so.0: cannot open shared object file: No such file or directory

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64/openmpi/1.3.2-gcc/lib/

If you have not taken a precompiled version, you will require:

GNU make
GNU install
GCC C/C++ compiler (versions gcc-4.0, 4.1, 4.2 and 4.4 are known to work in general although 4.2 upwards is recommended).
Header files for:
    expat
    libX11
    libGL
    zlib 

On Centos/RHEL you would install these with the command (assuming your account has sudo rights):

    sudo yum install expat-devel libX11-devel mesa-libGL-devel zlib-devel

Make a folder to build the source code in, for example ~/fslbuild
Put the tar file into your build location, and unpack the sources :

    cd ~/fslbuild
    tar zxf fsl-5.0.0-sources.tar.gz

Set the main FSL environment variables (for version 5.0.6 and above you first need to uncomment the lines related to FSLCONFDIR and FSLMACHTYPE in $FSLDIR/etc/fslconf/fsl.sh):

export FSLDIR=`pwd`/fsl
. ${FSLDIR}/etc/fslconf/fsl.sh

Then check if your machine/compiler is supported by default:

ls $FSLDIR/config/$FSLMACHTYPE

If the above directory does not exist (the ls returns an error):

Select the closest match from the directories in $FSLDIR/config and do the following:

cp -r $FSLDIR/config/closestmatch $FSLDIR/config/$FSLMACHTYPE

Depending on how different your machine and compiler are from the closest match, you may need to edit the files inside the FSLDIR/config/ FSLMACHTYPE directory which set the local paths and variables for things like install commands, compiler flags, etc.

If you wish to use your vendor supplied TCL/TK (or other third-party libraries, eg libpng) then edit the file FSLDIR/config/ FSLMACHTYPE/externallibs.mk to point at the header files for these libraries.

Once this test is done then the sources can be built with:

cd $FSLDIR
./build

If you want to re-make a particular package in $FSLDIR/src (e.g. flirt) then first set the FSLDEVDIR environment variable to the same as FSLDIR and then just type:

make install

全部设置完,要使用以下方式运行

mpirun -np 3 ./possum
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值