Estimating exterior camera parameters by matching lines using least square estimations (Lowe, 1991)
I am not aware of an open implementation of this paper. However, there are other methods to do what you like:


One of them is SoftPosIT is one of them. It has many open implementations available: (1), (2), (3). The downside is that one needs to give some sufficiently close initialization.
If you can live with planar models, then you could use cross ratios for identification. Line-sweep gives one such nice algorithm.
Birdal et. al. also give a simple method for extrinsic camera pose estimation from 2d points not assuming that correspondences are known, but for the moment the open implementation is not available.
Line3D++ gives ability to perform line reconstruction from multi-view images: https://github.com/manhofer/Line3Dpp . This doesn't only solve the extrinsic estimation problem, but camera poses should be an intermediate stage in this work. Maybe one could benefit from such reconstruction and can then calibrate the cameras automatically using the available 3D geometry.


There are also many other 2d-3d pose estimation methods (especially for textureless objects), but for your scenario, where simple geometric primitives suffice, I would go for simpler ones, as aforementioned.