Can I build 100% static OpenFabrics / OpenIB / OFED MPI applications on Linux?
Fully static linking is not for the weak, and it is not recommended. But it is possible. First, you must read this FAQ entry. For an OpenFabrics / OpenIB / OFED application to be built statically, you must have libibverbs v1.0.4 or later (v1.0.4 was released after OFED 1.1, so if you have OFED 1.1, you will manually need to upgrade your libibverbs). Both libibverbs and your verbs hardware plugin must be available in static form. Once all of that has been setup, run the following (artificially wrapped sample output shown below — your output may be slightly different): shell$ mpicc your_app.c -o your_app –showme gcc -I/opt/openmpi/include/openmpi \ -I/opt/openmpi/include -pthread ring.c -o ring \ -L/usr/local/ofed/lib -L/usr/local/ofed/lib64/infiniband \ -L/usr/local/ofed/lib64 -L/opt/openmpi/lib -lmpi -lopen-rte \ -lopen-pal -libverbs -lrt -Wl,–export-dynamic -lnsl -lutil -lm -ldl (or use whatever wrapper compiler is relevant — the –showme flag is the important part here) This exam
Related Questions
- When I build with the Intel compiler suite, linking user MPI applications with the wrapper compilers results in warning messages. What do I do?
- Im trying to build with the Sun Studio compilers on Linux, but Open MPI eventually fails to compile. What do I do?
- Can I build 100% static OpenFabrics / OpenIB / OFED MPI applications on Linux?