Error installing deal.ii with candi on CentOS 7 (Error: Error in make p4est)

Hello!

I am Fadhli and I’m learning ASPECT for the first time and I have trouble installing it on my CentOS 7 machine. I received an error while compiling it as shown below:


Once ready, hit enter to continue!


candi tries now to download, configure, build and install:

Project: deal.II-toolchain
Platform: deal.II-toolchain/platforms/supported/centos7.platform

Skipping cmake
Loading dealii-prepare
Skipping opencascade
Skipping parmetis
Skipping hdf5
Fetching p4est 2.3.2
Verifying p4est-2.3.2.tar.gz
p4est-2.3.2.tar.gz: OK(sha256)
p4est-2.3.2.tar.gz already downloaded and verified.
Unpacking p4est-2.3.2.tar.gz
Building p4est 2.3.2
CFLAGS_FAST: -O2
CFLAGS_DEBUG: -O0 -g

This script tries configure and build the p4est library.
Build FAST: /home/fadh/bin/tmp/build/p4est-2.3.2/FAST
Build DEBUG: /home/fadh/bin/tmp/build/p4est-2.3.2/DEBUG
Install FAST: /home/fadh/bin/p4est-2.3.2/FAST
Install DEBUG: /home/fadh/bin/p4est-2.3.2/DEBUG
Checking environment: CFLAGS P4EST_CFLAGS_FAST P4EST_CFLAGS_DEBUG
See output in files …/config.output and …/make.output

Build FAST version in /home/fadh/bin/tmp/build/p4est-2.3.2/FAST
which: no in (/home/fadh/bin/cmake-3.20.5-linux-x86_64/bin:/usr/lib64/openmpi/bin:/usr/local /bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/fadh/.local/bin:/home/fadh/bin)
/home/fadh/bin/tmp/unpack/p4est-2.3.2/configure: line 4056: test: argument expected
configure: WARNING: Static source code checker splint not found
which: no in (/home/fadh/bin/cmake-3.20.5-linux-x86_64/bin:/usr/lib64/openmpi/bin:/usr/local /bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/fadh/.local/bin:/home/fadh/bin)
/home/fadh/bin/tmp/unpack/p4est-2.3.2/sc/configure: line 4015: test: argument expected
configure: WARNING: Static source code checker splint not found
/home/fadh/bin/tmp/unpack/p4est-2.3.2/sc/libb64/cencode.c: In function ‘base64_encode_block’:
/home/fadh/bin/tmp/unpack/p4est-2.3.2/sc/libb64/cencode.c:51:9: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
#pragma GCC diagnostic ignored “-Wimplicit-fallthrough”
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/sc/libb64/cdecode.c: In function ‘base64_decode_block’:
/home/fadh/bin/tmp/unpack/p4est-2.3.2/sc/libb64/cdecode.c:53:9: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
#pragma GCC diagnostic ignored “-Wimplicit-fallthrough”
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c: In function ‘p8est_connectivity_new_torus’:
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:930:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i=0; i<num_vertices3; ++i)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:930:5: note: use option -std=c99 or -std=gnu99 to compile your code
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:947:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int iSegment=0; iSegment<nSegments; ++iSegment)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:949:7: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int j=0; j<nbItems; ++j)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:979:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int iSegment=0; iSegment<nSegments; ++iSegment)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:1049:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int iSegment=0; iSegment<nSegments; ++iSegment)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:1106:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int iSegment=0; iSegment<nSegments; ++iSegment)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:1194:14: error: redefinition of ‘iSegment’
for (int iSegment=0; iSegment<nSegments; ++iSegment)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:1106:14: note: previous definition of ‘iSegment’ was here
for (int iSegment=0; iSegment<nSegments; ++iSegment)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:1194:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int iSegment=0; iSegment<nSegments; ++iSegment)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:1248:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i<=nEdgesPS
nSegments; ++i)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:1255:14: error: redefinition of ‘iSegment’
for (int iSegment=0; iSegment<nSegments; ++iSegment)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:1194:14: note: previous definition of ‘iSegment’ was here
for (int iSegment=0; iSegment<nSegments; ++iSegment)
^
/home/fadh/bin/tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c:1255:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int iSegment=0; iSegment<nSegments; ++iSegment)
^
make[2]: *** [src/libp4est_la-p8est_connectivity.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Error: Error in make p4est


Does anyone know how to fix this? Thank you in advance.

Best,
Fadhli

This is an issue in p4est that we have recently learned about and
documented here:
Make sure compilers are called with C99 flags · Issue #133 · cburstedde/p4est · GitHub

You have two choices:

  • See whether candi allows you to download the p4est dev version rather
    than the 2.3.2 release
  • Make sure you choose a different compiler on that system. I believe
    that you probably chose the Intel compiler, but there is almost
    certainly a version of GCC available on that system that you could
    choose instead.

Best
W.

Hello,

Thanks for your suggestion.

I tried turning on development mode ON in candi.cfg but that didn’t make any difference. I also tried to export gcc within .bashrc but it always reverted back to the intel compiler. Do you have any suggestions on how to add a different compiler?

Best,
Fadhli

That very much depends on the system you are on. You should talk to your
sysadmin. On many systems, you choose the compiler by a
module load …
statement. Which compilers are available can be see by doing
module avail

Best
W.

Candi does not allow you to easily choose the p4est development version at the moment.

Hello,

So I successfully loaded gcc as the compiler then I exported CC=gcc and such and I received this error:
configure: error: MPI C test failed
Error: Error in configure

what should I do?

That’s presumably because you want CC to point to the mpi compiler. My suggestion would be to not set CC at all and let cmake figure it out. (I’m assuming that the error message results from deal.II’s cmake script?)

Best
W.

If I don’t set the compiler variables in .bashrc candi will give me a warning and if I proceed, it will give an Error: Error in configure.

I read on the p4est github page that a new version will release soon. Should I just wait for this and then see?

Waiting might address the issue, but it doesn’t give you a working ASPECT installation as I assume you want :slight_smile:

At the end of the day, if you want to figure out why you get an error is that you have to search for the error message. There will be something that precedes “Error in configure”, and you will have to figure out what that is. The alternative is to use the docker or virtual machine options mentioned in the manual for ASPECT. This way you won’t have to install things yourself.

Best
W.

It should be safe to proceed running candi without setting compiler variables. I do that all the time.