The conventional method to predict the onset of laminar-turbulent transition in convectively unstable boundary-layer flows is based on the logarithmic amplification ratio, the so-called N-factor, of the linear instability waves. To calculate the N-factor, the flow variables are decomposed into a laminar basic state solution and the linear disturbances, which are assumed to be harmonic in time. The most commonly used linear stability analysis approaches include the locally parallel linear stability theory (LST) and the non-local, weakly nonparallel parabolized stability equations (PSE). However, these methods do not account for strong streamwise gradients that are encountered in several configurations of interest, as roughness elements, steps, gaps, or corners. To solve the linear evolution of disturbances along such strongly nonparallel regions, the harmonic linearized Navier-Stokes equations (HLNSE) need to be solved. The discretization of the HLNSE for spanwise/azimuthally inhomogeneous laminar basic states yields a linear system of complex arithmetic with a leading dimension of the order of 107 to 108. A combined multithread and multiprocessor algorithm is implemented for the direct solution of such linear system. Results for a supersonic boundary layer over a three-dimensional roughness patch show good agreement with experimental measurements when the evolution of the instability waves over the roughness patch is included via the HLNSE.