ayonga / frost-dev

Fast Robot Optimization and Simulation Toolkit (FROST)
http://ayonga.github.io/frost-dev/
Other
157 stars 63 forks source link

Error running frost_addpath() with MathLink library #43

Open rshum19 opened 4 years ago

rshum19 commented 4 years ago

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 commented 4 years ago

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

nr-codes commented 4 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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

dt1729 commented 1 year ago

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 commented 11 months ago

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 commented 8 months ago

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?