@@ -19,8 +19,16 @@ case $(uname) in
1919esac
2020
2121if test " $( uname) " = Linux; then
22+ # shellcheck disable=SC1091
23+ PLATFORM_ID=" $( source /etc/os-release && echo " ${PLATFORM_ID:- } " ) "
2224 if test " ${CIBUILDWHEEL} " = 1; then
2325 yum remove -y libatomic
26+ if test " $PLATFORM_ID " = " platform:el8" ; then
27+ yum install -y rdma-core-devel
28+ if test " $( uname -m) " = x86_64; then
29+ yum install -y libpsm2-devel
30+ fi
31+ fi
2432 fi
2533fi
2634if test " $( uname) " = Darwin; then
@@ -84,6 +92,15 @@ if test -d "$MODSOURCE"/libfabric-*; then
8492 echo running configure for OFI
8593 oficonfigure=" $OFISOURCE " /configure
8694 ofioptions=(--prefix=" $PREFIX " --disable-static)
95+ if test -f /usr/lib* /librdmacm.so; then
96+ ofioptions+=(--enable-verbs=dl)
97+ fi
98+ if test -f /usr/lib* /libpsm2.so; then
99+ ofioptions+=(--enable-psm2=dl)
100+ fi
101+ if test -f /usr/lib* /libefa.so; then
102+ ofioptions+=(--enable-efa=dl)
103+ fi
87104 " $oficonfigure " " ${ofioptions[@]} " \
88105 CFLAGS=" ${build_cflags[*]} " \
89106 LDFLAGS=" ${build_ldflags[*]} "
@@ -181,6 +198,7 @@ if test "$mpiname" = "openmpi"; then
181198 --prefix=" $PREFIX "
182199 --without-ucx
183200 --without-ofi
201+ --without-psm2
184202 --without-cuda
185203 --without-rocm
186204 --with-hwloc=internal
@@ -284,6 +302,7 @@ rm -f lib/libuc[mpst]*.a
284302rm -f lib/libuc[mpst]* .la
285303rm -f lib/ucx/libuc[mt]_* .a
286304rm -f lib/ucx/libuc[mt]_* .la
305+ rm -f lib/ucx/libucx_perftest_* .*
287306rm -fr lib/cmake/ucx
288307rm -f lib/pkgconfig/ucx* .pc
289308rm -fr share/ucx
@@ -297,15 +316,18 @@ for lib in libuc[mpst]*.so.?; do
297316 fi
298317 patchelf --set-rpath " \$ ORIGIN" " $lib "
299318done
300- patchelf --add-rpath " \$ ORIGIN/ucx" libucm.so.?
301- patchelf --add-rpath " \$ ORIGIN/ucx" libuct.so.?
302- for lib in ucx/libuc[mt]_* .so.? ; do
319+ if test -d ucx; then
320+ patchelf --add-rpath " \$ ORIGIN/ucx" libuc[mpst].so.?
321+ fi
322+ for lib in ucx/libuc[mpst]_* .so.? ; do
323+ if test -f " $lib " ; then
324+ patchelf --set-rpath " \$ ORIGIN" " $lib "
325+ patchelf --add-rpath " \$ ORIGIN/.." " $lib "
326+ fi
303327 if test -f " $lib " .* ; then
304328 mv " $( dirname " $lib " ) /$( readlink " $lib " ) " " $lib "
305329 ln -srf " $lib " " ${lib% .* } "
306330 fi
307- patchelf --set-rpath " \$ ORIGIN" " $lib "
308- patchelf --add-rpath " \$ ORIGIN/.." " $lib "
309331done
310332
311333} # fixup-ucx()
@@ -317,6 +339,8 @@ rm -fr include/rdma
317339rm -f bin/fi_*
318340rm -f lib/libfabric.a
319341rm -f lib/libfabric.la
342+ rm -f lib/libfabric/lib* -fi.a
343+ rm -f lib/libfabric/lib* -fi.la
320344rm -f lib/pkgconfig/libfabric.pc
321345rm -f share/man/man? /fabric.?
322346rm -f share/man/man? /fi_* .?
@@ -330,6 +354,15 @@ for lib in libfabric.so.?; do
330354 fi
331355 patchelf --set-rpath " \$ ORIGIN" " $lib "
332356done
357+ if test -d libfabric; then
358+ patchelf --add-rpath " \$ ORIGIN/libfabric" libfabric.so.?
359+ fi
360+ for lib in libfabric/lib* -fi.so; do
361+ if test -f " $lib " ; then
362+ patchelf --set-rpath " \$ ORIGIN" " $lib "
363+ patchelf --set-rpath " \$ ORIGIN/.." " $lib "
364+ fi
365+ done
333366
334367} # fixup-ofi()
335368
@@ -350,6 +383,7 @@ rm -f lib/lib*mpi.la
350383rm -f lib/lib* mpich* .*
351384rm -f lib/lib* mpicxx.*
352385rm -f lib/lib* mpifort.*
386+ rm -fr lib/cmake
353387rm -fr lib/pkgconfig
354388rm -fr share
355389
@@ -398,10 +432,16 @@ if test "$(uname)" = Linux; then
398432 if test -f libfabric.so; then
399433 mkdir -p " $mpiname "
400434 mv libfabric.* " $mpiname "
435+ if test -d libfabric; then
436+ mv libfabric " $mpiname "
437+ fi
401438 fi
402439 if test -f libucp.so; then
403440 mkdir -p " $mpiname "
404- mv libuc[mpst]* .* ucx " $mpiname "
441+ mv libuc[mpst]* .* " $mpiname "
442+ if test -d ucx; then
443+ mv ucx " $mpiname "
444+ fi
405445 fi
406446 cd " ${DESTDIR}${PREFIX} /lib"
407447 for lib in lib* .so; do
@@ -416,6 +456,15 @@ if test "$(uname)" = Linux; then
416456 patchelf --add-rpath " \$ ORIGIN/$mpiname " libmpi.so.*
417457 fi
418458 cd " ${DESTDIR}${PREFIX} /lib"
459+ for dep in rdmacm ibverbs psm2 efa; do
460+ for ver in $( seq 1 2) ; do
461+ patchelf --remove-needed " lib$dep .so.$ver " libmpi.so.*
462+ for exe in " ${executables[@]} " ; do
463+ patchelf --remove-needed " lib$dep .so.$ver " " ../bin/$exe "
464+ done
465+ done
466+ done
467+ cd " ${DESTDIR}${PREFIX} /lib"
419468 find . -name ' *.so' -type l -delete
420469 ln -s libmpi.so.* libmpi.so
421470fi
@@ -536,14 +585,6 @@ for exe in 'mpirun' 'ompi*' 'pmix*' 'prte*' 'opal*' 'orte*'; do
536585 done < <( find . -name " $exe " -type f)
537586done
538587
539- cd " ${DESTDIR}${PREFIX} /lib"
540- unset libraries
541- for lib in ' lib*.so.*' ' lib*.*.dylib' ; do
542- while IFS= read -r filename
543- do libraries+=(" $( basename " $filename " ) " )
544- done < <( find . -name " $lib " -type f)
545- done
546-
547588if test " $( uname) " = Linux; then
548589 cd " ${DESTDIR}${PREFIX} /bin"
549590 for exe in " ${executables[@]} " ; do
@@ -561,10 +602,16 @@ if test "$(uname)" = Linux; then
561602 if test -f libfabric.so; then
562603 mkdir -p " $mpiname "
563604 mv libfabric.* " $mpiname "
605+ if test -d libfabric; then
606+ mv libfabric " $mpiname "
607+ fi
564608 fi
565609 if test -f libucp.so; then
566610 mkdir -p " $mpiname "
567- mv libuc[mpst]* .* ucx " $mpiname "
611+ mv libuc[mpst]* .* " $mpiname "
612+ if test -d ucx; then
613+ mv ucx " $mpiname "
614+ fi
568615 fi
569616 for lib in lib* .so; do
570617 patchelf --set-rpath " \$ ORIGIN" " $lib "
@@ -599,6 +646,13 @@ if test "$(uname)" = Linux; then
599646 patchelf --add-rpath " $libpath " libopen-* .so.*
600647 fi
601648 cd " ${DESTDIR}${PREFIX} /lib"
649+ for dep in rdmacm ibverbs psm2 efa; do
650+ for ver in $( seq 1 2) ; do
651+ patchelf --remove-needed " lib$dep .so.$ver " libmpi.so.*
652+ patchelf --remove-needed " lib$dep .so.$ver " libopen-* .so.*
653+ done
654+ done
655+ cd " ${DESTDIR}${PREFIX} /lib"
602656 find . -name ' *.so' -type l -delete
603657 ln -s libmpi.so.* libmpi.so
604658fi
0 commit comments