Hi fran,
I can reproduce your error if I comment out DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:"/Users/acados/lib" from my .zshrc profile.
You are right about the env.sh file, it is sourcing the LD_LIBRARY_PATH which is for linux system, but this shouldn’t be a problem if you have included the acados/lib in the DYLD_LIBRARY_PATH as reported in the Installation guide.
To sum up, if you have acados/lib in the DYLD_LIBRARY_PATH then everything should work.
One thing that you have to check if that you can edit the DYLD_LIBRARY_PATH. In fact, macOS doesn’t allow the user to edit it by default, check this post.
You can check what Matlab exports by executing ! export -p in Matlab Command Window and see if acados is there.
Let me know if you can solve the issue!
Good luck,
Andrea