dss-extensions / dss_matlab

MATLAB interface to our alternative implementation of OpenDSS, based on the DSS C-API library aiming for full COM compatibility on Windows, Linux and MacOS.
BSD 3-Clause "New" or "Revised" License
11 stars 2 forks source link

Issue setting up DSS_Matlab #7

Closed keithmoffat closed 5 years ago

keithmoffat commented 5 years ago

Very excited to have found this code, but I'm running into an issue setting it up with Matlab on OSX.

The error I get when I run the command "dss = DSS_MATLAB.IDSS;" is below. It's possible I'm missing something easy.

openDSStest Error using loadlibrary There was an error loading the library "/Users/keithmoffat/Documents/MATLAB/Berkeley/Research/LPBC/3phaseLPBC/+DSS_MATLAB/dss_capi_v7" dlopen(/Users/keithmoffat/Documents/MATLAB/Berkeley/Research/LPBC/3phaseLPBC/+DSS_MATLAB/dss_capi_v7.dylib, 6): image not found

Error in DSS_MATLAB.APIUtil (line 27) loadlibrary(DLLfilePath, @DSS_MATLAB.dss_capi_v7_no_thunk);

Error in DSS_MATLAB.IDSS (line 67) obj.apiutil = DSS_MATLAB.APIUtil();

Error in openDSStest (line 6) dss = DSS_MATLAB.IDSS;

Caused by: Error using loaddefinedlibrary dlopen(/Users/keithmoffat/Documents/MATLAB/Berkeley/Research/LPBC/3phaseLPBC/+DSS_MATLAB/dss_capi_v7.dylib, 6): image not found

openDSStest Error using loadlibrary There was an error loading the library "/Users/keithmoffat/+DSS_MATLAB/dss_capi_v7" dlopen(/Users/keithmoffat/+DSS_MATLAB/dss_capi_v7.dylib, 6): image not found

Error in DSS_MATLAB.APIUtil (line 27) loadlibrary(DLLfilePath, @DSS_MATLAB.dss_capi_v7_no_thunk);

Error in DSS_MATLAB.IDSS (line 67) obj.apiutil = DSS_MATLAB.APIUtil();

Error in openDSStest (line 6) dss = DSS_MATLAB.IDSS;

Caused by: Error using loaddefinedlibrary dlopen(/Users/keithmoffat/+DSS_MATLAB/dss_capi_v7.dylib, 6): image not found

PMeira commented 5 years ago

Hi @keithmoffat, Does the file /Users/keithmoffat/Documents/MATLAB/Berkeley/Research/LPBC/3phaseLPBC/+DSS_MATLAB/dss_capi_v7.dylib exist?

If it does, what are your macOS and MATLAB versions?

keithmoffat commented 5 years ago

Hey @PMeira,

That file doesn't exist, but the file dss_capi_v7_no_thunk.m does. I just downloaded the most recent version off the Github and put it in Matlab. In fact, I'm not seeing any .dylib files in the +DSS_MATLAB folder, but perhaps I'm missing something..

I'm running Matlab R2019a in macOS Mojave.

PMeira commented 5 years ago

@keithmoffat Ah, OK. You probably only downloaded the code for DSS_MATLAB itself then. The packages from the releases page include the machine level code for the OpenDSS engine via DSS_CAPI (which is the missing .dylib file):

https://github.com/dss-extensions/dss_matlab/releases/latest

For macOS, more specifically this link here:

image

or here:

image

which leads to

https://github.com/dss-extensions/dss_matlab/releases/download/0.10.3/dss_matlab_v0.10.3_macos_x64.tar.gz

Try one of those, it should work.

As a sidenote, I think the GitHub page is a bit misleading since I got a few emails about installation where users just download the repository code too. Please let me know if you have any suggestions to clarify this for future users. I'm thinking of setting a dedicated page on https://dss-extensions.org/ later.

keithmoffat commented 5 years ago

Yup, that was it!

I found the dss_matlab github from google, and went straight to this page: https://github.com/dss-extensions/dss_matlab , where I clicked the clone or download button for the master branch. Turns out I should have clicked the "releases" tab!

Perhaps putting a note in to do that would help, or putting the necessary .dylib files in the master so if people just download the master directly that will work too.

Thank you for making this! It's exactly what I was looking for so I'm very happy to have found it.

Keith

keithmoffat commented 5 years ago

And one more thing, just in case you're still looking for suggestions.. :)

On the release it says: "If you want some code to play with, you can use the MATLAB examples from the official OpenDSS distribution."

If it's possible to post a download link for a very simple piece of code (i.e. the IEEE 13 node feeder) right in the release statement, for new users to get started with, I'm guessing others in my position would appreciate that too!

PMeira commented 5 years ago

@keithmoffat Great, and thanks for the info. I'll edit the README.md to include a link to proper downloads more clearly.

If it's possible to post a download link for a very simple piece of code (i.e. the IEEE 13 node feeder) right in the release statement, for new users to get started with, I'm guessing others in my position would appreciate that too!

Yeah, we need to work on examples and the documentation as a whole. I'll add a simple example for the IEEE 13 feeder right away though, give me 5-15 minutes and I'll upload it.

PMeira commented 5 years ago

@keithmoffat I added it in https://github.com/dss-extensions/dss_matlab/tree/master/examples/13Bus

I'll update the README to point to it, and it will be included in the download package for the next release.

PMeira commented 5 years ago

Done, also added 13Bus.zip.

keithmoffat commented 5 years ago

Perfect. Thank you @PMeira !