mpicc: command not found

Hi,

when I start a shell this message is displayed “mpicc: command not found”.

How can I fix it ?

Hi,

Most likely you have an alias or function that is calling that command

mpicc

For single user it can be in your “$HOME” in the file

~/.bashrc

Assuming your log in shell is bash.
or

~/.alias

Or it can be somewhere in

/etc

If using bash

/etc/bash.bashrc.local

Did you add/edit something in your dotfiles?

A package can do that but it is highly unlikely but hey the world is full of surprised :slight_smile:

I have tried to follow your suggestion unfortunately without a result:

linux:/home/studio # alias
alias +='pushd .'
alias -='popd'
alias ..='cd ..'
alias ...='cd ../..'
alias beep='echo -en "\007"'
alias cd..='cd ..'
alias dir='ls -l'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l='ls -alF'
alias la='ls -la'
alias ll='ls -l'
alias ls='_ls'
alias ls-l='ls -l'
alias md='mkdir -p'
alias o='less'
alias rd='rmdir'
alias rehash='hash -r'
alias unmount='echo "Error: Try the command: umount" 1>&2; false'
alias you='if test "$EUID" = 0 ; then /sbin/yast2 online_update ; else su - -c "/sbin/yast2 online_update" ; fi'

linux:/home/studio # grep -r -l mpicc /etc
linux:/home/studio #

How can I do ?

Hi,

If all users has an error every time the shell is open. Run the code below as root.

find /etc -type f -exec grep -i mpicc {} +

or

For a single user, a normal user can read all files in his “$HOME”

find ~/ -type f -exec grep -i mpicc {} +

maybe you have an unsatisfied mpi dependency see
https://www.open-mpi.org/doc/v1.8/man1/mpicc.1.php
you could try
https://software.opensuse.org/package/mpich
https://software.opensuse.org/package/mpich-autoload

I run the script but the result is difficult to manage, for me that I am a newbi:

[studio@linux:~> find ~/ -type f -exec grep -i mpicc {} +
/home/studio/.xsession-errors-:0:/opt/OpenFOAM/OpenFOAM-2.3.x/etc/config/settings.sh: line 384: mpicc: command not found
/home/studio/.xsession-errors-:0:/opt/OpenFOAM/OpenFOAM-2.3.x/etc/config/settings.sh: line 384: mpicc: command not found
/home/studio/.xsession-errors-:0:/opt/OpenFOAM/OpenFOAM-2.3.x/etc/config/settings.sh: line 384: mpicc: command not found
/home/studio/.xsession-errors-:0:/opt/OpenFOAM/OpenFOAM-2.3.x/etc/config/settings.sh: line 384: mpicc: command not found
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/C65567158E48C7E0647853BA34AE80B15572DF35 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/528B4CC85015875E62E3448D866763D7C795D6F0 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/ECC27244FEE3280CB34E60139D89CE8533AE4A81 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/4B07545F775F4BC6FDF15D5D377E53E4CDF10CA2 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/824EBF638D700C1619A5C1E2047D52D400093F5B matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/CAB6D23F16B3E1798ED29A70849ABAFDCFD11D6A matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/6ECBE6E311BFEAE16A44348435BCA4E9140ABD0C matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/5E6F34A669EB43E84E28B391B06DEF166B1926D4 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/CA4D7DF8CFC461BB937F037E455E2B48816979C6 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/EAEC96344C5BFE2C3A04D638659154201497271F matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/BF44AB0B8271EF6AB09A3666217F0B4678C53942 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/5085687CFC7B00DDCDFBCBFFE1869F2C8896D260 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/9E2A0EC3315FC836217FA1DD72193046AAF34E0C matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/D3BD57998C0BEA038248DA1A0CB7D66786806C13 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/C0DC95876CB30EA661626ECD132AEB20F1456AF9 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/52514A88D69748DB020A84E678B3B3E6A79035E0 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/FA52D94B9301EABE81E9B8433F2779AB212EFF6A matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/B9126A560596E43D5341FFB2D54391E29CB81453 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/4CEAD9B83C56DA412E73619269A2C8AF8207F44F matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/116FF2365C852D7CA8E25AABB6917CA2FB24E0BD matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/AA782BCCD5406C9584FCC716A6154AD815B4E608 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/7058443E139BF37EEB88D0939C90D724D00D0A27 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/ED3A5548D07E70F9D8891854F858517BD58DDC56 matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/8C4FDF6E3E141E07D6391024F3E3DB5F68C01C7C matches
Binary file /home/studio/.cache/mozilla/firefox/4tsokkg5.default/cache2/entries/192D34EC928B5B3E40A334044C13B1F62B5EB3A8 matches
Binary file /home/studio/.local/share/Trash/files/clang+llvm-3.5.0-x86_64-opensuse13.1/bin/llc matches
Binary file /home/studio/.local/share/Trash/files/clang+llvm-3.5.0-x86_64-opensuse13.1/bin/clang matches
Binary file /home/studio/.local/share/Trash/files/clang+llvm-3.5.0-x86_64-opensuse13.1/bin/opt matches
Binary file /home/studio/.local/share/Trash/files/clang+llvm-3.5.0-x86_64-opensuse13.1/lib/libLLVMHexagonCodeGen.a matches
Binary file /home/studio/.local/share/Trash/files/clang+llvm-3.5.0-x86_64-opensuse13.1/lib/libLTO.so matches
Binary file /home/studio/.local/share/Trash/files/clang+llvm-3.5.0-x86_64-opensuse13.1/lib/libLLVMSparcCodeGen.a matches



etc. etc. 
/CODE]

