0

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
Community
  • 1
  • 1
gsamaras
  • 71,951
  • 46
  • 188
  • 305
  • is `/usr/local/bin` in your `PATH`? By default configure doesn't install to /usr. check where it actually installed. – casey Jun 06 '15 at 04:10
  • @casey I am in a computer with many users (a lab computer). However, I knwo the sudo password. I do not know where it got installed (how can I find out?). I saw that when I did the make, ` mkdir -p '/usr/local/include' /usr/bin/install -c -m 644 src/binding/cxx/mpicxx.h src/include/mpi.h '/usr/local/include' mkdir -p '/usr/local/lib/pkgconfig' /usr/bin/install -c -m 644 src/packaging/pkgconfig/mpich.pc '/usr/local/lib/pkgconfig' ` By the way, nice top answer. If you happen to be a real pilot, then you have all my respect. My edit will help! – gsamaras Jun 06 '15 at 13:59
  • Note that the 2nd tutorial states: "Obviously, substitute INSTALLATION_PREFIX above with a proper directory. Otherwise /usr will be assumed as a default." – gsamaras Jun 06 '15 at 14:09
  • @casey I have made a new relevant question here, please check: http://stackoverflow.com/questions/30686260/mpiexec-changes-installed-directory?lq=1 – gsamaras Jun 07 '15 at 19:50

2 Answers2

2

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".

Wesley Bland
  • 8,816
  • 3
  • 44
  • 59
Rob Latham
  • 5,085
  • 3
  • 27
  • 44
0

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.

gsamaras
  • 71,951
  • 46
  • 188
  • 305