歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> MPI compile 設置 centos 7

MPI compile 設置 centos 7

日期:2017/3/3 12:25:19   编辑:Linux技術

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

[code]sudo yum install openmpi-devel
簡易方式

[code]sudo yum install environment-modules
source /etc/profile.d/modules.sh
module add openmpi-x86_64
加入path

[code]export PATH=$PATH:/usr/lib/openmpi/bin
將possum下makefile中加一行

[code]CXX=mpicxx
若報錯
mpicc: error while loading shared libraries: libopen-pal.so.0: cannot open shared object file: No such file or directory

[code]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:

[code]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):

[code]    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 :

[code]    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):

[code]export FSLDIR=`pwd`/fsl
. ${FSLDIR}/etc/fslconf/fsl.sh
Then check if your machine/compiler is supported by default:

[code]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:

[code]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/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/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:

[code]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:

[code]make install
全部設置完,要使用以下方式運行

[code]mpirun -np 3 ./possum

Copyright © Linux教程網 All Rights Reserved