GMLC-TDC / matHELICS

matlab interfaces for HELICS
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Linking HELICS 3.X with Matlab #6

Open StormsHalted opened 2 years ago

StormsHalted commented 2 years ago

Hello,

Earlier, my attempts to integrate Matlab with HELICS 2.8 ended in a fiasco, so, with suggestion from the developers, I decided to move up to HELICS 3.

As, I execute the installation instructions given on: [https://github.com/GMLC-TDC/matHELICS]

I get the following error: (for clarity, I am sharing the exact screenshot)

(Pardon if I did something wrong, I am relatively new to linux)

image

image

Looking forward to your support in this regard.

phlptp commented 2 years ago

What operating system is this on?

StormsHalted commented 2 years ago

What operating system is this on?

It is a Ubuntu 21.10

phlptp commented 2 years ago

staring at this a bit more. it is possible there is a mismatch between the gcc used for compiling and that available in the library used by matlab. Since it appears the libstdc++ is coming from matlab.

can you try strings <<that path used to point to libstdc++.so.6>> | grep GLIBCXX from the command line

You might also try mex -setup C++ and choose an older gcc version if you have one available and then recompile the mex file

nightlark commented 2 years ago

If possible, uploading a copy of helicsMex.mexa64 might help with figuring out what is going on/replicating the issue.

StormsHalted commented 2 years ago

@nightlark

Appears that the mexa64 is not one of the supported types here, so I can email that alternatively.

StormsHalted commented 2 years ago

@phlptp

Here is what happens with using mex -setup C++

image

I am not sure if I am putting the strings line in correct syntax:

image

phlptp commented 2 years ago

You will have to do that second one on the bash command line, not in matlab it is is linux command line, not even sure it works there or if you need to install something to use strings.

nightlark commented 2 years ago

strings is often installed on Linux systems, if it isn't I think the package it comes from is binutils.

The << and >> are being used to show that the text inside is a description of what the argument that replaces those <<>> and everything inside them would be (as in those carrots and all the text inside them will be gone). All that is saying is to run strings on the libstdc++ file given in the error message.

For uploading the mex file, you can probably trick GitHub by making a copy with a supported extension like .png, .txt or similar to upload.

StormsHalted commented 2 years ago

@phlptp

Sorry I missed that it had to be executed on a Command Line.

So here is how I was able to do it:

image

image

image

I get the same result as above, after I execute the buildHelicsInterface(), clearly I am not able to get the syntax correct.

@nightlark

Here is the Zip file of mexa64.

helicsMex.zip

nightlark commented 2 years ago

You left the << and >> characters in the string instead of replacing them -- in the example command given, those are being used to mean replace the descriptive string including those characters with a file; unfortunately << and >> are both valid syntax for bash (redirection operators). A maybe clearer way of putting it is: strings path/that/points/to/libstdc++.so.6 | grep GLIBCXX.

Or run the strings command on the libstdc++.so.6 file, and pipe the output | to the grep command to look for lines starting with GLIBCXX

nightlark commented 2 years ago

Here's a quick screen recording of running the command on two example libstdc++ files on a Linux VM.

asciicast

StormsHalted commented 2 years ago

@nightlark

Thanks for the succinct explanation, My output is exactly the same as yours:

image

StormsHalted commented 2 years ago

Hello Philip and Ryan,

Any leads up till now?

StormsHalted commented 2 years ago

Hello,

Checking back to see if their are any leads on it?

nightlark commented 2 years ago

Sorry, I don't have any updates on this.

I think Philip was going to see if the bug occurs on one of the HPC systems here that already has Matlab installed -- I'm not sure if that has been tested yet.

phlptp commented 1 year ago

As best as we can tell the Matlab interface is behaving normally on Linux now as of the 3.3.0 release. We are going to tag a 3.3.1 release soon to match with the latest HELICS release.

StormsHalted commented 1 year ago

Hi Philip,

Downloaded the newest version from the repo, extracted it and ran buildhelicsinterface() from inside Matlab, got the same error.

image