A large-scale first-principles simulation of the structure and stability of SrZrO3 and BaZrO3 single-and double-wall nanotubes with different chiralities and diameters was performed using the periodic PBE0 method and the basis set of localized Gaussian-type atomic orbitals. The initial structures of nanotubes were obtained by the rolling up of slabs cut from perovskite bulk phases and consisting of two or four alternating (001) ZrO2, SrO or BaO layers. Significant structural reconstruction was found in 4-layer singe-walled and in double-walled nanotubes. If the distance between the single-wall components of double-walled nanotubes is less than approximately 5.0 angstrom, they inclined to merge to stable polyhedron-shaped tubular objects consisting of blocks with distorted cubic perovskite structure. A comparison of the data obtained with the results of our previous works shows that the stability of perovskite nanotubes with merged walls increases in the following sequence of the parent phases: SrZrO3 <BaZrO3