The DEMO Oriented Neutron Source (DONES; DEMO -- DEMOnstration Power Station) is part of the Early Neutron Source (ENS), one of the EUROfusion work packages. The DONES system is designed to provide an accelerator-based D-Li neutron source that produces high energy neutrons at sufficient intensity to simulate the first wall neutron spectrum of future nuclear fusion reactors. The aim of this work was to optimise the superconducting linear accelerator (SRF-L) to meet two requirements at the same time: (a) deliver sufficient energy of the beam at the end of the linac, (b) minimize energy losses. To obtain reliable results, we used two calculation codes: TraceWin and GPT (General Particle Tracer) to simulate the accelerator system. Based on technical data for a four-cryomodule system provided by CEA (French Alternative Energies and Atomic Energy Commission), we investigated 66 variants of the accelerating system. The results were not satisfactory, so the design of the accelerator was changed to add a fifth cryomodule, and subsequently we calculated 13 variants of this new system. Calculation results for beam energy losses, statistical parameters of the beam and beam density in analysed phase spaces were obtained and compared in both codes. At present, the best result obtained is a beam energy of 40.4 MeV with no losses.