MATLAB: Do I receive the error “Model ‘…’ failed to successfully compile … Detected recursive call to slbuild” when trying to compile a model which references other models using a custom target

custommodelreferencessimulink codertarget

I have a custom target which I am modifying and when I attempt to compile my model I received the following error message:
The call to make_rtw_hook, during the exit hook generated the following error:
Model 'Test' failed to successfully compile, any cached results may be incomplete.
The build process will terminate as a result.
Cased by:
Model 'Test' failed to successfully compile, any cached results may be incomplete.
Error due to multiple causes
Detected recursive call to slbuild, which might indicate invalid simultaneous model builds. If only one model build was in progress, and if you previously used dbquit while in MATLAB debugger or pressed Ctrl-C during the build process, please restart the model build.
Error while bringing model refrences of model Test up to date: Detected recursive call to slbuild, which might indicate invalid simultaneous model builds. If only one model build was in progress, and if you previously used dbquit while in MATLAB debugger or pressed Ctrl-C during the build process, please restart the model build.
How would I overcome this error?

Best Answer

From the above error message it appears that the custom target has not been setup to support model references. Check out the following documentation on how to support model references on your custom target: https://www.mathworks.com/help/rtw/ug/support-model-referencing.html