I have a collection of $\mathbb{Z}$-modules, each defined by a set of formal generators $x_1, \ldots, x_n$ module a respective set of relations of the form $\sum_j a_i x_i = 0$. I would like to compute the rank of these quotients (more specifically, the torsion-free rank which is the maximal size of any linearly independent set of module elements). There doesn't seem to be a nice closed-form expression for my $\mathbb{Z}$-modules, so I'm attempting to use computer algebra systems to compute the ranks. Right now I've implemented my collections in Magma using its implementation of finitely generated abelian groups, but that's quite slow for large inputs because it actually constructs the underlying group and its associated graph of equivalences.
I'm sure there must be some $\mathbb{Z}$-linear analogue of computing the RREF of my system of relations and some computer algebra system which implements it. If someone could point me to the same I would be grateful.