Skip to content

fix : missing include file in hydro_iact.h

Ghost User requested to merge fixes/include_file_missing_gadget2 into master

Compiling on our clusters with the following configure line :

$ ../sources/configure CC=mpicc CFLAGS=-I/ssoft/spack/lafnetscha/opt/spack/x86_E5v2_IntelIB/gcc-5.3.0/metis-5.1.0-zg7ap5yg7nqhkgsu7njnivar7lz3oy4z/include --prefix=/home/culpo/SWIFT/build/../install --enable-optimization --enable-parallel-hdf5 --enable-mpi --with-metis=/ssoft/spack/lafnetscha/opt/spack/x86_E5v2_IntelIB/gcc-5.3.0/metis-5.1.0-zg7ap5yg7nqhkgsu7njnivar7lz3oy4z

we get the following compilation error :

libtool: compile:  mpicc -DHAVE_CONFIG_H -I. -I../../sources/src -I.. -DTIMER -I/ssoft/spack/lafnetscha/opt/spack/x86_E5v2_IntelIB/gcc-5.3.0/szip-2.1-luyic7zykee3mod772n6nixm3ki3ok2o/include -I/ssoft/spack/lafnetscha/opt/spack/x86_E5v2_IntelIB/gcc-5.3.0/zlib-1.2.8-2febcaqqgk6rskb6kw7vljlxjg5dra32/include -I/ssoft/spack/lafnetscha/opt/spack/x86_E5v2_IntelIB/gcc-5.3.0/hdf5-1.8.16-phuidcem3zjts6cynahfbqs3p3zerual/include -I/ssoft/spack/lafnetscha/opt/spack/x86_E5v2_IntelIB/gcc-5.3.0/metis-5.1.0-zg7ap5yg7nqhkgsu7njnivar7lz3oy4z/include -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -march=ivybridge -mavx -Wall -Wextra -Wno-unused-parameter -Werror -MT libswiftsim_la-runner.lo -MD -MP -MF .deps/libswiftsim_la-runner.Tpo -c ../../sources/src/runner.c  -fPIC -DPIC -o .libs/libswiftsim_la-runner.o
In file included from ../../sources/src/hydro.h:35:0,
                 from ../../sources/src/drift.h:29,
                 from ../../sources/src/runner.c:46:
../../sources/src/./hydro/Gadget2/hydro_iact.h: In function ‘runner_iact_vec_force’:
../../sources/src/./hydro/Gadget2/hydro_iact.h:644:26: error: implicit declaration of function ‘max’ [-Werror=implicit-function-declaration]
     pi[k]->force.v_sig = max(pi[k]->force.v_sig, v_sig.f[k]);
                          ^

This small PR seems to fix the issue.

Merge request reports