LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mpicc command not found with openmpi (https://www.linuxquestions.org/questions/linux-software-2/mpicc-command-not-found-with-openmpi-910351/)

Aqua_Regia 10-26-2011 06:28 PM

mpicc command not found with openmpi
 
I installed openmpi.i686 using yum, but I can't use the 'mpicc' complier/wrapper.

Code:

[wcucluster.master@wcucluster ~]$ mpicc
bash: mpicc: command not found...

I've looked on their website but haven't found any useful information. Does this require some special configuration that yum doesn't do. What am I missing?

knudfl 10-26-2011 06:44 PM

'mpicc' is in the package 'openmpi-devel'.


You can list the installed files from a package with :
rpm -ql openmpi


'openmpi-devel' will provide /usr/lib/openmpi/1.4-gcc/bin/mpicc
... and 250 other files.

.

Aqua_Regia 10-26-2011 06:57 PM

Should I uninstall the openmpi package I installed with yum to avoid problems with the two packages or do I need both?

Aqua_Regia 10-26-2011 07:14 PM

Thanks for the help! I installed it using yum
Code:

yum install openmpi-devel.i686
had to search to find it.

Aqua_Regia 10-26-2011 07:29 PM

Ok I installed the package and found the directory but I can't get mpicc to run.

Code:

[wcucluster.master@wcucluster ~]$ cd /usr/lib/openmpi/bin
[wcucluster.master@wcucluster bin]$ ls
mpic++    mpiCC-vt  mpiexec    mpif90-vt  ompi-iof      ompi-server  orte-bootproxy.sh  orte-clean  orterun              otfconfig  otfprofile  vtCC  vtfilter
mpicc    mpic++-vt  mpif77    mpirun      ompi-probe    ompi-top      ortec++            orted      orte-top            otfdump    otfshrink  vtcxx  vtunify
mpiCC    mpicxx    mpif77-vt  ompi-clean  ompi-profiler  opal_wrapper  ortecc            orte-iof    orte_wrapper_script  otfinfo    vtc++      vtf77  vtunify-mpi
mpicc-vt  mpicxx-vt  mpif90    ompi_info  ompi-ps        opari        orteCC            orte-ps    otfaux              otfmerge  vtcc        vtf90  vtwrapper
[wcucluster.master@wcucluster bin]$ mpicc
mpicc: Command not found.
[wcucluster.master@wcucluster bin]$ mpicc -pc
mpicc: Command not found.
[wcucluster.master@wcucluster bin]$


knudfl 10-26-2011 07:40 PM

Both packages are required.

Using mpicc: export PATH=/usr/lib/openmpi/bin/ && mpicc <etc. etc.>

EDIT : Should be : export PATH=$PATH:/usr/lib/openmpi/bin
See post # 9.

.

Aqua_Regia 10-26-2011 07:52 PM

Thanks for the help! I found it on yum
Code:

yum install openmpi-devel.i686

Aqua_Regia 10-26-2011 10:10 PM

I tried issuing the command you posted to run mpicc and I recieved this error.

Code:

[wcucluster.master@wcucluster ~]$ bash
[wcucluster.master@wcucluster ~]$ export PATH=/usr/lib/openmpi/bin/ && mpicc
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
gcc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------


Nylex 10-27-2011 01:02 AM

That export statement wipes out your previous value of PATH. What you want is to add the OpenMPI directory to the list of directories that's already there. So, it should be

Code:

export PATH=$PATH:/usr/lib/openmpi/bin

Aqua_Regia 10-27-2011 08:23 AM

The command worked as far as I can tell, but when I went to run mpicc I received an error about gcc input files.


Code:

[wcucluster.master@wcucluster bin]$ bash
[wcucluster.master@wcucluster bin]$ export PATH=$PATH:/usr/lib/openmpi/bin
[wcucluster.master@wcucluster bin]$ mpicc
gcc: fatal error: no input files
compilation terminated.


Nylex 10-27-2011 08:25 AM

Of course, you need to tell the compiler which files it should compile! Edit: Obviously, if you have a makefile for the software, you'll want to change the relevant line so that it calls mpicc (rather than gcc). Then, you can just run make as usual.

Aqua_Regia 10-27-2011 10:39 AM

Ok. Now I feel like a noob and I believe I screwed something up with mpicc which was working before because I could run

Code:

[wcucluster.master@wcucluster ~]$  mpicc --help
/home/wcucluster.master/override/mpicc: line 2: /lib/openmpi/bin/mpicc: No such file or directory
[wcucluster.master@wcucluster ~]$

and info about mpicc would be displayed. I was trying to implement this guys work around on the nwchem forum so I could compile nwchem-6.0 with mpicc instead of gcc. Here is the thread.

http://www.nwchem-sw.org/index.php/S..._compi....html

I added this: PATH=/home/wcucluster.master/override:$PATH to the .bashrc file which linked to a script in that directory called mpicc with the commands.
Code:

[wcucluster.master@wcucluster override]$ cat mpicc
#!/bin/bash
/lib/openmpi/bin/mpicc -pc $@

Any Idea what I did wrong? (I'm a windows junkie I need undo buttons!)

Nylex 10-28-2011 09:27 AM

Aren't you missing "/usr" at the beginning of the line?


All times are GMT -5. The time now is 12:19 AM.