it does seam like an OpenFOAM issue
open the file /opt/OpenFOAM/OpenFOAM-2.3.x/etc/config/settings.sh
with a text editor like kate and take a look at line 384
where did you get OpenFOAM from, does it work?

These are lines 382 383 384


# Use the system installed openmpi, get library directory via mpicc
    export FOAM_MPI=openmpi-system

    libDir=`mpicc --showme:link | sed -e 's/.*-L\(^ ]*\).*/\1/'`

OpenFOAM worked until I updated opensuse from 13.1 to 13.2 version. Now blockMesh (openFOAM mesher) stops with this message:

[studio@linux:~/Desktop/courseMaterialDLTM/tuts/first_tutorial/cavity> blockMesh 
blockMesh: error while loading shared libraries: libmpi.so.1: cannot open shared object file: No such file or directory
/CODE]

do you have openmpi installed?
https://software.opensuse.org/package/openmpi
maybe try and find an updated OpenFOAM package
it does seam that you have mixed 13.1 and 13.2 packages, are all your repositories set for 13.2, run zypper lr see if you have 13.1 repositories, I’d say if you have old 13.1 repo’s remove them then run zypper dup to get your system up to 13.2

Repos are OK

linux:/home/studio # zypper lr
# | Alias                         | Name                          | Enabled | Refresh
--+-------------------------------+-------------------------------+---------+--------
1 | 13.2_education                | 13.2_education                | Yes     | Yes    
2 | Science_13.2                  | Science_13.2                  | Yes     | Yes    
3 | X11:Enlightenment:Factory     | X11:Enlightenment:Factory     | Yes     | Yes    
4 | openSUSE:13.2:Update          | openSUSE:13.2:Update          | Yes     | Yes    
5 | openSUSE_13.2_OSS             | openSUSE_13.2_OSS             | Yes     | Yes    
6 | openSUSE_13.2_Updates         | openSUSE_13.2_Updates         | Yes     | Yes    
7 | openSUSE_13.2_Updates_non-OSS | openSUSE_13.2_Updates_non-OSS | Yes     | Yes    
8 | openSUSE_13.2_non-OSS         | openSUSE_13.2_non-OSS         | Yes     | Yes    
9 | repo-update-non-oss           | openSUSE-13.2-Update-Non-Oss  | Yes     | Yes    
linux:/home/studio # 

openmpi is installed

linux:/home/studio # zypper se openmpi
Loading repository data...
Warning: Repository 'openSUSE:13.2:Update' appears to be outdated. Consider using a different mirror or server.
Reading installed packages...

S | Name                               | Summary                                                                    | Type   
--+------------------------------------+----------------------------------------------------------------------------+--------
  | espresso-openmpi                   | Architecture independent data files for ESPResSo                           | package
  | gromacs-openmpi                    | Molecular dynamics package                                                 | package
  | hdf5-openmpi                       | A general purpose library and file format for storing scientific data      | package
  | hdf5-openmpi-devel                 | Hierarchical Data File Format Version 5                                    | package



  | libhdf5_hl8-openmpi                | HDF 5 runtimelibraries                                                     | package
