johannep / moodyAPI

The API of Moody: A dynamic mooring library used for coupled station-keeping simulations in OpenFOAM and other hydrodynamic codes.
GNU General Public License v3.0
43 stars 18 forks source link

Windows 10 64bit / Matlab R2018a script edit: moodyAPI.m #2

Closed swampstream closed 5 years ago

swampstream commented 5 years ago

Issue: Script run, path error, file loads incorrectly.

Script's location: ...\moody-2.0.0-Windows\thirdParty\matlabAPI\moodyAPI.m

Does not run properly when running the following script in Matlab R2018a on Windows 10 64bit. C:\moody-2.0.0-Windows\thirdParty\matlabAPI\tutorial\runFromMatlab.m

Script needs to be updated, path correction (main folder), and load dll instead of .so file. In bold below:

function moodyInit(name,X,startTime) if (ismac) loadlibrary('libmoody.dylib','moodyWrapper.h'); else
moodyHome='c:/moody-2.0.0-Windows/'; addpath([moodyHome '/lib']); addpath([moodyHome '/include']);
loadlibrary('libmoody.dll','moodyWrapper.h','includepath',[moodyHome '/include']); end calllib('libmoody','moodyInit',name,length(X),X,startTime);
end

johannep commented 5 years ago

Thanks, I will make a windows-compatible moodyAPI.m in the near future. Probably, the path to moodyHome still need to be input at some point or other by the user.

/johannes

johannep commented 5 years ago

The Matlab interface takes better care of the naming now. I hope this helps. I have not worked with windows myself at the command-line level, but there might still be a problem with sourcing the environment variables and setting the correct paths for all dlls. Moody needs what is found in its bin/ and lib/ and include/ folders. I will close thes issue now.