Hi All,
There seems to be a bit of confusion with the license command in Matlab. It seems that both license('test',toolbox) and license('inuse',toolbox) do not work the way we want.
Originally, we were using license('test',toolbox) to see if a user was licensed to use a certain toolbox. The problem with this is, however, that it does not test to see if the toolbox is actually installed. Though most people will have all toolboxes installed that they are licensed to use, this may not always be the case (for example when running a system-wide version of Matlab on a shared server).
In commit 99292c7601778ceb81134a38cda8c0c134e9f76c, this was changed to use isempty(license('inuse',toolbox)), which tests to see that an toolbox is in use (i.e. checked out) by the current Matlab session. This will return true if you have already made a call to a function from a toolbox in the current Matlab session, but false otherwise (even if you have the toolbox installed and are licensed to use it). You can see this by opening a new Matlab session, then issuing the following commands: isempty(license('inuse','optimization_toolbox')) fsolve isempty(license('inuse','optimization_toolbox'))
The result of the first call to license will be 0 while the second call will return 1.
The proposed solution is to use license('checkout',toolbox), which would actually try to checkout a toolbox. However, before we push yet another change regarding the license command, we wanted to make sure this would work for everyone. Specifically, it seems that Marco had a problem with the original solution and George has a problem with the current solution. So, it would help us out if at least Marco and George could replace the problematic code with that below and tell us if it works for them:
[has_X_toolbox ~] = license('checkout','X_toolbox'); if has_X_toolbox ...
If this works for you, we will update the code in git. Otherwise, please tell us what the problem is.
Best, Houtan
Dear Houtan,
I tried your proposed solution and it is working on the machine I had the problem with license('test',toolbox), so for me the solution
license('checkout','X_toolbox')
is fine.
A nice Xmas break to the DYNARE Team
best Marco
On 12/21/2011 11:08 AM, Houtan Bastani wrote:
Hi All,
There seems to be a bit of confusion with the license command in Matlab. It seems that both license('test',toolbox) and license('inuse',toolbox) do not work the way we want.
Originally, we were using license('test',toolbox) to see if a user was licensed to use a certain toolbox. The problem with this is, however, that it does not test to see if the toolbox is actually installed. Though most people will have all toolboxes installed that they are licensed to use, this may not always be the case (for example when running a system-wide version of Matlab on a shared server).
In commit 99292c7601778ceb81134a38cda8c0c134e9f76c, this was changed to use isempty(license('inuse',toolbox)), which tests to see that an toolbox is in use (i.e. checked out) by the current Matlab session. This will return true if you have already made a call to a function from a toolbox in the current Matlab session, but false otherwise (even if you have the toolbox installed and are licensed to use it). You can see this by opening a new Matlab session, then issuing the following commands: isempty(license('inuse','optimization_toolbox')) fsolve isempty(license('inuse','optimization_toolbox'))
The result of the first call to license will be 0 while the second call will return 1.
The proposed solution is to use license('checkout',toolbox), which would actually try to checkout a toolbox. However, before we push yet another change regarding the license command, we wanted to make sure this would work for everyone. Specifically, it seems that Marco had a problem with the original solution and George has a problem with the current solution. So, it would help us out if at least Marco and George could replace the problematic code with that below and tell us if it works for them:
[has_X_toolbox ~] = license('checkout','X_toolbox'); if has_X_toolbox ...
If this works for you, we will update the code in git. Otherwise, please tell us what the problem is.
Best, Houtan _______________________________________________ Dev mailing list Dev@dynare.org https://www.dynare.org/cgi-bin/mailman/listinfo/dev