Subject: openmpi: FTBFS: Compilation errors

From: Daniel Schepler <[email-masked]>
Date: Fri, 13 Aug 2010 10:25:31 -0700

Source: openmpi
Version: 1.4.2-3
Severity: serious

From my pbuilder build log:

...
depbase=`echo dt_module.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
        /bin/bash ../../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../../ompi/datatype -I../../opal/include -I../../orte/include -I../../ompi/include -I../../opal/mca/paffinity/linux/plpa/src/libplpa   -I../../../.. -I../.. -
I../../../../opal/include -I../../../../orte/include -I../../../../ompi/include    -DNDEBUG -Wall -g -O2 -finline-functions -fno-strict-aliasing -pthread -fvisibility=hidden -MT dt_module.lo -MD -MP -MF $depbase.Tpo -c -o dt_module.lo 
../../../../ompi/datatype/dt_module.c &&\
        mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../../../ompi/datatype -I../../opal/include -I../../orte/include -I../../ompi/include -I../../opal/mca/paffinity/linux/plpa/src/libplpa -I../../../.. -I../.. -I../../../../opal/include -I../../../../orte/include -
I../../../../ompi/include -DNDEBUG -Wall -g -O2 -finline-functions -fno-strict-aliasing -pthread -fvisibility=hidden -MT dt_module.lo -MD -MP -MF .deps/dt_module.Tpo -c ../../../../ompi/datatype/dt_module.c  -fPIC -DPIC -o 
.libs/dt_module.o
../../../../ompi/datatype/dt_module.c:177: error: expected expression before ')' token
../../../../ompi/datatype/dt_module.c:182: error: expected expression before ')' token
../../../../ompi/datatype/dt_module.c:187: error: expected expression before ')' token
../../../../ompi/datatype/dt_module.c:192: error: expected expression before ')' token
../../../../ompi/datatype/dt_module.c:203: error: expected expression before ')' token
../../../../ompi/datatype/dt_module.c:208: error: expected expression before ')' token
../../../../ompi/datatype/dt_module.c:219: error: expected expression before ')' token
../../../../ompi/datatype/dt_module.c:224: error: expected expression before ')' token
../../../../ompi/datatype/dt_module.c:229: error: expected expression before ')' token
../../../../ompi/datatype/dt_module.c:234: error: expected expression before ')' token
../../../../ompi/datatype/dt_module.c:250: error: expected expression before ')' token
make[3]: *** [dt_module.lo] Error 1
make[3]: Leaving directory `/tmp/buildd/openmpi-1.4.2/build/shared/ompi/datatype'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/buildd/openmpi-1.4.2/build/shared/ompi'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/buildd/openmpi-1.4.2/build/shared'
make: *** [build-shared-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
-- 
Daniel Schepler

---

From: Sebastian Andrzej Siewior <[email-masked]>
Date: Wed, 18 Aug 2010 16:53:44 +0200

tags 592892 + patch
thanks

>../../../../ompi/datatype/dt_module.c:177: error: expected expression before ')' token

In Line 177 OMPI_ALIGNMENT_FORTRAN_LOGICAL1 is not really set, it is:
 /* Size of Fortran 77 LOGICAL*1 */
 #define OMPI_SIZEOF_FORTRAN_LOGICAL1 

which is set by OMPI_F77_CHECK defined in config/f77_check.m4. By now we
are in the middle of the hell. Lets go further.
That macro has the C default for $ofc_type_alignment and replace it with
the Fortran value in the macro OMPI_F77_GET_ALIGNMENT()
config/f77_get_alignment.m4.
The value should be set in third last line

| $2=AS_VAR_GET([type_var])

It was transformed earlier into
| ofc_type_alignment=$ompi_cv_f77_alignment_LOGICALp1
but become something totally differnt,

|ofc_type_alignment=`eval 'as_val=${'type_var'};$as_echo "$as_val"'`

After carefully replacing it with AS_VAR_COPY we get
| eval ofc_type_alignment=\$$as_type_var

which does the job for now. Puh. Now out quick!

Sebastian
>From a3d1266104a98d5f7be6159582017804871df034 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <[email-masked]>
Date: Wed, 18 Aug 2010 16:33:23 +0200
Subject: [PATCH] Add fix for #592892

Signed-off-by: Sebastian Andrzej Siewior <[email-masked]>
---
 debian/patches/fix_ftbfs_bts_592892 |   30 ++++++++++++++++++++++++++++++
 debian/patches/series               |    1 +
 2 files changed, 31 insertions(+), 0 deletions(-)
 create mode 100644 debian/patches/fix_ftbfs_bts_592892

diff --git a/debian/patches/fix_ftbfs_bts_592892 b/debian/patches/fix_ftbfs_bts_592892
new file mode 100644
index 0000000..e29cf55
--- /dev/null
+++ b/debian/patches/fix_ftbfs_bts_592892
@@ -0,0 +1,30 @@
+From 3fa47ccccdc5271e8d522ea708af418c95839dc2 Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <[email-masked]>
+Date: Wed, 18 Aug 2010 15:51:01 +0200
+Subject: [PATCH] openmpi: get it built with newer autoconf
+
+Reported as Debian bug #592892. AS_VAR_GET missbehaves in newer
+autoconf. Since it is deprecated switch to AS_VAR_COPY which gets things
+done right. Both are cursed.
+
+Signed-off-by: Sebastian Andrzej Siewior <[email-masked]>
+---
+ config/f77_get_alignment.m4 |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/config/f77_get_alignment.m4 b/config/f77_get_alignment.m4
+index aa3d318..ba1fb96 100644
+--- a/config/f77_get_alignment.m4
++++ b/config/f77_get_alignment.m4
+@@ -90,7 +90,7 @@ EOF
+                  AC_MSG_ERROR([Could not determine alignment of $1])])])
+         rm -rf conftest*])
+ 
+-    $2=AS_VAR_GET([type_var])
++    AS_VAR_COPY([$2], [type_var])
+     AS_VAR_POPDEF([type_var])dnl
+     OMPI_VAR_SCOPE_POP
+ ])
+-- 
+1.5.6.5
+
diff --git a/debian/patches/series b/debian/patches/series
index dee3552..acca808 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ manpage-errors-macro
 build_hurd
 manpage-spelling-errors
 build_kfreebsd
