OpenMPI, Intel Compilers and RedHat 5: cannot find -lnuma

I found an interesting quirk when trying to build an OpenMPI application on a visualization node with a “stock” version of Red Hat Enterprise Linux 5.8.  I used mpicc to compile the application and got the following error:

$ mpicc hello_world_mpi.c -o hello_world
/usr/bin/ld: cannot find -lnuma


This was rather surprising, since this node mounts a directory via NFS that contains OpenMPI and Intel Composer 2013, and these applications are known to work on other nodes. To find the source of the problem, I used the showme option to see the command that is actually run by mpicc:

$ mpicc hello_world_mpi.c -o hello_world --showme
icc hello_world_mpi.c -o hello_world -I/apps/openmpi/openmpi-1.6.2-intel-composer-2013/include -pthread -L/apps/openmpi/openmpi-1.6.2-intel-composer-2013/lib -lmpi -ldl -lm -lnuma -Wl,--export-dynamic -lrt -lnsl -lutil

The output was identical to the output on the other nodes…so why was this node failing to find libnuma? It turned out that OpenMPI looks for a library called libnuma.so, while RHEL only includes a library called libnuma.so.1, and it is missing a symbolic link that points libnuma.so to libnuma.so.1. The solution is to create the symbolic link:

$ ln -s /usr/lib64/libnuma.so.1 /usr/lib64/libnuma.so
$ ls -l /usr/lib64/libnuma*
lrwxrwxrwx 1 root root    23 Feb 20 17:37 /usr/lib64/libnuma.so -> /usr/lib64/libnuma.so.1
-rwxr-xr-x 1 root root 22032 May 17  2011 /usr/lib64/libnuma.so.1

2 thoughts on “OpenMPI, Intel Compilers and RedHat 5: cannot find -lnuma”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.