i | openmpi                            | A powerful implementaion of MPI                                            | package
  | openmpi-devel                      | SDK for openMPI                                                            | package
  | openmpi-devel-static               | Static openMPI libraries                                                   | package
i | openmpi-libs                       | OpenMPI runtime libraries                                                  | package
  | libhdf5-8-openmpi-32bit            | HDF 5 runtime libraries                                                    | package
  | libhdf5_hl8-openmpi-32bit          | HDF 5 runtimelibraries                                                     | package
  | openmpi-libs-32bit                 | OpenMPI runtime libraries                                                  | package

I sese in your next reply, you have openmpi installed. That is good. It may be possible that OpenFOAM is linked against MPI in a different location.

Please post the output of:

ldd `which blockMesh`

and

readelf -d `which blockMesh`

Those are backquotes, (shift +~ on a US keyboard), not single quotes. I suspect your OpenFOAM installation is expecting the MPI libraries to exist in a different path, and that’s why they’re not being found. It may be good enough to simply modify the OpenFOAM bashrc to point to the new location, but I fear recompilation may be needed (not so bad on a regular linux box).

EDIT: not sure I’m replying to the right person.

Also,

echo $LD_LIBRARY_PATH

since the ldd probably won’t tell us anything useful, and OpenFOAM doesn’t set RPATH, if I remember correctly.

Do you have the mpi-selector package installed? That package sets up the environment variables needed to use the default openmpi packages.

You are replying to the right person.

studio@linux:~> ldd `which blockMesh`
        linux-vdso.so.1 (0x00007ffe9250a000)
        libblockMesh.so => /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libblockMesh.so (0x00007f2c6c725000)
        libmeshTools.so => /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libmeshTools.so (0x00007f2c6c17b000)
        libdynamicMesh.so => /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libdynamicMesh.so (0x00007f2c6bbe5000)
        libOpenFOAM.so => /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so (0x00007f2c6b2a0000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f2c6b06b000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f2c6ad63000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f2c6aa61000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f2c6a84a000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f2c6a4a3000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f2c6a285000)
        libtriSurface.so => /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libtriSurface.so (0x00007f2c69ff1000)
        libfileFormats.so => /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libfileFormats.so (0x00007f2c69d76000)
        libfiniteVolume.so => /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so (0x00007f2c6890c000)
        libextrudeModel.so => /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libextrudeModel.so (0x00007f2c686f5000)
        libPstream.so => /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so (0x00007f2c684e6000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f2c682d0000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2c6c961000)
        libsurfMesh.so => /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libsurfMesh.so (0x00007f2c67fd4000)
        libmpi.so.1 => not found

studio@linux:~> readelf -d `which blockMesh`

Dynamic section at offset 0x12c88 contains 34 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libblockMesh.so]
 0x0000000000000001 (NEEDED)             Shared library: [libmeshTools.so]
 0x0000000000000001 (NEEDED)             Shared library: [libdynamicMesh.so]
 0x0000000000000001 (NEEDED)             Shared library: [libOpenFOAM.so]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x000000000000000c (INIT)               0x405498
 0x000000000000000d (FINI)               0x40fb24
 0x0000000000000019 (INIT_ARRAY)         0x612af0
 0x000000000000001b (INIT_ARRAYSZ)       16 (bytes)                                                                                                                                             
 0x000000000000001a (FINI_ARRAY)         0x612b00                                                                                                                                               
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)                                                                                                                                              
 0x0000000000000004 (HASH)               0x400298                                                                                                                                               
 0x000000006ffffef5 (GNU_HASH)           0x400948                                                                                                                                               
 0x0000000000000005 (STRTAB)             0x402120
 0x0000000000000006 (SYMTAB)             0x400bc0
 0x000000000000000a (STRSZ)              8301 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0x613000
 0x0000000000000002 (PLTRELSZ)           3240 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x4047f0
 0x0000000000000007 (RELA)               0x404418
 0x0000000000000008 (RELASZ)             984 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffe (VERNEED)            0x404358
 0x000000006fffffff (VERNEEDNUM)         4
 0x000000006ffffff0 (VERSYM)             0x40418e
 0x0000000000000000 (NULL)               0x0

