0

I am following openmpi install file.

Firstly, I am a normal user in this linux system. I do not have rights to access /usr/local . If I configure with:

./configure --prefix=/usr/local

make will complain about permission.

Therefore, I put the place to install in some other directory (let's call it directory 'A'), and then make install .

I got all the files in the bin and such. I got mpic++, mpicc, etc. in the bin folder and such, in the directory 'A'.

Now, the thing is when I need to compile other programs:

Compiling MPI Applications
==========================

MPI applications should be compiled using the Open MPI "wrapper"
compilers:

C programs:   mpicc your-code.c
C++ programs: mpiCC your-code.cc    or
              mpic++ your-code.cc   (for case-insensitive filesystems)

This is from the INSTALL file. The thing is bash complains that mpicc command is not found when I type in "mpicc".

OpenMPI is a dependency for the other programs I am trying to compile, and they invoke OpenMPI by using 'mpicc' command.

What can I do in this case?

Karl
  • 5,613
  • 13
  • 73
  • 107

2 Answers2

4

Your folder A needs to be on your PATH environment variable. In bash, you would do:

export PATH=/path/to/my/folder/A/bin:$PATH

which will let you just type mpicc. Alternatively, you can use the full path as your command:

/path/to/my/folder/A/bin/mpicc myFile.c
tpg2114
  • 14,112
  • 6
  • 42
  • 57
1

If you don't have write access to the default prefix file tree /usr/local/ you should ./configure with an explicit writable prefix, e.g.

./configure --prefix=$HOME/pub

of course, you could mkdir $HOME/pub then should add $HOME/pub/bin to your PATH

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • The `install` target in makefiles, created by `autoconf`'s `configure` script, usually creates the target directory if it doesn't exist. – Hristo Iliev Dec 17 '12 at 16:35