M_PI definition not always available to wavetoy-loopcontrol.c

Issue #51 closed
Richard O'Shaughnessy created an issue

In certain situations, I've hit the following error

/home/oshaughn/Numerical/EinsteinToolkit/Cactus/arrangements/Carpet/LoopControl/src/wavetoy-loopcontrol.c:183: error: 'M_PI' undeclared (first use in this function)

Per Frank: "it is probably finding math.h, but M_PI is not declared in that file, at least not from C99 on (it was before). It's strange that nobody found that before, C99 should be standard with Cactus nowadays."

Keyword: c99

Comments (4)

  1. Erik Schnetter
    • changed status to resolved
    • removed comment

    To my knowledge, M_PI is not part of ANSI C, but is part of POSIX. Some compilers disable POSIX compatibility by default. The compiler configurations that we distribute e.g. with the Simulation Factory <http://simfactory.org/> should contain these settings. These may also be good examples for which settings your compiler requires.

    I am not going to modify wavetoy-loopcontrol.c since there is nothing one can do in the source code (except not using M_PI); rather, the compiler options need to be changed.

  2. Erik Schnetter
    • removed comment

    Actually, I am going to disable this source file because it is not used in production simulations, it is only an old example.

  3. Log in to comment