Why don the wrapper compilers add “-rpath” (or similar) flags by default?
The default installation of Open MPI tries very hard to not include any non-essential flags in the wrapper compilers. This is the most conservative setting and allows the greatest flexability for end-users. If the wrapper compilers started adding flags to support specific features (such as run-time locations for finding the Open MPI libraries), such flags — no matter how useful to some portion of users — would almost certainly break assumptions and functionality for other users. As a workaround, Open MPI provides several mechanisms for users to manually override the flags in the wrapper compilers: • First and simplest, you can add your own flags to the wrapper compiler command line by simply listing them on the command line. For example: shell$ mpicc my_mpi_application.c -o my_mpi_application -rpath /path/to/openmpi/install/lib • Use the –showme options to the wrapper compilers to dynamically see what flags the wrappers are adding, and modify them as appropiate. See this FAQ entry f