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

'lbfgsAddC' undefined #3

Open
ChihChengLiang opened this issue Nov 11, 2014 · 4 comments
Open

'lbfgsAddC' undefined #3

ChihChengLiang opened this issue Nov 11, 2014 · 4 comments

Comments

@ChihChengLiang
Copy link

when running octave ex1a_linreg.m get the following error

error: 'lbfgsAddC' undefined near line 21 column 3
error: called from:
error:   /home/~~~~/stanford_dl_ex/common/minFunc_2012/minFunc/lbfgsAdd.m at line 21, column 3
error:   /home/~~~~/stanford_dl_ex/common/minFunc_2012/minFunc/minFunc.m at line 571, column 50
error:   /home/~~~~/stanford_dl_ex/ex1/ex1a_linreg.m at line 47, column 7

solve it with modifying ex1a_linreg.m line 46 to

options = struct('MaxIter', 200,'useMex',0);
@nicsurpatanu
Copy link

or compile the files using common/minFunc_2012/mexAll.m

I had to change mexAll.m to compile without error on Octave 3.8.1 on OS X:

mexAll.m >>>>>>>>>>>>
% minFunc
fprintf('Compiling minFunc files...\n');
mex -o minFunc/compiled/mcholC.mex minFunc/mex/mcholC.c
mex -o minFunc/compiled/lbfgsC.mex minFunc/mex/lbfgsC.c
mex -o minFunc/compiled/lbfgsAddC.mex minFunc/mex/lbfgsAddC.c
mex -o minFunc/compiled/lbfgsProdC.mex minFunc/mex/lbfgsProdC.c

@cx0
Copy link

cx0 commented Apr 4, 2015

Mark Schmidt wrote:

You get the error "??? Undefined function or method 'lbfgsAddC'". This occurs if Matlab can't find the mex file for your operating system. If this occurs, you can either: (i) set 'options.useMex' to 0, or (ii) compile the mex file for your operating system by running the mexAll function. If you end up compiling a file in minFunc for your operating system, please send it to me and I will add to the distribution.

Though, modifying mexAll as to compile all relevant files (lbgfs*.c) solved the issue for me.

@zhangshengshan
Copy link

zhangshengshan commented May 3, 2016

@nicsurpatanu i modify mexAll.m as you did, however when run run mexAll cmd in the octave-cli ,i got a err message like folllows
error_pic
and the mexAll.m is as follow

  1 % minFunc
  2 fprintf('Compiling minFunc files...\n');
  3 mex -o minFunc/compiled minFunc/mex/mcholC.c
  4 mex -o minFunc/compiled minFunc/mex/lbfgsC.c
  5 mex -o minFunc/compiled minFunc/mex/lbfgsAddC.c
  6 mex -o minFunc/compiled minFunc/mex/lbfgsProdC.c
  7```

@zhangshengshan
Copy link

@osoylemez how to compile all relevant files?

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

4 participants