GMLC-TDC / HELICS

Hierarchical Engine for Large-scale Infrastructure Co-Simulation (HELICS)
https://docs.helics.org/en/latest/
BSD 3-Clause "New" or "Revised" License
127 stars 41 forks source link

Improve HELICS support for Matlab on Windows #95

Closed phlptp closed 6 years ago

phlptp commented 6 years ago

We need to be able to produce a binary file that can be used with the windows version of Matlab, in addition to support for a Linux Version. and getting this working on Macs would be advisable as well.

kdheepak commented 6 years ago

Tested the Mac MATLAB extension yesterday and got that working. Latest commits on develop fix it on a Mac. I'll look into Windows next.

kdheepak commented 6 years ago

MATLAB on Windows uses MinGW. I need to figure out if there's a way to use the Visual Studio compiler to build the MATLAB HELICS extension.

phlptp commented 6 years ago

So the mex builder can use any one of a number of different compilers at the matlab users option., these however have distinct options and configurations from whatever was built. Building a C++ library for MEX would require matching compilers, but since we are working with a C library, we can then build with the default compiler in matlab, regardless of which compiler and options we used to to build the library (as long as we build the library correctly)

similarly for octave the library has to be built with the same compiler that built octave itself so we need to run through octave mkoctfile. for the cmake on both I run them through octave and matlab respectively to handle cases where the user has tuned them with default options. So I built it with visual studio and got a mex file generated. Still need to do a few more things to actually get the actual extension instead of assuming something.