@@ -8,6 +8,11 @@ case "$mpiname" in
88esac
99version=${VERSION:- $version }
1010
11+ ucxversion=1.15.0
12+ ofiversion=1.21.1
13+ ucxversion=${UCXVERSION:- $ucxversion }
14+ ofiversion=${OFIVERSION:- $ofiversion }
15+
1116PROJECT=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd)
1217PACKAGE=$PROJECT /package
1318SOURCE=$PACKAGE /source
2732if test ! -d " $SOURCE " ; then
2833 if test ! -f " $tarball " ; then
2934 echo downloading " $urlbase " /" $tarball " ...
30- curl -fsO " $urlbase " /" $tarball "
35+ curl -fsSLO " $urlbase " /" $tarball "
3136 else
3237 echo reusing " $tarball " ...
3338 fi
34- echo extracting " $tarball " to " $SOURCE " ...
39+ echo extracting " $tarball " ...
3540 tar xf " $tarball "
3641 mv " $mpiname -$version " " $SOURCE "
3742 patch=" $PROJECT /patches/$mpiname -$version "
3843 if test -f " $patch " ; then
3944 patch -p1 -i " $patch " -d " $SOURCE "
4045 fi
41- if test " $mpiname -$( uname) " = " openmpi-Darwin" ; then
42- if test -d " $SOURCE " /3rd-party; then
43- cd " $SOURCE " /3rd-party
44- tar xf libevent-* .tar.gz && cd libevent-*
46+ if test " $mpiname " = " mpich" ; then
47+ if test " ${version} " \> " 4.2.2" && test " $( uname) " = " Linux" ; then
48+ conf_args=' s/\(ofi_subdir_args\)=\("--enable-embedded"\)/\1=""/'
49+ configure=" $SOURCE " /configure
50+ sed -i.orig " $conf_args " " $configure "
51+ fi
52+ if test " ${version} " \< " 4.2.0" ; then
53+ disable_doc=' s/^\(install-data-local:\s\+\)\$/\1#\$/'
54+ Makefile=" $SOURCE " /Makefile.in
55+ sed -i.orig " $disable_doc " " $Makefile "
56+ fi
57+ fi
58+ if test " $mpiname " = " openmpi" ; then
59+ for deptarball in " $SOURCE " /3rd-party/* .tar.* ; do
60+ test -f " $deptarball " || continue
61+ echo extracting " $( basename " $deptarball " ) "
62+ tar xf " $deptarball " -C " $( dirname " $deptarball " ) "
63+ done
64+ makefiles=(
65+ " $SOURCE " /3rd-party/openpmix/src/util/keyval/Makefile.in
66+ " $SOURCE " /3rd-party/prrte/src/mca/rmaps/rank_file/Makefile.in
67+ " $SOURCE " /3rd-party/prrte/src/util/hostfile/Makefile.in
68+ )
69+ for makefile in " ${makefiles[@]} " ; do
70+ test -f " $makefile " || continue
71+ echo " PMIX_CFLAGS_BEFORE_PICKY = @CFLAGS@" >> " $makefile "
72+ echo " PRTE_CFLAGS_BEFORE_PICKY = @CFLAGS@" >> " $makefile "
73+ done
74+ fi
75+ if test " $mpiname " = " openmpi" && test " ${version} " \< " 5.0.5" ; then
76+ if test " $( uname) " = " Darwin" ; then
77+ cd " $SOURCE " /3rd-party/libevent-*
4578 echo running autogen.sh on " $( basename " $( pwd) " ) "
4679 ./autogen.sh
4780 cd " $PROJECT "
@@ -50,5 +83,74 @@ if test ! -d "$SOURCE"; then
5083else
5184 echo reusing directory " $SOURCE " ...
5285fi
53- echo copying license file...
86+
87+ if test " $( uname) " = " Linux" ; then
88+ if test " $mpiname " = " mpich" ; then
89+ ofidestdir=" $SOURCE " /modules/libfabric
90+ ucxdestdir=" $SOURCE " /modules/ucx
91+ fi
92+ if test " $mpiname " = " openmpi" ; then
93+ ofigithub=" https://github.com/ofiwg/libfabric"
94+ ofiurlbase=" $ofigithub /releases/download/v$ofiversion "
95+ ofitarball=" libfabric-$ofiversion .tar.bz2"
96+ ofidestdir=" $SOURCE " /3rd-party/" ${ofitarball%% .tar.bz2} "
97+ if test ! -d " $ofidestdir " ; then
98+ if test ! -f " $ofitarball " ; then
99+ echo downloading " $ofiurlbase " /" $ofitarball " ...
100+ curl -fsSLO " $ofiurlbase " /" $ofitarball "
101+ else
102+ echo reusing " $ofitarball " ...
103+ fi
104+ echo extracting " $ofitarball " ...
105+ tar xf " $ofitarball "
106+ mkdir -p " $( dirname " $ofidestdir " ) "
107+ mv " $( basename " $ofidestdir " ) " " $ofidestdir "
108+ else
109+ echo reusing directory " $ofidestdir " ...
110+ fi
111+ ucxgithub=" https://github.com/openucx/ucx"
112+ ucxurlbase=" $ucxgithub /releases/download/v$ucxversion "
113+ ucxtarball=" ucx-$ucxversion .tar.gz"
114+ ucxdestdir=" $SOURCE " /3rd-party/" ${ucxtarball%% .tar.gz} "
115+ if test ! -d " $ucxdestdir " ; then
116+ if test ! -f " $ucxtarball " ; then
117+ echo downloading " $ucxurlbase " /" $ucxtarball " ...
118+ curl -fsSLO " $ucxurlbase " /" $ucxtarball "
119+ else
120+ echo reusing " $ucxtarball " ...
121+ fi
122+ echo extracting " $ucxtarball " ...
123+ tar xf " $ucxtarball "
124+ mkdir -p " $( dirname " $ucxdestdir " ) "
125+ mv " $( basename " $ucxdestdir " ) " " $ucxdestdir "
126+ else
127+ echo reusing directory " $ucxdestdir " ...
128+ fi
129+ fi
130+ fi
131+
132+ if test " $mpiname " = " mpich" ; then
133+ mpidate=$( sed -nE " s/MPICH_RELEASE_DATE=\" (.*)\" /\1/p" " $SOURCE /configure" )
134+ fi
135+ if test " $mpiname " = " openmpi" ; then
136+ mpidate=$( sed -nE " s/date=\" (.*)\" /\1/p" " $SOURCE /VERSION" )
137+ fi
138+ if test -n " ${mpidate:- } " ; then
139+ echo writing source-date-epoch ...
140+ date -d " $mpidate " +%s > " $SOURCE /source-date-epoch"
141+ fi
142+
143+ echo writing package metadata ...
144+ echo " Name: $mpiname " > " $PACKAGE /METADATA"
145+ echo " Version: $version " >> " $PACKAGE /METADATA"
146+
147+ echo copying MPI license file...
54148cp " $SOURCE " /" $license " " $PACKAGE /LICENSE"
149+ if test -n " ${ofidestdir:- } " ; then
150+ echo copying OFI license file...
151+ cp " $ofidestdir /COPYING" " $PACKAGE /LICENSE.ofi"
152+ fi
153+ if test -n " ${ucxdestdir:- } " ; then
154+ echo copying UCX license file...
155+ cp " $ucxdestdir /LICENSE" " $PACKAGE /LICENSE.ucx"
156+ fi
0 commit comments