SUNDIALS solvers interface into Matlab.
7 views (last 30 days)
Show older comments
Error using mex
MEX cannot find library 'sundials_cvode', specified with the -l option.
MEX searched for a file with one of the following names:
libsundials_cvode.lib
sundials_cvode.lib
Verify the library name is correct. If the library is not
on the existing path, specify the path with the -L option.
I am getting the above error while executing the mex. the library name is "libsundials_cvode.a". Do I need to change the extension to ".lib" or the error is something else.
I am trying to create the sundials interface into MATLAB. I know the latest versions of MATALAB have sundials configured in it. Just doing it for a learning.
3 Comments
dpb
on 24 Mar 2025
Edited: dpb
on 24 Mar 2025
My old eyes can't read that and can't do anything with an image, anyways...need to see the actual make file; probably better to link to the source of what you're trying to build so folks have some klew as to what you actually started with...maybe it's bum.
As noted, the simplest fix, presuming the lib file was actually made correctly (which may be a big assumption, we can't tell) is to simply rename the .a lib file to match the link lib name--of course, that means starting at the link step and not rebuilding the whole thing which would simply recreate the .a version.
As noted earlier, this indicates something is broken in the make file but we can't see it from here...whoever created/posted it would be the one/place to turn to.
Accepted Answer
Walter Roberson
on 24 Mar 2025
You appear to be using MS Windows. MS Windows does not use the .a file extension -- the .a file extension is for statically linked libraries on Linux and MacOS.
In order to link .dll files, the executable must be linked against a .lib file
If all you have are .dll files and .a files then you cannot successfully link in Windows -- the .a will be ignored in Windows and the .dll need .lib
10 Comments
dpb
on 25 Mar 2025
Edited: dpb
on 25 Mar 2025
Impolite and improper use of tags to use contributors...and I know nobody in the area, anyways. One would suppose there are support groups associated with the MSYS organization.
Somewhere in the bowels of that downloaded folder C:/msys64/home/z0052r2r/sundials will be the actual make file that is being run; it would be interesting to look into it and turn on a verbose mode flag for compiler switches to see what it shows... for gcc that would be "-v", it's been so long since used MS VC I don't recall which it is there.
I had to rebuild the machine a while back and haven't yet gotten around to reinstalling the compiler(s) so don't have anything to play with here at the moment...
More Answers (0)
See Also
Categories
Find more on MATLAB Support for MinGW-w64 C/C++ Compiler in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
