Error in lbfgsAdd (line 21): lbfgsAddC(​y,s,Y,S,ys​,int32(lbf​gs_end)) -- Unrecognized function or variable 'lbfgsAddC'

Running the code from lbfgsAdd.m and I get the error bfgsAdd (line 21): lbfgsAddC(y,s,Y,S,ys,int32(lbfgs_end)) -- Unrecognized function or variable 'lbfgsAddC'. How do I solve this?

4 Comments

No, but ive looked a little more and in the same directory as lbfgsAdd.m is a lbfgsAddC.c is a folder mex and in it is lbfgsAddC.c how do i get this line in lbfgsAdd.m to work
>> demoLearning Unrecognized function or variable 'lbfgsAddC'. Error in lbfgsAdd (line 21) lbfgsAddC(y,s,Y,S,ys,int32(lbfgs_end));
how do i get this line in lbfgsAdd.m to work? Ive tried Chat GPT which told me to type this into the comand line where lbfgsAddC.c i is located: mex lbfgsAddC.c
This than gave me this error: >> mex lbfgsAddC.c
Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its
license agreement.
Error using mex
Supported compiler not detected. For options, visit https://www.mathworks.com/support/compilers.
From there I don't know what to do since I am running R2023b from an Apple Silicon Computer
Can't you do what is suggested in my above link:
solve it with modifying ex1a_linreg.m line 46 to
options = struct('useMex',0);
?
In this case, MATLAB will just use the .m file, not the mex-file.

Sign in to comment.

 Accepted Answer

I ended up solving this by running mex lbfgsAddC.c and then moving the output of that to the same folder as lbfgsAdd.m and it worked. Thanks for the help though!

More Answers (0)

Categories

Products

Asked:

on 13 Jan 2024

Moved:

on 28 Jan 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!