Running h5cc -showconfig | grep tmp H5_CPPFLAGS: -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -DNDEBUG -UH5_DEBUG_API -I/var/tmp/portage/sci-libs/hdf5-1.14.4_p3-r1/work/hdf5-1.14.4-3/src/H5FDsubfiling I see that it has the /var/tmp/portage directory as include directory. Further, downstream codes (in my case sci-physics/rivet) then also include that wrong path.