  We compare two cosmological hydrodynamic simulation codes in the context of
hierarchical galaxy formation: The SPH code GADGET, and the Eulerian AMR code
ENZO. Both codes represent dark matter with the N-body method, but use
different gravity solvers and fundamentally different approaches to
hydrodynamics. We compare the GADGET `entropy conserving' SPH formulation with
two ENZO methods: The piecewise parabolic method (PPM), and the artificial
viscosity-based scheme used in the ZEUS code. In this paper we focus on a
comparison of cosmological simulations that follow either only dark matter, or
also adiabatic baryonic gas. The dark matter-only runs agree generally quite
well, provided ENZO is run with a comparatively fine root grid and a low
overdensity threshold for mesh refinement, otherwise the abundance of low-mass
halos is suppressed. This is due to the hierarchical particle-mesh method used
to compute gravitational forces in ENZO, which tends to deliver lower force
resolution than the tree algorithm of GADGET. At comparable force resolution,
we find that the latter offers substantially better performance and lower
memory consumption than the present gravity solver in ENZO. In simulations that
include adiabatic gas dynamics, we find general agreement in the distribution
functions of temperature, entropy, and density for gas of moderate to high
overdensity, as found inside dark matter halos. However, there are some
significant differences at lower overdensities. We argue that these
discrepancies are presumably owing to differences in the shock-capturing
abilities of the different methods. In particular, ZEUS hydro leads to some
unphysical heating at early times in preshock regions. Overall, the GADGET
hydro results are bracketed by those for ENZO/ZEUS and ENZO/PPM. (abridged)
