Error reading license file on Mac

77 views
Skip to first unread message

wilson...@gmail.com

unread,
Sep 7, 2019, 11:55:55 AM9/7/19
to SNOPT
Hi, 

I am using Matlab 2019a and trying to install SNOPT. I got the following errors when run the runNPexamples, could anyone help with this? Thanks.

>> setenv('SNOPT_LICENSE','Users\yutongli\Downloads\snopt7.lic');
>> getenv('SNOPT_LICENSE')
ans =
    'Users\yutongli\Downloads\snopt7.lic'
>> runNPexamples
Warning: Name is nonexistent or not a directory: /Applications/util 
> In path (line 109)
  In addpath (line 84)
  In setpath (line 3)
  In runNPexamples (line 4) 
Warning: Name is nonexistent or not a directory: /Applications/examples 
> In path (line 109)
  In addpath (line 84)
  In setpath (line 4)
  In runNPexamples (line 4) 
Warning: Name is nonexistent or not a directory: /Applications/examples/t1diet 
> In path (line 109)
  In addpath (line 84)
  In setpath (line 5)
  In runNPexamples (line 4) 
Warning: Name is nonexistent or not a directory: /Applications/examples/sntoy 
> In path (line 109)
  In addpath (line 84)
  In setpath (line 6)
  In runNPexamples (line 4) 
Warning: Name is nonexistent or not a directory: /Applications/examples/snmain 
> In path (line 109)
  In addpath (line 84)
  In setpath (line 7)
  In runNPexamples (line 4) 
Warning: Name is nonexistent or not a directory: /Applications/examples/hsmain 
> In path (line 109)
  In addpath (line 84)
  In setpath (line 8)
  In runNPexamples (line 4) 
Warning: Name is nonexistent or not a directory: /Applications/examples/hs76 
> In path (line 109)
  In addpath (line 84)
  In setpath (line 9)
  In runNPexamples (line 4) 
Warning: Name is nonexistent or not a directory: /Applications/examples/fmincon 
> In path (line 109)
  In addpath (line 84)
  In setpath (line 10)
  In runNPexamples (line 4) 
Warning: Name is nonexistent or not a directory: /Applications/examples/hs116 
> In path (line 109)
  In addpath (line 84)
  In setpath (line 11)
  In runNPexamples (line 4) 
Warning: Name is nonexistent or not a directory: /Applications/examples/spring 
> In path (line 109)
  In addpath (line 84)
  In setpath (line 12)
  In runNPexamples (line 4) 

============================================================= 
t1diet: Solving diet LP problem using SNOPT ...  

 Begin t1diet problem
 
 SNSPEC EXIT 100 -- finished successfully
 SNSPEC INFO 101 -- SPECS file read

 Trial version of SNOPT -- for evaluation or academic purposes only
Error using snoptmex
Error reading license file
Error in solve_snopt (line 17)
 xstate,Fstate,itn,mjritn] = snoptmex(mexopt, ...
Error in snopt (line 432)
 xstate,Fstate,output] = solve_snopt(istart, stopFun, name, ...
Error in t1diet (line 10)
[x,F,INFO,xmul,Fmul,xstate,Fstate,output]= snopt( x, xlow, xupp, xmul, xstate, ...
Error in runNPexamples (line 8)
t1diet; 

SNOPT

unread,
Sep 8, 2019, 2:29:41 PM9/8/19
to SNOPT
The first issue doesn't have anything to do with the license file.

The messages
"Warning: Name is nonexistent or not a directory: /Applications/util"
seem to indicate your path is not getting set correctly.

When you run 'runNPexamples', that script calls 'setpath' to add the appropriate directories to Matlab's path using pwd.  You should probably not run these scripts in /Applications/.

For the license error, you need to set the path in the correct format.  If you're on a Mac, you should use forward slashes and also included a forward slash at the beginning, e.g.,

setenv('SNOPT_LICENSE','/Users/yutongli/Downloads/snopt7.lic');


--Elizabeth

wilson...@gmail.com

unread,
Sep 9, 2019, 10:29:12 AM9/9/19
to SNOPT
Hi Elizabeth, 

Thanks for the advise and now 'runNPexamples' works. However, I am using YALMIP with SNOPT, and when I run my YALMIP code the following errors show up, could you   please help me to see what is going wrong here? Which "SingleVehNavigate" is the name of my YALMIP matlab file.

>> SingleVehNavigate
Undefined function or variable 'snseti'.
Error in callsnopt (line 71)
snseti('Minimize',1)
Error in optimizer/subsref (line 326)
                eval(['output = ' self.model.solver.call '(self.model);']);
Error in optimizer/subsref (line 9)
    [varargout{1:nargout}] = subsref(self,subs);
Error in AdaptiveSeekController (line 125)
    uout = Controller(currentx,currentr,previousu,sin_sequence,cos_sequence,x_other,y_other);
Error in SingleVehNavigate (line 186)
            ctr = AdaptiveSeekController(vehCurrentState,vehCurrentTarget1,is,vehPreviousctr,
            ones(7,1), zeros(7,1), (vehicleContainer(2).currentPose(1))*ones(7,1),
            (vehicleContainer(2).currentPose(2))*ones(7,1)); 

在 2019年9月8日星期日 UTC-4下午2:29:41,SNOPT写道:

SNOPT

unread,
Sep 12, 2019, 7:04:57 PM9/12/19
to SNOPT
You would have to ask the developers of YALMIP.  I don't know how it works.

--Elizabeth
Reply all
Reply to author
Forward
0 new messages