HELICS 2.8 + Matlab Installation
Morning Everyone,
I attempted a helics 2.8 + Matlab installation using the DBUILD_MATLAB_INTERFACE = ON in the cmake.
The installation worked out perfectly and I got this output during the script execution:
`-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.9.so (found suitable version "3.9.7", minimum required is "3")
-- Building without swig
-- Found Matlab: /usr/local/MATLAB/R2022a/extern/include (found version "9.12") found components: MAIN_PROGRAM
-- Building MATLAB
-- Building without swig
-- Extra /home/ali/cosim2_env/sources/helicsv2.8.0/interfaces/matlab/extra/helicsInputSetDefault.m;/home/ali/cosim2_env/sources/helicsv2.8.0/interfaces/matlab/extra/helicsPublicationPublish.m
-- Git hooks disabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ali/cosim2_env/sources/helicsv2.8.0/build`
My question here is, apparently it found the installation of Matlab, but I am not sure if it is correctly detecting SWIG, which I installed earlier.
Secondly, as I finished running the complete script, I executed helicsStartup() function in Matlab terminal but came across this error:
**>> helicsStartup Loading HELICS (from /home/ali/cosim2_env/matlab)... Warning: The library name is not a valid name. The library will be named "libhelicsSharedLib0x2Eso0x2E20x2E8".
In loadlibrary In helicsStartup (line 56) Error using loadlibrary Could not find file libhelicsSharedLib.so.2.8.
Error in loadlibrary
Error in helicsStartup (line 56) loadlibrary(GetFullPath(fullfile(helicsLibPath, libraryName)));**
I had executed an AddPath() step earlier and my helics/matlab directory actually contains the library file that this is showing as missing.
It appears that I am close to completing the linkage but something is still missing.
My reason here to go with the older installation is that I have to perform an integration with Gridlab-D and Gridlab-D team is not currently supporting helics-3. (They plan to do it in the next release, but not now).
Thanks.
Don't worry about it not using swig -- the cached copy of the swig generated files included in the source download should be fine (I don't think you mentioned anything about modifying the HELICS source code to add functions).
You can skip calling helicsStartup(), all that function does is tries to find where the HELICS library is located. Instead just call the loadlibrary matlab function directly with the full path to the HELICS library (including the name of the HELICS shared library).
Unless you're stuck using the main GridLab-D release package, the feature/1279 branch in the GridLab-D repository should have working HELICS 3 support. Unfortunately we can't keep supporting HELICS 2 indefinitely, and the final bugfix patch release for the HELICS 2 series has already been made; it looks like the GridLab-D feature/1279 branch that adds HELICS 3 support to GridLab-D been around since early 2021 (shortly after the HELICS v3.0.0-alpha.2 test release), so I think at this point it comes down to GridLab-D needing to finish adding support on their end. https://github.com/gridlab-d/gridlab-d/issues/1279 is the issue in their repository related to this.
@nightlark
I understand your pain in looking up for version that is no longer supported. I promise not to raise an issue again on this after this one last time.
I still get the same error:
`>> loadlibrary('/home/ali/cosim2_env/matlab/libhelicsSharedLib.so.2.8.0') Warning: The library name is not a valid name. The library will be named "libhelicsSharedLib0x2Eso0x2E20x2E8".
In loadlibrary Error using loadlibrary Could not find file libhelicsSharedLib.so.2.8.
Error in loadlibrary `
The next Gridlab-D version 5.0 with helics 3.0 support is due to be released in September. It appears that developers have got this working on their end, and if my issue doesn't resolve after this one last time, I will either wait till September or approach that forum.
I feel that my set-up should start working once the library is correctly loaded. So its very close to breakthrough .....
This should be resolved with the recent releases of matHELICS