Skip to content

Include config.h before math.h in neutrino tests

John Helly requested to merge neutrino_exp10_fix into master

This fixes a compilation failure when running 'make check'. On Cosma, if I run

module purge
module load gnu_comp/11.1.0 openmpi/4.1.1 fftw/3.3.9
module load parallel_hdf5/1.12.0 parmetis/4.0.3
module load gsl/2.4
module load Healpix/3.70  
./configure \
    --disable-ipo \
    --disable-optimization \
    --enable-debug \
    --with-hdf5 \
    --with-fftw \
    --with-parmetis \
    --with-subgrid=EAGLE-XL
make check

I get this type of error message:

In file included from ../../src/black_holes_properties.h:29,
                 from ../../src/swift.h:28,
                 from ../../tests/testNeutrinoCosmology.c:26:
../../src/./black_holes/EAGLE/black_holes_properties.h: In function ‘black_holes_props_init’:
../../src/./black_holes/EAGLE/black_holes_properties.h:393:9: error: implicit declaration of function ‘exp10’ [-Werror=implicit-function-declaration]
  393 |         exp10(parser_get_param_float(params, "EAGLEAGN:fixed_T_above_EoS_dex"));
      |         ^~~~~

It seems to happen because in the tests config.h is included after math.h so __GNU_SOURCE is not defined at that point and exp10 prototypes are missing.

This just puts the #include 'config.h' first.

Merge request reports