Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running frost_addpath() with MathLink library #43

Open
rshum19 opened this issue Apr 7, 2020 · 12 comments
Open

Error running frost_addpath() with MathLink library #43

rshum19 opened this issue Apr 7, 2020 · 12 comments

Comments

@rshum19
Copy link

rshum19 commented Apr 7, 2020

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

@ysssghtz
Copy link

ysssghtz commented Aug 3, 2020

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

@nr-codes
Copy link

nr-codes commented Sep 13, 2020

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.

@hiepbk
Copy link

hiepbk commented Mar 13, 2021

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

@YanranDing
Copy link

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.

@nr-codes
Copy link

nr-codes commented May 3, 2021

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.

@YanranDing
Copy link

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.

@DT4617
Copy link

DT4617 commented Jun 22, 2022

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

@oldschool24
Copy link

oldschool24 commented Jun 24, 2022

@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.

@DT4617
Copy link

DT4617 commented Jun 28, 2022

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

@dt1729
Copy link

dt1729 commented Oct 16, 2023

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

@Ozzey
Copy link

Ozzey commented Nov 29, 2023

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();

@yaocj97
Copy link

yaocj97 commented Feb 22, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants