Skip to contentSkip to conversation

openmpi: add Fortran support for MIPS32

PATCH New Vicente Olivert Riera 3 participants 5 messages Jul 7, 2016 – Jul 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 openmpi: add Fortran support for MIPS32

We include a file containing cached values for Fortran tests that are performed at the configure step. These tests fail when cross-compiling and this is known upstream. See:

https://www.open-mpi.org/community/lists/users/2013/01/21186.php

In that thread the upstream maintainer admits that "cross compiling OpenMPI is a known issue" and the way to workaround this is to "pre-populate configure's answers to the Fortran tests (so that it doesn't actually have to run anything)"

---
Changes v1 -> v2:
- Nothing.

 package/openmpi/openmpi.mk                         | 12 ++++-
 .../openmpi_mips32_fortran_cached_values.mk        | 51 ++++++++++++++++++++++
 2 files changed, 61 insertions(+), 2 deletions(-)
 create mode 100644 package/openmpi/openmpi_mips32_fortran_cached_values.mk
package/openmpi/openmpi.mk +10 -2
index 8871eaf..47f42be 100644
@@ -13,8 +13,16 @@ OPENMPI_LICENSE_FILES = LICENSE
 OPENMPI_INSTALL_STAGING = YES
 OPENMPI_CONF_OPTS = --disable-vt
 
-# Disable fortran by default until we add BR2_TOOLCHAIN_HAS_FORTRAN
-# hidden symbol to our toolchain infrastructure
+ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),y)
+
+# Enable Fortran for MIPS32
+ifeq ($(BR2_mips)$(BR2_mipsel),y)
+OPENMPI_CONF_OPTS += --enable-mpi-fortran=yes
+include $(TOPDIR)/package/openmpi/openmpi_mips32_fortran_cached_values.mk
+endif
+
+else
 OPENMPI_CONF_OPTS += --enable-mpi-fortran=no
+endif
 
 $(eval $(autotools-package))
package/openmpi/openmpi_mips32_fortran_cached_values.mk new file +51 -0

51 lines not on this page · raw message

Signature · 1 line
2.7.3
#1 lore raw

PATCH v2 2/2 openmpi: add Fortran support for MIPS64

We include a file containing cached values for Fortran tests that are performed at the configure step. These tests fail when cross-compiling and this is known upstream. See:

https://www.open-mpi.org/community/lists/users/2013/01/21186.php

In that thread the upstream maintainer admits that "cross compiling OpenMPI is a known issue" and the way to workaround this is to "pre-populate configure's answers to the Fortran tests (so that it doesn't actually have to run anything)"

---
Changes v1 -> v2:
- Commit log fixed.

 package/openmpi/openmpi.mk                         |  4 ++
 .../openmpi_mips64_fortran_cached_values.mk        | 60 ++++++++++++++++++++++
 2 files changed, 64 insertions(+)
 create mode 100644 package/openmpi/openmpi_mips64_fortran_cached_values.mk
package/openmpi/openmpi.mk +4 -0
index 47f42be..a2e79aa 100644
@@ -19,6 +19,10 @@ ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),y)
 ifeq ($(BR2_mips)$(BR2_mipsel),y)
 OPENMPI_CONF_OPTS += --enable-mpi-fortran=yes
 include $(TOPDIR)/package/openmpi/openmpi_mips32_fortran_cached_values.mk
+# Enable Fortran for MIPS64
+else ifeq ($(BR2_mips64)$(BR2_mips64el),y)
+OPENMPI_CONF_OPTS += --enable-mpi-fortran=yes
+include $(TOPDIR)/package/openmpi/openmpi_mips64_fortran_cached_values.mk
 endif
 
 else
package/openmpi/openmpi_mips64_fortran_cached_values.mk new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.7.3
#2 lore raw

PATCH v2 1/2 openmpi: add Fortran support for MIPS32

In reply to Vicente Olivert Riera

Vicente, All,

On 2016-07-07 16:47 +0100, Vicente Olivert Riera spake thusly:

Quoted 5 lines

We include a file containing cached values for Fortran tests that are performed at the configure step. These tests fail when cross-compiling and this is known upstream. See:

https://www.open-mpi.org/community/lists/users/2013/01/21186.php

Too bad... :-/

Quoted 4 lines

In that thread the upstream maintainer admits that "cross compiling OpenMPI is a known issue" and the way to workaround this is to "pre-populate configure's answers to the Fortran tests (so that it doesn't actually have to run anything)"

Meh... :-/

Quoted 16 lines

---
Changes v1 -> v2:
- Nothing.

 package/openmpi/openmpi.mk                         | 12 ++++-
 .../openmpi_mips32_fortran_cached_values.mk        | 51 ++++++++++++++++++++++
 2 files changed, 61 insertions(+), 2 deletions(-)
 create mode 100644 package/openmpi/openmpi_mips32_fortran_cached_values.mk
package/openmpi/openmpi.mk +0 -0
index 8871eaf..47f42be 100644
@@ -13,8 +13,16 @@ OPENMPI_LICENSE_FILES = LICENSE
 OPENMPI_INSTALL_STAGING = YES

package/openmpi/openmpi.mk OPENMPI_LICENSE_FILES = LICENSE · line 21

Quoted 10 lines
package/openmpi/openmpi.mk +6 -2
 OPENMPI_CONF_OPTS = --disable-vt
 
-# Disable fortran by default until we add BR2_TOOLCHAIN_HAS_FORTRAN
-# hidden symbol to our toolchain infrastructure
+ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),y)
+
+# Enable Fortran for MIPS32
+ifeq ($(BR2_mips)$(BR2_mipsel),y)
+OPENMPI_CONF_OPTS += --enable-mpi-fortran=yes
+include $(TOPDIR)/package/openmpi/openmpi_mips32_fortran_cached_values.mk

No nedd for the leading $(TOPDIR)/ as $(TOPDIR) is guaranteed by Buildroot to be the CWD when running Buildroot.

Quoted 13 lines
package/openmpi/openmpi.mk +4 -0
+endif
+
+else
 OPENMPI_CONF_OPTS += --enable-mpi-fortran=no
+endif
 
 $(eval $(autotools-package))
package/openmpi/openmpi_mips32_fortran_cached_values.mk new file +0 -0
new file mode 100644
index 0000000..4962d88

package/openmpi/openmpi_mips32_fortran_cached_values.mk line 3

Quoted 3 lines
package/openmpi/openmpi_mips32_fortran_cached_values.mk new file +3 -0
@@ -0,0 +1,51 @@
+OPENMPI_CONF_ENV += ompi_cv_fortran_sizeof_CHARACTER=1
+OPENMPI_CONF_ENV += ompi_cv_fortran_sizeof_LOGICAL=4
+OPENMPI_CONF_ENV += ompi_cv_fortran_sizeof_LOGICALp1=1

[--SNIP--]

I would have wrote it like that:

    OPENMPI_CONF_ENV += \
        ompi_cv_fortran_sizeof_CHARACTER=1 \
        ompi_cv_fortran_sizeof_LOGICAL=4 \
        ompi_cv_fortran_sizeof_LOGICALp1=1 \
        [...]

Otherwise, I don;t see a better solution, indeed... :-/

Or, instead of passing it in the environment, we can provide a configure cache file, no?

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH v2 1/2 openmpi: add Fortran support for MIPS32

In reply to Vicente Olivert Riera

Hello,

Quoted 4 lines · Vicente Olivert Riera

We include a file containing cached values for Fortran tests that are performed at the configure step. These tests fail when cross-compiling and this is known upstream. See:

Quoted 8 lines

https://www.open-mpi.org/community/lists/users/2013/01/21186.php

In that thread the upstream maintainer admits that "cross compiling OpenMPI is a known issue" and the way to workaround this is to "pre-populate configure's answers to the Fortran tests (so that it doesn't actually have to run anything)"

After discussing with Yann, we have changed your solution to use the "config cache" mechanism of autoconf, which allows to preseed in a file a number of configuration variables. It makes the whole thing a little bit cleaner. It looks like this:

# Enabling Fortran support requires pre-seeding the configure script

# with various values that cannot be guessed, so we provide cache
# files for various architectures.

ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),y)
ifeq ($(BR2_mips)$(BR2_mipsel),y)
OPENMPI_FORTRAN_CONF_CACHE = package/openmpi/openmpi-mips32-fortran.cache else ifeq ($(BR2_mips64)$(BR2_mips64el),y) OPENMPI_FORTRAN_CONF_CACHE = package/openmpi/openmpi-mips64-fortran.cache endif
endif

ifneq ($(OPENMPI_FORTRAN_CONF_CACHE),)
define OPENMPI_COPY_FORTRAN_CACHE

        cp $(OPENMPI_FORTRAN_CONF_CACHE) $(@D)/openmpi-config.cache

endef

OPENMPI_POST_PATCH_HOOKS += OPENMPI_COPY_FORTRAN_CACHE

OPENMPI_CONF_OPTS += \
        --enable-mpi-fortran=yes \
        --cache-file=$(@D)/openmpi-config.cache

else
OPENMPI_CONF_OPTS += --enable-mpi-fortran=no
endif

And the openmpi-mips*-fortran.cache simply contain the list of variables.

I've adjusted your two commits to this mechanism, and applied.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH v2 1/2 openmpi: add Fortran support for MIPS32

Hello Thomas,

Quoted 42 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · Vicente Olivert Riera

We include a file containing cached values for Fortran tests that are performed at the configure step. These tests fail when cross-compiling and this is known upstream. See:

Quoted 8 lines

https://www.open-mpi.org/community/lists/users/2013/01/21186.php

In that thread the upstream maintainer admits that "cross compiling OpenMPI is a known issue" and the way to workaround this is to "pre-populate configure's answers to the Fortran tests (so that it doesn't actually have to run anything)"

After discussing with Yann, we have changed your solution to use the "config cache" mechanism of autoconf, which allows to preseed in a file a number of configuration variables. It makes the whole thing a little bit cleaner. It looks like this:

# Enabling Fortran support requires pre-seeding the configure script

# with various values that cannot be guessed, so we provide cache
# files for various architectures.

ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),y)
ifeq ($(BR2_mips)$(BR2_mipsel),y)
OPENMPI_FORTRAN_CONF_CACHE = package/openmpi/openmpi-mips32-fortran.cache else ifeq ($(BR2_mips64)$(BR2_mips64el),y) OPENMPI_FORTRAN_CONF_CACHE = package/openmpi/openmpi-mips64-fortran.cache endif
endif

ifneq ($(OPENMPI_FORTRAN_CONF_CACHE),)
define OPENMPI_COPY_FORTRAN_CACHE

         cp $(OPENMPI_FORTRAN_CONF_CACHE) $(@D)/openmpi-config.cache

endef

OPENMPI_POST_PATCH_HOOKS += OPENMPI_COPY_FORTRAN_CACHE

OPENMPI_CONF_OPTS += \
         --enable-mpi-fortran=yes \
         --cache-file=$(@D)/openmpi-config.cache
Quoted 8 lines

else
OPENMPI_CONF_OPTS += --enable-mpi-fortran=no
endif

And the openmpi-mips*-fortran.cache simply contain the list of variables.

I've adjusted your two commits to this mechanism, and applied.

ok, perfect. Thanks a lot.

Regards,

Vincent.

Quoted 4 lines

Thanks!

Thomas