# Contributor: Oleg A. Khlybov # There is a Tcl integration test suite for both package maintainers and package end users # to ensure the installed package is intact. The test suite performs a series of compile/run # tests for multiple configurations from the build matrix. # Basic usage: tclsh $MINGW_PREFIX/share/test/msmpi/msmpi.tcl _realname=msmpi pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=10.1.1 pkgrel=18 pkgdesc="Microsoft MPI SDK (mingw-w64)" arch=('any') mingw_arch=('mingw64' 'ucrt64' 'clang64') url="https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi" license=('spdx:MIT') depends=("${MINGW_PACKAGE_PREFIX}-cc") makedepends=("${MINGW_PACKAGE_PREFIX}-fc") checkdepends=("${MINGW_PACKAGE_PREFIX}-tcl") optdepends=("${MINGW_PACKAGE_PREFIX}-fc: build FORTRAN code" "${MINGW_PACKAGE_PREFIX}-tcl: test suite") source=( 'mpi.c' 'mpi.h' 'mpif.h' 'mpi.F90' 'mpifptr.h.x86_64' 'mpifptr.h.i686' 'msmpi.def.x86_64' 'msmpi.def.i686' 'hello_mpi.c' 'hello_mpi.cpp' 'hello_mpi.F' 'hello_mpi.f90' 'msmpi.tcl' 'testme-0.tm' 'buildme-0.tm' ) sha256sums=('17086fb1cf949251e4ae1549a06d292c58e468c822cca3ac1851e57e79d8ab20' 'baee3f18f38650e7182956baa0d3d8f8e5c26d8603ccee4871a4dbd160c13660' '681be9e946eea309e419254e4032b8df3d53621e1d93b850cb0a75f8900cca57' 'e9673ee8a7c078371f51792d99343e949a4d998ee1a0a1cdccdd14c89a5082cd' 'edd76b5096bd31052be13e2d3306d931277d9c983b147ecf8aef0761d4ae8fb3' '126bb8230844ad1de5f7e368c12008d2eea9831cb149b4a6952c775c08b294a2' 'fd18184993872fc4eaea825e85f974dca4b020598d838c424c6c112c2328cf2a' '7b8ed9d3e257e439678cc648164164d6817f7fde68530055b392f67d97bf8ec8' 'ea8203492942fa900c4946741ad88af8957c4d058e06eb618ffae0e5e967b71b' '9483053c0f3ce15d850f69565f2b4e53630cee75073c27432cd08ecc596a57d9' 'c9f63c1ca20f8ebfe26ad455342f34c27bc1a1a83778240388e9f18b26c2e889' '8cb47bb77451dbe2703f7f28eef422e55e7a33a28977bf13bbd11d305aeef61e' 'cef6074632450dd847c051c785a12826a8dbe5c33f5771ecd3af8fdcee1c2f39' '8d8f5670ffdf34a10b0d027bff976131824e2e6b053f8a13d207ecddd4663d6d' 'd0db2aa573c9aaf57b30cb3c2bd7c66e1677f3f468002f467da98b75943076b1') build() { mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM} # Import library (.dll.a) mkdir -p lib ${MINGW_PREFIX}/bin/dlltool -k -d "$srcdir/msmpi.def.${CARCH}" -l lib/libmsmpi.dll.a # Headers mkdir -p include cp $srcdir/mpi.h include cp $srcdir/{mpif.h,mpi.F90} include cp $srcdir/mpifptr.h.${CARCH} include/mpifptr.h # C/C++ Compiler wrappers mkdir -p bin mpic="$srcdir/mpi.c" if [[ ${MSYSTEM} == CLANG64 ]]; then sed -e "s|gfortran|flang|g" -i ${mpic} fi cflags="-s -O2 -DNDEBUG" $CC ${cflags} -o bin/mpicc.exe -DCC "${mpic}" $CC ${cflags} -o bin/mpicxx.exe -DCXX "${mpic}" cp bin/mpicxx.exe bin/mpic++.exe # Fortran Compiler wrappers $CC ${cflags} -o bin/mpifort.exe -DFC "${mpic}" cp bin/mpifort.exe bin/mpif77.exe cp bin/mpifort.exe bin/mpif90.exe # FORTRAN90 MPI modules bin/mpifort -c -Jinclude "${srcdir}"/mpi.F90 rm mpi.o } package() { cd "${srcdir}" cp -r "build-${MSYSTEM}" "${pkgdir}${MINGW_PREFIX}" mkdir -p "${pkgdir}${MINGW_PREFIX}/share/test/msmpi" cp msmpi.tcl {testme-0,buildme-0}.tm hello_mpi.{c,cpp,F,f90} "${pkgdir}${MINGW_PREFIX}/share/test/msmpi" mkdir -p "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig" echo " prefix=${MINGW_PREFIX} libdir=\${prefix}/lib includedir=\${prefix}/include Name: ${_realname} URL: ${url} Version: ${pkgver} Description: ${pkgdesc} Cflags: -I\${includedir} Libs: -L\${libdir} -l:libmsmpi.dll.a " | sed '/^\s*$/d;s/^\s*//' > "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/${_realname}.pc" } check() { # This is the default installation location for Microsoft MPI. # It might need to be adjusted dependent on the system where the tests are run. : "${MSMPI_BIN:="/c/Program\ Files/Microsoft\ MPI/Bin"}" PATH="${srcdir}/build-${MSYSTEM}/bin:${MSMPI_BIN}:${PATH}" \ tclsh "${srcdir}"/msmpi.tcl }