+fix_ftbfs_bts_592892
-- 
1.5.6.5

---

From: Ralf Wildenhues <[email-masked]>
Date: Wed, 18 Aug 2010 19:31:42 +0200

clone 592892 -1
reassign -1 autoconf
retitle -1 AS_VAR_GET regression
tags -1 + upstream
thanks

[ http://bugs.debian.org/592892 ]

If I got above right, then I'm cloning this bug for Autoconf and
marking it as upstream bug; adding bug-autoconf in Cc:.

> which does the job for now. Puh. Now out quick!

Well, AS_VAR_GET is (intentionally) undocumented, so your use of
AS_VAR_COPY is the right thing to do (which is why I'll leave the
original bug for openmpi).  Still, this is a regression in upstream
Autoconf that I think should be fixed.  The issue is that '*' needs to
be translated to 'p' here and the string treated as literal here:

cat >configure.ac <<\EOF
AC_DEFUN([OMPI_F77_GET_ALIGNMENT],[
    AS_VAR_PUSHDEF([type_var], [ompi_cv_f77_alignment_$1])
    $2=AS_VAR_GET([type_var])
    AS_VAR_POPDEF([type_var])dnl
])

AC_INIT
OMPI_F77_GET_ALIGNMENT([LOGICAL*1], [result])
EOF

autoconf
tail configure

should contain a line like:
  result=$ompi_cv_f77_alignment_LOGICALp1

but instead has something like:
    as_type_var=`$as_echo "ompi_cv_f77_alignment_LOGICAL*1" | $as_tr_sh`
    result=`eval 'as_val=${'type_var'};$as_echo "$as_val"'`

Thanks,
Ralf

---

From: Russ Allbery <[email-masked]>
Date: Wed, 18 Aug 2010 18:03:59 -0700

>     result=`eval 'as_val=${'type_var'};$as_echo "$as_val"'`

This smells like fallout from:

** The macros AS_TR_SH and AS_TR_CPP no longer expand their results.

in 2.66.  I tracked this down in another project the other day.  The other
project was using AR_TR_CPP directly to generate content which was
eventually passed into one of the autoheader macros (like AH_BOTTOM).

I'm not sure why this change was made, but it does seem to be breaking
assumptions made by real-world Autoconf macros.

-- 
Russ Allbery ([email-masked])             <http://www.eyrie.org/~eagle/>