How to run MATLAB Epanet toolkit in MacOs



I am trying to run my code using MATLAB EPANET Toolkit using a MacOs

It needs .so file, shared object (dynamic) library similar to a DLL on Windows. Is there anyone who has used the epanet toolkit in Mac ?.

Thank you.


Hi, it’s fairly straightforward to build from source repo (community v2.1) - or you can download a pre-built dylib/.h archive here:

hope this helps!


@samhatchett, it works, thank you very much


Hello everyone,

Could you please explain further how to use MATLAB- EPANET on MACOS? I don’t have much experience and have the same problem> Haven’t been able to run it yet. What files are the ones that I need to have on the folder in mac os enviroment and how do I set them up.

Thank you very much.



Its straightforward like sam mentioned, download:
and include it in your matlab-epanet toolkit folder and run the RunTests.m from MATLAB.



Thank you for the help. I have done it and it is giving me the following errors now:

Error using loadlibrary
No supported compiler was found. For options, visit

Error in loadlibrary

Error in epanet>ENLoadLibrary (line 6954)

Error in epanet (line 472)

Error in testFunctions (line 16)

Error in RunTests (line 6)

and this is how my folders looks:

i have placed the start toolkit script out of the main file because that’s how they run it on a youtube tutorial and last time i tried on windows, it worked.

Are you working on smart water networks? I am trying to use model predictive control for chlorine decay response.

Thanks again!


Ok it is working now. My macos was blocking the folder dowloaded for security.

Thabks so much!