xref: /openbmc/openbmc/meta-openembedded/meta-oe/recipes-devtools/mpich/mpich_4.2.3.bb (revision 8460358c3d24c71d9d38fd126c745854a6301564)
1SUMMARY = "Message Passing Interface (MPI) implementation"
2HOMEPAGE = "http://www.mpich.org/"
3SECTION = "devel"
4
5LICENSE = "BSD-2-Clause"
6LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=7a88f0d96d0d7396a7c66bf353235b62"
7
8SRC_URI = "http://www.mpich.org/static/downloads/${PV}/mpich-${PV}.tar.gz"
9SRC_URI[sha256sum] = "7a019180c51d1738ad9c5d8d452314de65e828ee240bcb2d1f80de9a65be88a8"
10
11RDEPENDS:${PN} += "bash perl libxml2"
12
13EXTRA_OECONF = "--enable-debuginfo \
14    --enable-fast \
15    --enable-shared  \
16    --with-pm=gforker  \
17    BASH_SHELL='${USRBINPATH}/env bash' \
18    PERL='${USRBINPATH}/env perl' \
19    --with-device=ch3:nemesis \
20"
21
22PACKAGECONFIG ??= ""
23
24PACKAGECONFIG[cxx] = "--enable-cxx,--disable-cxx"
25PACKAGECONFIG[fortran] = "--with-cross=${WORKDIR}/cross_values.txt --enable-fortran,--disable-f77 --disable-fortran,libgfortran"
26
27# libmpi.so needs symbols like __multf3 and somehow it does not respect --rtlib option passed by clang
28LDFLAGS:append:x86-64 = " -lgcc"
29LDFLAGS:append:x86 = " -lgcc"
30
31inherit autotools gettext pkgconfig qemu
32
33DEPENDS += "qemu-native"
34
35do_configure() {
36    if [ "${@bb.utils.contains('PACKAGECONFIG', 'fortran', '1', '', d)}" = "1" ]; then
37        qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}"
38        cat > ${WORKDIR}/qemuwrapper << EOF
39#!/bin/sh
40$qemu_binary "\$@"
41EOF
42        chmod +x ${WORKDIR}/qemuwrapper
43
44        sed -i 's:my \(.*\) ./t`;:my \1 ${WORKDIR}/qemuwrapper ${WORKDIR}/t`;:' ${S}/maint/gen_cross.pl
45
46        cd ${WORKDIR}
47        perl ${S}/maint/gen_cross.pl
48
49        sed -i 's:\(CROSS_F90_INTEGER_MODEL_MAP=.*\) }"$:\1 }, ":' ${WORKDIR}/cross_values.txt
50    fi
51
52    cd ${S}
53    ./autogen.sh
54
55    cd ${B}
56    oe_runconf
57    sed -i -e 's,${WORKDIR},,g' ${B}/src/include/mpichinfo.h
58}
59
60do_install:append() {
61    sed -i 's,${S}/,,g' ${D}/${libdir}/libmpi.la
62    sed -i 's,${DEBUG_PREFIX_MAP},,g' ${D}${bindir}/mpicxx
63    sed -i 's,${DEBUG_PREFIX_MAP},,g' ${D}${bindir}/mpicc
64    sed -i 's,${DEBUG_PREFIX_MAP},,g' ${D}/${libdir}/pkgconfig/mpich.pc
65    sed -i 's,${RECIPE_SYSROOT},/,g' ${D}${bindir}/mpicc
66    sed -i 's,${RECIPE_SYSROOT},/,g' ${D}${bindir}/mpicxx
67}
68