frost-dev icon indicating copy to clipboard operation
frost-dev copied to clipboard

Error running frost_addpath() with MathLink library

Open rshum19 opened this issue 4 years ago • 12 comments

Hi,

I'm having some issues trying to rung the FROST package. I have followed the instruction on the Frost website but get the following error when trying to run forst_addpath().

>> frost_addpath
Invalid MEX-file '/usr0/home/rshu/matlab_ws/frost-dev/third/mathlink/math.mexa64': libML64i3.so: cannot open shared object file: No such file or directory

Error in initialize_mathlink (line 8)
    math('$Version')

Error in frost_addpath (line 28)
    initialize_mathlink();

My system is Ubuntu 16.04, Matlab R2019a, Mathematica 12. I would really appreciate any help trying to debug this error.

Thank you

rshum19 avatar Apr 07 '20 06:04 rshum19

I also encountered this problem. Have you solved it? Can you help me.....Thank you .

ysssghtz avatar Aug 03 '20 03:08 ysssghtz

Given my version of Mathematica and Matlab, I've had success with opening a terminal in Ubuntu and typing

export LD_LIBRARY_PATH=/usr/local/Wolfram/Mathematica/11.3/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions:$LD_LIBRARY_PATH

to tell Ubuntu where to find libML64i3.so followed by launching Matlab

/usr/local/MATLAB/R2020a/bin/matlab

Try making reasonable modifications given your set up (e.g., replace 11.3 with 12.0 and R2020a with R2019a, which should be enough if you have default install locations for these programs). Also, for a more permanent solution, I used ldconfig and a .conf file to avoid having to do this each time I ran FROST.

HTH.

nr-codes avatar Sep 13 '20 06:09 nr-codes

Given my version of Mathematica and Matlab, I've had success with opening a terminal in Ubuntu and typing

export LD_LIBRARY_PATH=/usr/local/Wolfram/Mathematica/11.3/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions:$LD_LIBRARY_PATH

to tell Ubuntu where to find libML64i3.so followed by launching Matlab

/usr/local/MATLAB/R2020a/bin/matlab

Try making reasonable modifications given your set up (e.g., replace 11.3 with 12.0 and R2020a with R2019a, which should be enough if you have default install locations for these programs). Also, for a more permanent solution, I used ldconfig and a .conf file to avoid having to do this each time I ran FROST.

HTH.

Not work with me, I use ubuntu 16.04 Mathematica 12.0, I add this command LD_LIBRARY_PATH=/usr/local/Wolfram/Mathematica/12.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions:$LD_LIBRARY_PATH export LD_LIBRARY_PATH to .bashrc file but it still errors

hiepbk avatar Mar 13 '21 18:03 hiepbk

The same problem here. I use ubuntu 18.04, Mathematica 11.3, MATLAB R2021a. Added the LD_LIBRARY_PATH in .bashrc and got the error when running frost_addpath() in MATLAB.

YanranDing avatar May 03 '21 20:05 YanranDing

It's been a while since I've done this, but are you able to get this working in a terminal and not from .bashrc? Again, it has been awhile since I wrote my original post, but I think depending on how you are launching Matlab, Matlab might not be inheriting from your .bashrc environment variables.

As for MMA 12.0, there might also be an issue getting things working with MMA 12.0 in that it uses a different library version of MathLink, see #45 .

Again this is all speculative.

nr-codes avatar May 03 '21 21:05 nr-codes

It's been a while since I've done this, but are you able to get this working in a terminal and not from .bashrc? Again, it has been awhile since I wrote my original post, but I think depending on how you are launching Matlab, Matlab might not be inheriting from your .bashrc environment variables.

As for MMA 12.0, there might also be an issue getting things working with MMA 12.0 in that it uses a different library version of MathLink, see #45 .

Again this is all speculative.

It works once I start MATLAB from the command line. Thank you for the comment.

YanranDing avatar May 04 '21 13:05 YanranDing

Hello everyone. Could somebody show how to setup package of "frost-dev" for use step by step ? I tried every step from tutorial and follow instruction still issue and can't use.

Thanks you and Best Regards doctan

DT4617 avatar Jun 22 '22 03:06 DT4617

@doctan-DT I changed in path /usr/local/Wolfram/Mathematica/11.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions MathLink to WSTP. It worked in my case. Also make sure the Mathematica executable "math" is on your Matlab path.

oldschool24 avatar Jun 24 '22 17:06 oldschool24

@oldschool24 Thanks. So i can run now i re-install again can work

DT4617 avatar Jun 28 '22 02:06 DT4617

For Mathematica 13.3.1 I had to find the location of .so file in this case DeveloperKit:

LD_LIBRARY_PATH=/usr/local/Wolfram/Mathematica/13.3/SystemFiles/Links/WSTP/DeveloperKit/Linux-x86-64/CompilerAdditions

and then the code ran fine

dt1729 avatar Oct 16 '23 06:10 dt1729

I am having the same issue, is there any way of fixing this since there is no /usr/local/ file for windows?

Error:

Invalid MEX-file 'C:\frost-dev\frost-dev\third\mathlink\math.mexw64': The specified module could not be found.

Error in initialize_mathlink (line 8) math('$Version')

Error in frost_addpath (line 28) initialize_mathlink();

Ozzey avatar Nov 29 '23 16:11 Ozzey

Ubuntu18.04+Matlab2022b+MMA13.0 Having added [MMA_dir]/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions to LD_LIBRARY_PATH, I met almost the same error as the opener of this issue, but the reported missing file is libWSTP64i4.so

I tried

@doctan-DT I changed in path /usr/local/Wolfram/Mathematica/11.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions MathLink to WSTP. It worked in my case. Also make sure the Mathematica executable "math" is on your Matlab path.

but the message changed to "MathLink connection unexpectedly NULL!", which seems unprecedented on the Internet :)

Can anyone help?

yaocj97 avatar Feb 22 '24 06:02 yaocj97