Compilation errors when compiling with GEAR and pressure floor
If I compile the latest version of master
with --with-subgrid=GEAR
, I get a lot of errors from pressure_floor.h
:
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from space_unique_id.c:35:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./black_holes/Default/black_holes_properties.h:22,
from ./black_holes/Default/black_holes.h:25,
from black_holes.h:27,
from space_first_init.c:29:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./black_holes/Default/black_holes_properties.h:22,
from ./black_holes/Default/black_holes.h:25,
from black_holes.h:27,
from space_init.c:29:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from space_regrid.c:30:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from active.h:27,
from runner_doiact_hydro.c:26:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from space_rebuild.c:30:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from space_extras.c:30:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from active.h:27,
from space_split.c:29:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from active.h:27,
from runner_doiact_stars.c:26:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from active.h:27,
from runner_doiact_limiter.c:26:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from space_recycle.c:30:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from runner_main.c:34:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from active.h:27,
from space.c:43:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from space_cell_index.c:30:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
make[3]: *** [Makefile:2168: libswiftsim_la-space_regrid.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:2175: libswiftsim_la-space_unique_id.lo] Error 1
make[3]: *** [Makefile:2196: libswiftsim_la-space_extras.lo] Error 1
In file included from ./pressure_floor.h:48,
from ././hydro/SPHENIX/hydro.h:41,
from ./hydro.h:75,
from ././chemistry/GEAR/chemistry.h:34,
from ./chemistry.h:36,
from ./lightcone/lightcone_particle_io.h:31,
from lightcone/lightcone.h:28,
from engine.h:40,
from active.h:27,
from runner_doiact_black_holes.c:26:
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_get_comoving_pressure’:
././pressure_floor/GEAR/pressure_floor.h:76:17: error: ‘pressure_floor_props’ undeclared (first use in this function)
76 | pressure_floor_props.constants * cosmo->a_inv;
| ^~~~~~~~~~~~~~~~~~~~
././pressure_floor/GEAR/pressure_floor.h:76:17: note: each undeclared identifier is reported only once for each function it appears in
././pressure_floor/GEAR/pressure_floor.h: In function ‘pressure_floor_struct_restore’:
././pressure_floor/GEAR/pressure_floor.h:223:3: error: ‘pressure_floor_props’ undeclared (first use in this function)
223 | pressure_floor_props.n_jeans = pressure_floor->n_jeans;
| ^~~~~~~~~~~~~~~~~~~~
I had a look at that file, and there are several obvious issues: some functions do not get the new struct pressure_floor_props
as argument but use it. Other functions use the struct
name rather than the variable name to access it, which is not valid C syntax.
Edited by Matthieu Schaller