@@ -8,47 +8,180 @@ case "$mpiname" in
88esac
99version=${VERSION:- $version }
1010
11+ ucxversion=1.17.0
12+ ofiversion=1.22.0
13+ ucxversion=${UCXVERSION:- $ucxversion }
14+ ofiversion=${OFIVERSION:- $ofiversion }
15+
1116PROJECT=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd)
1217PACKAGE=$PROJECT /package
1318SOURCE=$PACKAGE /source
1419
1520if test " $mpiname " = " mpich" ; then
1621 urlbase=" https://www.mpich.org/static/downloads/$version "
1722 tarball=" $mpiname -$version .tar.gz"
18- license=COPYRIGHT
1923fi
20-
2124if test " $mpiname " = " openmpi" ; then
2225 urlbase=https://download.open-mpi.org/release/open-mpi/v${version% .* }
2326 tarball=" $mpiname -$version .tar.gz"
24- license=LICENSE
2527fi
26-
2728if test ! -d " $SOURCE " ; then
2829 if test ! -f " $tarball " ; then
2930 echo downloading " $urlbase " /" $tarball " ...
30- curl -fsO " $urlbase " /" $tarball "
31+ curl -fsSLO " $urlbase " /" $tarball "
3132 else
3233 echo reusing " $tarball " ...
3334 fi
34- echo extracting " $tarball " to " $SOURCE " ...
35+ echo extracting " $tarball " ...
3536 tar xf " $tarball "
3637 mv " $mpiname -$version " " $SOURCE "
3738 patch=" $PROJECT /patches/$mpiname -$version "
3839 if test -f " $patch " ; then
3940 patch -p1 -i " $patch " -d " $SOURCE "
4041 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-*
42+ if test " $mpiname " = " mpich" ; then
43+ if test " ${version} " \< " 4.2.0" ; then
44+ disable_doc=' s/^\(install-data-local:\s\+\)\$/\1#\$/'
45+ sed -i.orig " $disable_doc " " $SOURCE " /Makefile.in
46+ fi
47+ fi
48+ if test " $mpiname " = " openmpi" ; then
49+ for deptarball in " $SOURCE " /3rd-party/* .tar.* ; do
50+ test -f " $deptarball " || continue
51+ echo extracting " $( basename " $deptarball " ) "
52+ tar xf " $deptarball " -C " $( dirname " $deptarball " ) "
53+ done
54+ makefiles=(
55+ " $SOURCE " /3rd-party/openpmix/src/util/keyval/Makefile.in
56+ " $SOURCE " /3rd-party/prrte/src/mca/rmaps/rank_file/Makefile.in
57+ " $SOURCE " /3rd-party/prrte/src/util/hostfile/Makefile.in
58+ )
59+ for makefile in " ${makefiles[@]} " ; do
60+ test -f " $makefile " || continue
61+ echo " PMIX_CFLAGS_BEFORE_PICKY = @CFLAGS@" >> " $makefile "
62+ echo " PRTE_CFLAGS_BEFORE_PICKY = @CFLAGS@" >> " $makefile "
63+ done
64+ fi
65+ if test " $mpiname " = " openmpi" && test " ${version} " \< " 5.0.5" ; then
66+ if test " $( uname) " = " Darwin" && test -d " $SOURCE " /3rd-party; then
67+ cd " $SOURCE " /3rd-party/libevent-*
4568 echo running autogen.sh on " $( basename " $( pwd) " ) "
4669 ./autogen.sh
4770 cd " $PROJECT "
4871 fi
4972 fi
73+ echo writing package metadata ...
74+ echo " Name: $mpiname " > " $PACKAGE /METADATA"
75+ echo " Version: $version " >> " $PACKAGE /METADATA"
5076else
5177 echo reusing directory " $SOURCE " ...
78+ check () { test " $( awk " /$1 /" ' {print $2}' " $PACKAGE /METADATA" ) " = " $2 " ; }
79+ check Name " $mpiname " || (echo not " $mpiname -$version " !!! && exit 1)
80+ check Version " $version " || (echo not " $mpiname -$version " !!! && exit 1)
81+ fi
82+
83+ if test " $( uname) " = " Linux" ; then
84+ case " $mpiname " in
85+ mpich) MODSOURCE=" $SOURCE " /modules ;;
86+ openmpi) MODSOURCE=" $SOURCE " /3rd-party ;;
87+ esac
88+ ofigithub=" https://github.com/ofiwg/libfabric"
89+ ofiurlbase=" $ofigithub /releases/download/v$ofiversion "
90+ ofitarball=" libfabric-$ofiversion .tar.bz2"
91+ ofidestdir=" $MODSOURCE " /" ${ofitarball%% .tar.* } "
92+ if test ! -d " $ofidestdir " ; then
93+ if test ! -f " $ofitarball " ; then
94+ echo downloading " $ofiurlbase " /" $ofitarball " ...
95+ curl -fsSLO " $ofiurlbase " /" $ofitarball "
96+ else
97+ echo reusing " $ofitarball " ...
98+ fi
99+ echo extracting " $ofitarball " ...
100+ tar xf " $ofitarball "
101+ mkdir -p " $( dirname " $ofidestdir " ) "
102+ mv " $( basename " $ofidestdir " ) " " $ofidestdir "
103+ else
104+ echo reusing directory " $ofidestdir " ...
105+ fi
106+ ucxgithub=" https://github.com/openucx/ucx"
107+ ucxurlbase=" $ucxgithub /releases/download/v$ucxversion "
108+ ucxtarball=" ucx-$ucxversion .tar.gz"
109+ ucxdestdir=" $MODSOURCE " /" ${ucxtarball%% .tar.* } "
110+ if test ! -d " $ucxdestdir " ; then
111+ if test ! -f " $ucxtarball " ; then
112+ echo downloading " $ucxurlbase " /" $ucxtarball " ...
113+ curl -fsSLO " $ucxurlbase " /" $ucxtarball "
114+ else
115+ echo reusing " $ucxtarball " ...
116+ fi
117+ echo extracting " $ucxtarball " ...
118+ tar xf " $ucxtarball "
119+ mkdir -p " $( dirname " $ucxdestdir " ) "
120+ mv " $( basename " $ucxdestdir " ) " " $ucxdestdir "
121+ if test " ${ucxversion} " \< " 1.17.1" ; then
122+ cmd=' s/\(#include <limits.h>\)/\1\n#include <math.h>/'
123+ sed -i.orig " $cmd " " $ucxdestdir /src/ucs/time/time.h"
124+ fi
125+ else
126+ echo reusing directory " $ucxdestdir " ...
127+ fi
128+ fi
129+
130+ if test " $mpiname " = " mpich" ; then
131+ mpidate=$( sed -nE " s/MPICH_RELEASE_DATE=\" (.*)\" /\1/p" " $SOURCE /configure" )
132+ fi
133+ if test " $mpiname " = " openmpi" ; then
134+ mpidate=$( sed -nE " s/date=\" (.*)\" /\1/p" " $SOURCE /VERSION" )
135+ fi
136+ if test -n " ${mpidate+x} " ; then
137+ case " $( uname) " in
138+ Linux)
139+ timestamp=$( date -d " $mpidate " " +%s" )
140+ ;;
141+ Darwin)
142+ datefmt=" %b %d, %Y %T%z"
143+ if test " $mpiname " = " mpich" ; then
144+ mpidate=$( awk ' {$3=$3",";print $2,$3,$NF}' <<< " $mpidate" )
145+ fi
146+ timestamp=$( date -j -f " $datefmt " " $mpidate 12:00:00+0000" " +%s" )
147+ ;;
148+ esac
149+ echo writing source-date-epoch ...
150+ echo " $timestamp " > " $SOURCE /source-date-epoch"
151+ fi
152+
153+ if test " $mpiname " = " mpich" ; then
154+ mpilicense=" $SOURCE " /COPYRIGHT
155+ otherlicenses=(
156+ " $SOURCE " /modules/hwloc/COPYING
157+ " $SOURCE " /modules/json-c/COPYING
158+ " $SOURCE " /modules/yaksa/COPYRIGHT
159+ )
160+ fi
161+ if test " $mpiname " = " openmpi" ; then
162+ mpilicense=" $SOURCE " /LICENSE
163+ otherlicenses=(
164+ " $SOURCE " /3rd-party/hwloc-* /COPYING
165+ " $SOURCE " /3rd-party/libevent-* /LICENSE
166+ " $SOURCE " /3rd-party/openpmix/LICENSE
167+ " $SOURCE " /3rd-party/prrte/LICENSE
168+ " $SOURCE " /3rd-party/treematch/COPYING
169+ )
170+ fi
171+ echo copying MPI license file...
172+ cp " $mpilicense " " $PACKAGE /LICENSE"
173+ if test -n " ${ofidestdir+x} " ; then
174+ echo copying OFI license file...
175+ cp " $ofidestdir /COPYING" " $PACKAGE /LICENSE.ofi"
176+ fi
177+ if test -n " ${ucxdestdir+x} " ; then
178+ echo copying UCX license file...
179+ cp " $ucxdestdir /LICENSE" " $PACKAGE /LICENSE.ucx"
52180fi
53- echo copying license file...
54- cp " $SOURCE " /" $license " " $PACKAGE /LICENSE"
181+ for license in " ${otherlicenses[@]} " ; do
182+ test -f " $license " || continue
183+ module=$( basename " $( dirname " $license " ) " )
184+ module=" ${module%% -[0-9]* } "
185+ echo copying " $module " license file...
186+ cp " $license " " $PACKAGE /LICENSE.$module "
187+ done
0 commit comments