Re: c++11, mpirxx, and normaliz problem

51 views
Skip to first unread message

Volker Braun

unread,
Nov 18, 2014, 9:54:59 AM11/18/14
to sage-...@googlegroups.com, mpir-...@googlegroups.com
Yes, this is a MPIR bug. In mpir.h, the following takes place:

#define __need_size_t  /* tell gcc stddef.h we only want size_t */
#include <cstddef>     /* for size_t */

As expected from changing implementation macros, his breaks sooner or later:

$ gcc -std=c++11 align.cc
In file included from align.cc:2:0:
/usr/include/c++/4.9.2/cstddef:51:11: error: ‘::max_align_t’ has not been declared
   using ::max_align_t;
           ^

 

On Tuesday, November 18, 2014 2:39:32 PM UTC, Dima Pasechnik wrote:
basically, current (upstream) normaliz does not compile with gcc 4.9.2;
(with Sage 4.5.beta0).
I tracked it down to the following test, showing that mpir(xx) does
something strange...

$ cat b.cpp
#include <mpirxx.h>
int main()
{
    return alignof(std::max_align_t);
}

$ g++   -std=c++11 -c b.cpp
In file included from
/home/scratch/dimpase/sage/sage6.3/local/include/mpir.h:53:0,
                 from
/home/scratch/dimpase/sage/sage6.3/local/include/mpirxx.h:44,
                 from b.cpp:1:
/home/scratch/dimpase/sage/sage6.3/local/include/c++/4.9.2/cstddef:51:11:
error: '::max_align_t' has not been declared
   using ::max_align_t;
           ^
b.cpp: In function 'int main()':
b.cpp:6:20: error: 'max_align_t' is not a member of 'std'
     return alignof(std::max_align_t);

e$ g++ -v
Using built-in specs.
COLLECT_GCC=/home/scratch/dimpase/sage/sage6.3/local/bin/g++
COLLECT_LTO_WRAPPER=/home/scratch/dimpase/sage/sage6.3/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../src/configure
--prefix=/home/scratch/dimpase/sage/sage6.3/local
--with-local-prefix=/home/scratch/dimpase/sage/sage6.3/local
--with-gmp=/home/scratch/dimpase/sage/sage6.3/local
--with-mpfr=/home/scratch/dimpase/sage/sage6.3/local
--with-mpc=/home/scratch/dimpase/sage/sage6.3/local --with-system-zlib
--disable-multilib --disable-nls --enable-languages=c,c++,fortran
--disable-libitm  
Thread model: posix
gcc version 4.9.2 (GCC)


Reply all
Reply to author
Forward
0 new messages