If the pipe is 4", then you can go right up to the pipe and use an inside mount flange. If it is 3", you need to leave enough gap around it to insert the flange on the pipe. If you leave that gap, you should be able to get enough glue on it through that gap.
If you have access from below, you could attach the flange to a stub of the abs, then anchor it to the floor and attach to the existing cast iron after. A little careful measuring and it should be easy.
When tiling, it's easier to notch the tile where the anchor bolts go than to try to drill through the tile afterwards - you'll probably need a diamond bit.
When the flange is installed at the proper location, getting the closet bolts in or out is easy.