Re: [deal.II] University cluster installation issue: compilers

141 views
Skip to first unread message

Wolfgang Bangerth

unread,
Mar 4, 2022, 4:20:50 PM3/4/22
to dea...@googlegroups.com

Stephanie,

> They told me to reinstall using intel/2019.4 as it is more compatible
> with the setup they have. However in this second installation I'm having
> issues with what I think might be the intel compilers in installing
> p4est and subsequently deal.ii. I'm able to install all the other
> packages that I need.

The issue you have here...

> /home/saspark2/build2//tmp/unpack/p4est-2.3.2/src/p8est_connectivity.c(930):
> error: expected an expression
>       for (int i=0; i<num_vertices*3; ++i)
>            ^

...is that in traditional C, you cannot declare variables as part of a
'for' loop like you can in C++. See also

https://stackoverflow.com/questions/1287863/c-for-loop-int-initial-declaration
You can do that since the 1999 C standard, which means that most
compilers now default to supporting this construct. Apparently the Intel
compiler is 23 years behind the times :-( Can you choose which version
of the Intel compiler you want to use? Maybe a newer version defaults to
C99.

If you can't, can you try to do something like
export CFLAGS="-std=c99"
(or whatever flag the Intel compiler wants to select a specific language
standard) before you call the p4est configure script and before
compiling p4est?

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/
Message has been deleted

Wolfgang Bangerth

unread,
Mar 7, 2022, 9:54:42 AM3/7/22
to dea...@googlegroups.com
On 3/4/22 16:51, Stephanie Sparks wrote:
>
> I did try to specify C99 as you suggested

OK, good news that that worked at least.


>but I get a new error now:
>
> /home/saspark2/build2//tmp/unpack/p4est-2.3.2/sc/src/sc_io.c(581): warning
> #266: function "fileno" declared implicitly
>     retval = fsync (fileno (file));
>                     ^
>
> /home/saspark2/build2//tmp/unpack/p4est-2.3.2/sc/src/sc_random.c(153): error:
> identifier "M_PI" is undefined
>         t = tan (M_PI * sc_rand (state));
>                  ^

I'm afraid that you might have to edit these source files yourself. We're not
the authors of p4est, so there is nothing I can fix myself, but I did open
github issues for everything:
https://github.com/cburstedde/libsc/issues/66
https://github.com/cburstedde/libsc/issues/65
https://github.com/cburstedde/p4est/issues/133
I *think* that it should work if you added the #include directives mentioned
in these issues to the two libsc files. This may or may not be enough to get
things compiled...

Stephanie Sparks

unread,
Mar 7, 2022, 2:22:52 PM3/7/22
to deal.II User Group
Thank you Wolfgang!

I added #include <stdio.h> to the sc_io.c file and that fixed the error I was getting for that one.

The #include <math.h> declaration did not seem to work; however, as I still get the same error.

Should I note this on the github issue?

Thanks,
Stephanie

Wolfgang Bangerth

unread,
Mar 7, 2022, 2:57:35 PM3/7/22
to dea...@googlegroups.com
On 3/7/22 12:22, Stephanie Sparks wrote:
>
> The #include <math.h> declaration did not seem to work; however, as I
> still get the same error.
>
> Should I note this on the github issue?

Yes, please do.

You can just put
#define M_PI 3.14159265358979323846264338327950288
anywhere in that file (before the first place where it is used) then.

Timo Heister

unread,
Mar 9, 2022, 12:31:51 PM3/9/22
to dea...@googlegroups.com
Stephanie,

What does "icc -v" return for you? I can compile p4est 2.3.2 with icc
version 19.1.1.217

You can also try an older p4est release like 2.2 instead of having to
fix a bunch of bugs inside the codebase.
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/4892fe8a-1693-acb4-cb6d-7e62af782377%40colostate.edu.



--
Timo Heister
http://www.math.clemson.edu/~heister/

Stephanie Sparks

unread,
Mar 9, 2022, 3:24:09 PM3/9/22
to deal.II User Group
Hi Timo,

I get the following:

icc version 19.0.4.243 (gcc version 4.8.5 compatibility)

I'll try with an older version of p4est now.

Stephanie

Stephanie Sparks

unread,
Mar 9, 2022, 8:00:35 PM3/9/22
to deal.II User Group
I was able to install p4est successfully by

(1) setting CFLAGS="-std=c99"
(2) editing the sc_io.c file per the suggestion on the github issue page opened by Wolfgang
(3) defining the mathematical constants (specifically M_PI, M_PI_4, and M_SQRT2) in each script that used one (a partial list was added to the github issue for this).

Since the install worked I didn't try the older version.

Thanks all!

Stephanie Sparks

unread,
Mar 9, 2022, 11:08:39 PM3/9/22
to deal.II User Group
I have a new (related) problem:

I now can't configure deal.ii (I believe because of the compiler).

Below is the output and attached is the CMakeOutput.log

CMake Error at cmake/setup_compiler_flags_gnu.cmake:25 (MESSAGE):
 

  deal.II requires support for features of C++14 that are not present in

  versions of GCC prior to 5.0.
Call Stack (most recent call first):
  cmake/macros/macro_verbose_include.cmake:19 (INCLUDE)
  cmake/setup_compiler_flags.cmake:113 (VERBOSE_INCLUDE)
  cmake/macros/macro_verbose_include.cmake:19 (INCLUDE)
  CMakeLists.txt:97 (VERBOSE_INCLUDE)


-- Configuring incomplete, errors occurred!
See also "/home/saspark2/build2/tmp/build/deal.II-v9.3.3/CMakeFiles/CMakeOutput.log".
Failure with exit status: 1
Exit message: There was a problem configuring dealii v9.3.3.

If you have any suggestions, I'd greatly appreciate the help.

Thank you,
Stephanie
CMakeOutput.log

Wolfgang Bangerth

unread,
Mar 9, 2022, 11:13:20 PM3/9/22
to dea...@googlegroups.com
On 3/9/22 21:08, Stephanie Sparks wrote:
>
>   deal.II requires support for features of C++14 that are not present in

This is the relevant part of the error message. You need to choose a
sufficiently recent compiler.

Bruno Turcksin

unread,
Mar 10, 2022, 9:01:24 AM3/10/22
to deal.II User Group
Stephanie,

If you are still using the same compiler as before: icc version 19.0.4.243 (gcc version 4.8.5 compatibility) The problem is because of the standard library. The Intel compiler does not have its own standard library, instead it uses the library from gcc. In your case the compiler is icc 19.0 which supports C++14 but the standard library is from gcc 4.8.5 which does not support C++14. Usually the way to fix the problem is to load a newer version of gcc, then icc should use the newer standard library. Right now it probably uses the version from the system gcc, which is really old.

Best,

Bruno

Stephanie Sparks

unread,
Mar 10, 2022, 12:37:21 PM3/10/22
to deal.II User Group
Bruno,

Thanks for that explanation. I was indeed wondering if there was a way to use a newer version of gcc with the Intel compilers.

I'm now trying to figure out how to call icc -gcc-name=/path/to/gcc because I can only load the intel/2019.4 or the updated gcc compilers independently.

I thought I might try to install gcc locally but that is involved as there are many dependencies.

Thanks,
Stephanie

Timo Heister

unread,
Mar 11, 2022, 9:31:47 AM3/11/22
to dea...@googlegroups.com
Providing Intel compilers with a newer GCC is something the cluster as admins should be able to do. It is not as easy as just installing GCC, I would guess.

Stephanie Sparks

unread,
Mar 11, 2022, 9:59:37 AM3/11/22
to deal.II User Group
Yes, the admins are working on the global installation so hopefully it will be up and running soon.

I am able to work on one node with my first installation which is sufficient for my benchmarking needs so far.

Thanks very much for the help.
Reply all
Reply to author
Forward
0 new messages