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?

2 Answers 2

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
Sign up to request clarification or add additional context in comments.

Comments

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

1 Comment

The install target in makefiles, created by autoconf's configure script, usually creates the target directory if it doesn't exist.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.