Build error: size of array is not an integral constant-expression

433 views
Skip to first unread message

Scott Miller

unread,
Apr 25, 2013, 1:57:56 PM4/25/13
to dea...@googlegroups.com
Hi all,

I am wondering if anyone else has seen the build error below.  I'm compiling on a mac with openmpi compilers (gcc version 4.8.1).  The svn log does not show any changes to the 2 files listed since March 7 (cmake changes), and I'm using a cleaned cmake build directory.  

Thanks.

-Scott


In file included from /InstalledPackages/deal.II/deal.II.svn/include/deal.II/grid/tria.h:20:0,
                 from /InstalledPackages/deal.II/deal.II.svn/source/grid/grid_tools.cc:17:
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h: In instantiation of ‘static void dealii::GeometryInfo<dim>::alternating_form_at_vertices(const dealii::Point<spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell], dealii::Tensor<(spacedim - dim), spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell]) [with int spacedim = 1; int dim = 1]’:
/InstalledPackages/deal.II/deal.II.svn/source/grid/grid_tools.cc:1558:9:   required from here
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h:2169:3: error: size of array is not an integral constant-expression
   alternating_form_at_vertices
   ^
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h:2169:3: error: size of array is not an integral constant-expression
[ 96%] Building CXX object source/hp/CMakeFiles/obj_hp.release.dir/mapping_collection.cc.o
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h: In instantiation of ‘static void dealii::GeometryInfo<dim>::alternating_form_at_vertices(const dealii::Point<spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell], dealii::Tensor<(spacedim - dim), spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell]) [with int spacedim = 2; int dim = 2]’:
/InstalledPackages/deal.II/deal.II.svn/source/grid/grid_tools.cc:1558:9:   required from here
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h:2169:3: error: size of array is not an integral constant-expression
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h:2169:3: error: size of array is not an integral constant-expression
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h: In instantiation of ‘static void dealii::GeometryInfo<dim>::alternating_form_at_vertices(const dealii::Point<spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell], dealii::Tensor<(spacedim - dim), spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell]) [with int spacedim = 3; int dim = 3]’:
/InstalledPackages/deal.II/deal.II.svn/source/grid/grid_tools.cc:1558:9:   required from here
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h:2169:3: error: size of array is not an integral constant-expression
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h:2169:3: error: size of array is not an integral constant-expression
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h: In instantiation of ‘static void dealii::GeometryInfo<dim>::alternating_form_at_vertices(const dealii::Point<spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell], dealii::Tensor<(spacedim - dim), spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell]) [with int spacedim = 2; int dim = 1]’:
/InstalledPackages/deal.II/deal.II.svn/source/grid/grid_tools.cc:1558:9:   required from here
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h:2169:3: error: size of array is not an integral constant-expression
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h:2169:3: error: size of array is not an integral constant-expression
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h: In instantiation of ‘static void dealii::GeometryInfo<dim>::alternating_form_at_vertices(const dealii::Point<spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell], dealii::Tensor<(spacedim - dim), spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell]) [with int spacedim = 3; int dim = 2]’:
/InstalledPackages/deal.II/deal.II.svn/source/grid/grid_tools.cc:1558:9:   required from here
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h:2169:3: error: size of array is not an integral constant-expression
/InstalledPackages/deal.II/deal.II.svn/include/deal.II/base/geometry_info.h:2169:3: error: size of array is not an integral constant-expression
make[2]: *** [source/grid/CMakeFiles/obj_grid.release.dir/grid_tools.cc.o] Error 1
make[1]: *** [source/grid/CMakeFiles/obj_grid.release.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 96%] Built target obj_hp.release

Luca Heltai

unread,
Apr 25, 2013, 2:02:55 PM4/25/13
to dea...@googlegroups.com
Ciao Scott,

yes, I have already seen this error. Are you using gcc-mp-4.8 from mac ports? I had the same problem with gcc 4.8, but not with 4.7.

Using mac ports gcc 4.7 solved our issue, but then you have to compile openmpi on your own, because what is passed with mac ports only uses gcc-4.7 for mpif77 and clang for mpicc and mpicxx.

Luca.

--
Luca Heltai <luca....@gmail.com>
http://people.sissa.it/~heltai/
Scuola Internazionale Superiore di Studi Avanzati
Phone: +39 040 3787 449, Office: 622
--
There are no answers, only cross references
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Scott Miller

unread,
Apr 25, 2013, 2:37:45 PM4/25/13
to dea...@googlegroups.com
Hi Luca,

I am not using gcc-mp-4.8 from macports.  My non-mpi gcc is v.4.8.1 from http://hpc.sourceforge.net, and I use it to compile openmpi on my own.  I'll try playing around with compiler versions and see if I can find a work-around.  

-Scott

Scott Miller

unread,
Apr 26, 2013, 5:43:18 AM4/26/13
to dea...@googlegroups.com
Hi,

As per Luca's suggestion, using gcc 4.7.1 was the solution.  The version of OpenMPI did not seem to matter.

-Scott

Matthias Maier

unread,
Apr 26, 2013, 7:09:33 AM4/26/13
to dea...@googlegroups.com
Hi,

Am 26. Apr 2013, 11:43 schrieb Scott Miller <miller....@gmail.com>:

> [...]
>
> I am not using gcc-mp-4.8 from macports. My non-mpi gcc is
> v.4.8.1 from http://hpc.sourceforge.net, and I use it to compile
~~~~~~~

They must be from the future. gcc v. 4.8.1 has yet to be released...


Given the fact that

"Build error: size of array is not an integral constan-expression"

was a regression that was briefly introduced in the development version
that later became 4.8.0, it gets even more interesting...

Best,
Matthias

Francisco Tovar

unread,
Jun 13, 2014, 12:14:56 AM6/13/14
to dea...@googlegroups.com
Hi All

Im experiencing the exactly the same issue.
Im not sure how to use gcc4.7, my current vesion is gcc version 4.8.2 (MacPorts gcc48 4.8.2_2) .
How can I use gcc4.7 just for dealii?   I have other applications that need 4.8
any help is more than welcome
thanks

Wolfgang Bangerth

unread,
Jun 21, 2014, 10:27:05 PM6/21/14
to dea...@googlegroups.com

> Im experiencing the exactly the same issue.
> Im not sure how to use gcc4.7, my current vesion is gcc version 4.8.2
> (MacPorts gcc48 4.8.2_2) .
> How can I use gcc4.7 just for dealii? I have other applications that need 4.8
> any help is more than welcome

What version of deal.II are you using? This would appear to be fixed in the
current development sources.

If you're stuck with some version of deal.II, just replace the place in
geometry_info.h by the following:


template <int spacedim>
static void
alternating_form_at_vertices
(const Point<spacedim> *vertices,
Tensor<spacedim-dim,spacedim> *forms);

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages