Compilation error on enzo 2.5 from must refine particles

18 views
Skip to first unread message

Nathan Goldbaum

unread,
Mar 24, 2016, 12:51:20 AM3/24/16
to enzo...@googlegroups.com
Hi all,

I've just tried to compile Enzo using the Intel compilers on Pleiades on Enzo 2.5, and get the following compiler error:


It seems to only happen when compiling with new-problem-types-yes under the intel compilers. Unfortunately the error itself isn't very enlightening, since plenty of other files include Grid.h and are able to be compiled just fine. I also don't see anything particularly special about the includes or include order in Grid_MustRefineParticlesFlagFromList.C.

That said, this is a regression, I'm able to compile just fine on the commit before PR 309 was merged in (specifically on 9c0bd66). I also double checked, and it does look like the "bad" commit reported by hg bisect is the commit that merged in PR 309 (specifically ab70454).

Does anyone understand where this compiler error is coming from?

Thanks for taking a look,

Nathan

Christine Simpson

unread,
Mar 24, 2016, 10:09:14 AM3/24/16
to enzo...@googlegroups.com
Hi Nathan,

Hm, I’ve never seen this error before; I’m not sure what the problem is.  Out of curiosity, does Grid_MustRefineParticlesFlagInRegion.C compile?  It is kind of a sister routine that was put in the code around the same time.

Christine

--
You received this message because you are subscribed to the Google Groups "enzo-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enzo-dev+u...@googlegroups.com.
To post to this group, send email to enzo...@googlegroups.com.
Visit this group at https://groups.google.com/group/enzo-dev.
For more options, visit https://groups.google.com/d/optout.

Matthew Turk

unread,
Mar 24, 2016, 10:12:07 AM3/24/16
to enzo...@googlegroups.com
This looks to me, and I might be wrong, but it looks to me like
there's a C++ standard library being included *after*
macros_and_parameters.h somewhere, which is getting the redefinition
of some templates wrong. So you end up in a situation where you've
got a template, then you redefine int and float, and then you get the
"same" template a second time and it collides.

Nathan Goldbaum

unread,
Mar 24, 2016, 11:52:15 AM3/24/16
to enzo...@googlegroups.com
On Thu, Mar 24, 2016 at 7:09 AM, Christine Simpson <christin...@gmail.com> wrote:
Hi Nathan,

Hm, I’ve never seen this error before; I’m not sure what the problem is.  Out of curiosity, does Grid_MustRefineParticlesFlagInRegion.C compile?  It is kind of a sister routine that was put in the code around the same time.

No, it doesn't compile either.

When I have some time I'm going to try to narrow down the steps to reproduce this, just wanted to ping the list in case anyone had any ideas :)

Greg Meece

unread,
Mar 24, 2016, 12:25:22 PM3/24/16
to enzo...@googlegroups.com
I agree with Matt. 

I haven't tried compiling this myself, but it looks like when NEW_PROBLEM_TYPES is on, Grid.h (47) is including ProblemType.h, which includes <string>, which freaks out because long_int and some other types are being redefined somewhere. The solution is probably to rearrange the include order.

--Greg
Gregory Meece
Michigan State University
Department of Physics and Astronomy
http://galactica.pa.msu.edu/~gmeece

Nathan Goldbaum

unread,
Mar 24, 2016, 9:37:00 PM3/24/16
to enzo...@googlegroups.com
On Thu, Mar 24, 2016 at 9:25 AM, Greg Meece <mee...@gmail.com> wrote:
I agree with Matt. 

I haven't tried compiling this myself, but it looks like when NEW_PROBLEM_TYPES is on, Grid.h (47) is including ProblemType.h, which includes <string>, which freaks out because long_int and some other types are being redefined somewhere. The solution is probably to rearrange the include order.

What confuses me is that almost every other file includes Grid.h, and they compile fine. It's only these particular files where it's an issue...

Just as an update, I was able to trigger this on another machine that has the intel compilers installed. I'd guess that this is a general issue with Enzo 2.5, new problem types, and the intel compilers.

I've tried some variations on rearranging imports in Grid_MustRefineParticlesFlagFromList.C with no luck.

Greg Bryan

unread,
Apr 1, 2016, 10:36:24 AM4/1/16
to enzo...@googlegroups.com
Nathan — Have you tried adding an include to “ErrorExceptions.h” in the offending files?  That seems to be missing compared to other includes and in my test (on mac and Stampede, but not pleiades) it seems to fix the problem.  In fact, it seems that this includes some includes for NEW_PROBLEM_TYPES explicitly to address this problem.  Diff for one file below (just to be clear).

Cheers,
Greg

diff -r 48dfbd3d8632 src/enzo/Grid_MustRefineParticlesFlagInRegion.C
--- a/src/enzo/Grid_MustRefineParticlesFlagInRegion.C   Tue Mar 08 12:23:01 2016 -0500
+++ b/src/enzo/Grid_MustRefineParticlesFlagInRegion.C   Fri Apr 01 10:33:19 2016 -0400
@@ -16,6 +16,7 @@
 
 #include <stdio.h>
 #include <math.h>
+#include "ErrorExceptions.h"
 #include "macros_and_parameters.h"
 #include "typedefs.h"
 #include "global_data.h"

Nathan Goldbaum

unread,
Apr 1, 2016, 10:39:00 AM4/1/16
to enzo...@googlegroups.com
Thank you!

I will update my pull request with this after testing.
Reply all
Reply to author
Forward
0 new messages