Build MPICH2 from source

风格不统一 提交于 2019-12-25 03:36:21

问题


As a follow-up of this question, I started building MPICH2 from source. I found this tutorial: Installing MPICH2 on a Single Machine and so far what I did is this:

./configure --disable-f77 --disable-fc --disable-fortran
[seems to be OK]
make; sudo make install
[long output with one warning]
libtool: warning: relinking 'lib/libmpicxx.la'
root@pythagoras:/home/gsamaras/mpich-3.1.4# mpich2version
bash: mpich2version: command not found

What am I doing wrong? Notice that I had first installed MPICH2 with apt-get and in order to remove it, I did:

apt-get remove --purge mpich2
apt-get autoremove // which might removed something that I need now

Tomorrow, I am going to try this: Getting And Building MPICH (which with first attempt failed to work in the autogen.sh part).


EDIT_1:

I couldn't get it to work, will try a combination of the two tutorials and report back. I did a configure and then the make from the other tutorial, failed too.


EDIT_2

This may shade some light about where it got installed (by following the first tutorial):

root@pythagoras:/home/gsamaras/mpich-3.1.4# which mpiexec
/usr/local/bin/mpiexec
root@pythagoras:/home/gsamaras/mpich-3.1.4# which mpirun
/usr/local/bin/mpirun

回答1:


You installed into /usr/local, which is an OK way to do things. The README instructions you followed suggests another way which will not require administrative privileges.

I like to install into /home/robl/soft/mpich-whatever , so I can have different compilers, versions, configurations, etc. such flexibility is probably overkill for you, but it's one strategy.

To your question:

root@pythagoras:/home/gsamaras/mpich-3.1.4# mpich2version
bash: mpich2version: command not found

First, the command is now mpichversion, not mpich2version -- it's possible you were following an old tutorial.

Second, your shell might not know about the newly installed binaries. hash -r (at least on bash and tcsh) will tell the shell "forget about what you think you know about my file system and look harder".




回答2:


I found this mpich-3.0.4-README, who seems to provided the solution.

Long story short, it says (it assumes you want to build 3.0.4 version, I did it with 3.1.4 (available here)):

tar xzf mpich-3.0.4.tar.gz
cd mpich-3.0.4

// you might want to disable fortran compiler (see the README I linked above)
./configure --prefix=/home/<USERNAME>/mpich-install 2>&1 | tee c.txt

make 2>&1 | tee m.txt

make install 2>&1 | tee mi.txt

PATH=/home/<USERNAME>/mpich-install/bin:$PATH ; export PATH

which mpicc
// should return something reasonable (with your directory)

mpiexec -n 2 ./examples/cpi

Now, the option with the machinefile does not work, because ssh needs a password, but that's another question.



来源:https://stackoverflow.com/questions/30666741/build-mpich2-from-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!