Syntax errors when running Intel® MPI Library scripts under Ubuntu

By Gergana S. Slavova, Published: 12/22/2009, Last Updated: 12/22/2009

Problem : 

I'm trying to run the Intel® MPI Library on my Ubuntu system. Installation went fine but I see this error when trying to run:

gergana@node1:~$ mpirun -np 4 hostname
/home/gsslavov/intel/impi/<version>/bin/mpirun: 63: Syntax error: "(" unexpected (expecting "fi")

What's going on?

Environment : 

This applies to systems running Ubuntu 9.10 or later (as well as Ubuntu 8.04 LTS or later)

Root Cause : 

It seems that with version 9.10, Ubuntu has decided to change the default shell from bash to dash. More info is available from the link in the excerpt below:

In Ubuntu 6.10, the default system shell, /bin/sh, was changed to dash (the Debian Almquist Shell); previously it had been bash (the GNU Bourne-Again Shell). This document explains this change and what you should do if you encounter problems.

The default login shell remains bash.
 

The two shells are not fully compatible (since bash is quite more extensive than dash), thus leading to the syntax errors.

Resolution : 

If you'd like to continue using the Intel MPI Library (or any of the Cluster Tools) on Ubuntu, the fix for this issue is fairly simple: change the /bin/sh symlink to point from dash to bash:

$ rm /bin/sh
$ ln -s /bin/bash /bin/sh

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804