studio@linux:~> echo $LD_LIBRARY_PATH
/opt/OpenFOAM/ThirdParty-2.3.x/platforms/linux64Gcc/CGAL-4.3/lib:/opt/OpenFOAM/ThirdParty-2.3.x/platforms/linux64Gcc/gperftools-svn/lib:/opt/OpenFOAM/ThirdParty-2.3.x/platforms/linux64Gcc/ParaView-4.1.0/lib/paraview-4.1:/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/openmpi-system:/opt/OpenFOAM/ThirdParty-2.3.x/platforms/linux64GccDPOpt/lib/openmpi-system:/home/studio/OpenFOAM/studio-2.3.x/platforms/linux64GccDPOpt/lib:/opt/OpenFOAM/site/2.3.x/platforms/linux64GccDPOpt/lib:/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib:/opt/OpenFOAM/ThirdParty-2.3.x/platforms/linux64GccDPOpt/lib:/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/dummy:/usr/lib64/openmpi/lib/:/usr/lib64/openmpi/lib/
studio@linux:~> 

studio@linux:~> zypper if mpi-selector 
Loading repository data...
Warning: Repository 'openSUSE:13.2:Update' appears to be outdated. Consider using a different mirror or server.
Reading installed packages...


Information for package mpi-selector:
-------------------------------------
Repository: openSUSE_13.2_OSS
Name: mpi-selector
Version: 1.0.3-12.1.3
Arch: noarch
Vendor: openSUSE
Installed: Yes
Status: up-to-date
Installed Size: 48.8 KiB
Summary: Tool to provide defaults for which MPI implementation to use
Description: 
  A simple tool that allows system administrators to set a site-wide
  default for which MPI implementation is to be used, but also allow
  users to set their own defaults MPI implementation, thereby overriding
  the site-wide default.
  The default can be changed easily via the mpi-selector command --
  editing of shell startup files is not required.
studio@linux:~> 

let’s take a step back
you said OpenFOAM worked in 13.1 and then you did an inplace upgrade and OpenFOAM stopped working and this bug appeared.
your current repo’s are OK but your OpenFOAM came from an old 13.1 repo and as it’s not in the main repertory I’m thinking it did not get updated.
from https://software.opensuse.org/package/openfoam23x

  • Compiled with system openmpi
    you’re using an application that was dynamicly linked to an older mpi it will probobly never work

  • To set the environment variables for OpenFOAM 2.3.x, add the
    following line to your ~/.bashrc file:
    source /opt/openfoam/OpenFOAM-2.3.x/etc/bashrc

if OpenFOAM worked you tweaked your environment.

remove the old OpenFOAM add this repository (via yast or zypper)
http://download.opensuse.org/repositories/home:/dkxls:/cfd/openSUSE_13.2/
note it’s 64 bit only I culdn’t find any 32 bit binaries if you are using a 32 bit OS you might need to recompile/
reinstall OpenFOAM zypper or yast should pull any extra packages like mpi etc.

I have set the environment variables for OpenFOAM 2.3.1 and the openmpi works, but I have tried to compile OpenFOAM and this error appeared:

collect2: error: ld returned 1 exit status
/opt/OpenFOAM/OpenFOAM-2.3.1/wmake/Makefile:149: recipe for target '/opt/OpenFOAM/OpenFOAM-2.3.1/platforms/linux64GccDPOpt/bin/checkMesh' failed
make: *** [/opt/OpenFOAM/OpenFOAM-2.3.1/platforms/linux64GccDPOpt/bin/checkMesh] Error 1

How can I fix it ?

the only reason for compiling it is if you have a 32bit system (I can’t find a 32 bit build)
a few things to try
add this repo (that houses a prebuild 64 bit package)

sudo zypper ar http://download.opensuse.org/repositories/home:/dkxls:/cfd/openSUSE_13.2/home:dkxls:cfd.repo

install the rpm with zypper as it will pull all needed packages

sudo zypper in openfoam23x

they have the old 2.2 version too if you’re having issues with 2.3 try the older one

if you really want to spend a few hours compiling get the source rpm from there, src-rpm’s need to go in /home//rpmbuild so you really shouldn’t install them as root I’d say install it with rpm (I have not used zypper to install src-rpm’s I have used rpm)
install rpmbuild scripts
as an ordinary user execute

rpm -i http://download.opensuse.org/repositories/home:/dkxls:/cfd/openSUSE_13.2/src/openfoam23x-2.3.x-17.1.src.rpm

then cd to the spec folder and do
rpmbuild -bb openfoam23x.spec
wait a few hours, take note of possible errors, if there is a missing dependency search for it and install the needed package. As far as I can tell openfoam needs quite a few packages to build.
If you have a 64 bit OS I still recommend using the prebuild rpm’s.