Cartographer is a c++ library that provides you SLAM. ROS is not required. That said, if you want data visualization or serialization, ROS is an easy way to get started.
Cartographer lives in
https://github.com/googlecartographer/cartographer/ and can be build and used independently. Inside Google we mostly use the stand alone library as is and have different visualization and data sources wired up to it. Usually each project brings their own 'Bridges' to make use of Cartographer. Unfortunately this library has no well defined public API (something we'd like to fix till EOY), but the most useful entry point is the
MapBuilder - essentially you provide it with a configuration, add trajectories to it and feed them data in the tracking frame. Then you can query it for pose and submaps.