Project

General

Profile

Bug #5460

Mac OS X: Matlab Actors fail in Kepler.app

Added by Christopher Brooks almost 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
actors
Target version:
Start date:
08/14/2011
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
5460

Description

Models that use the Matlab interface fail when started under Mac OS X
by double clicking on Kepler.app.

This is a new Mac running Mac OS X 10.7.

I had to make some changes to Matlab interface, these should be folded
into the Kepler-2.3 tree.

The problem is that in the devel tree,
ant run-only was failing with:

ptolemy.kernel.util.IllegalActionException: .MatlabExpression.MatlabExpression: ptolemy.kernel.util.IllegalActionException: Token 0.0 is of type double
in .MatlabExpression.MatlabExpression
Because:
.MatlabExpression.MatlabExpression: ptolemy.kernel.util.IllegalActionException: Token 0.0 is of type double
at ptolemy.actor.AtomicActor.iterate(AtomicActor.java:500)
at ptolemy.actor.sched.StaticSchedulingDirector.fire(StaticSchedulingDirector.java:188)
at ptolemy.actor.CompositeActor.fire(CompositeActor.java:458)
at ptolemy.actor.Manager.iterate(Manager.java:742)
at ptolemy.actor.Manager.execute(Manager.java:351)
at ptolemy.actor.Manager.run(Manager.java:1111)
at ptolemy.actor.Manager$PtolemyRunThread.run(Manager.java:1641)
Caused by: ptolemy.kernel.util.IllegalActionException: .MatlabExpression.MatlabExpression: ptolemy.kernel.util.IllegalActionException: Token 0.0 is of type double
at ptolemy.matlab.Expression.fire(Expression.java:436)
at ptolemy.actor.AtomicActor.iterate(AtomicActor.java:461)
... 6 more
Caused by: ptolemy.kernel.util.IllegalActionException: .MatlabExpression.MatlabExpression: ptolemy.kernel.util.IllegalActionException: Token 0.0 is of type double
at ptolemy.matlab.Expression.fire(Expression.java:436)
at ptolemy.actor.AtomicActor.iterate(AtomicActor.java:461)
at ptolemy.actor.sched.StaticSchedulingDirector.fire(StaticSchedulingDirector.java:188)
at ptolemy.actor.CompositeActor.fire(CompositeActor.java:458)
at ptolemy.actor.Manager.iterate(Manager.java:742)
at ptolemy.actor.Manager.execute(Manager.java:351)
at ptolemy.actor.Manager.run(Manager.java:1111)
at ptolemy.actor.Manager$PtolemyRunThread.run(Manager.java:1641)

I fixed this in

New Revision: 61797

Modified:
trunk/ptolemy/matlab/Engine.java
trunk/ptolemy/matlab/Expression.java
Log:
Better error messages if time and iteration cannot be set. Properly handle DoubleToken and IntToken in Engine.put(). It is a mystery as to why this bug did appear before.

However, with Kepler-2.3 rc1, I'm not even getting that far.
When I run the SDF MatlabExpression model, I get:

ptolemy.kernel.util.IllegalActionException: matlabEngine.open(null) : can't find Matlab engine. Try starting Matlab by hand as an application to verify that Matlab is set up properly and the license is correct. Under Windows, try running "matlab /regserver", the Matlab C API communicates with Matlab via COM, and apparently the COM interface is not automatically registered when Matlab is installed. Under Linux and other types of UNIX, csh must be installed in /bin/csh.
at ptolemy.matlab.Engine.open(Engine.java:280)
at ptolemy.matlab.Engine.open(Engine.java:232)
at ptolemy.matlab.Expression.preinitialize(Expression.java:303)
at ptolemy.actor.Director.preinitialize(Director.java:1010)
at ptolemy.actor.Director.preinitialize(Director.java:991)
at ptolemy.domains.sdf.kernel.SDFDirector.preinitialize(SDFDirector.java:647)
at ptolemy.actor.CompositeActor.preinitialize(CompositeActor.java:1735)
at ptolemy.actor.Manager.preinitializeAndResolveTypes(Manager.java:983)
at ptolemy.actor.Manager.initialize(Manager.java:643)
at ptolemy.actor.Manager.execute(Manager.java:340)
at ptolemy.actor.Manager.run(Manager.java:1164)
at ptolemy.actor.Manager$3.run(Manager.java:1217)

The Console application reports:

8/14/11 11:17:34.240 AM [0x0-0x156156].org.kepler.build.runner.Kepler: [null] matlab: Command not found.
8/14/11 11:17:34.241 AM [0x0-0x156156].org.kepler.build.runner.Kepler: [null] ptmatlabEngOpen: failed!

However, the matlab directory is in my path, see
https://kepler-project.org/developers/teams/build/setting-up-mac-os-x-to-use-the-matlab-interface


Related issues

Blocked by Kepler - Bug #5459: Kepler 2.3 blocking bugResolved08/14/2011

History

#1 Updated by Christopher Brooks almost 8 years ago

The best way to handle this is to create a symoblic link:
sudo ln -s /Applications/MATLAB_R2011a.app/bin/matlab /usr/bin/matlab
I updated
https://kepler-project.org/developers/teams/build/setting-up-mac-os-x-to-use-the-matlab-interface

Unfortunately, adding a PATH variable to ~/.MacOSX/environment.plist
has the undesired effect of overriding the previous settings, which
in the default is
/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Kepler-2.3/Kepler.app/Contents/Resources/Java/r-2.3.0/lib:/Applications/Kepler-2.3/Kepler.app/Contents/Resources/Java/common-2.3.0/lib/ptolemy/matlab:/Applications/Kepler-2.3/Kepler.app/Contents/Resources/Java/common-2.3.0/lib:/Applications/Kepler-2.3/Kepler.app/Contents/Resources/Java/ptolemy-kepler-2.3.0/lib/ptolemy-lib

One possibility is to set PATH to
/usr/bin:/bin:/usr/sbin:/sbin:/Applications/MATLAB_R2011a.app/bin
but this seems risky since the PATH might include

#2 Updated by Christopher Brooks almost 8 years ago

Reopening this because changes to the Matlab interface need
to be folded in to the 2.3.0 release.

#3 Updated by Derik Barseghian almost 8 years ago

Hey Christopher, I've looked through the changes post 61797 and don't see any obvious reason not to move all the way to 61907 for ptolemy-kepler-2.3. But let me know if you prefer an earlier revision.

#4 Updated by Christopher Brooks almost 8 years ago

Moving to r61797 in the ptII tree seems reasonable.
The ChangeLog is at
http://chess.eecs.berkeley.edu/ptexternal/nightly/ChangeLog.txt

#5 Updated by Derik Barseghian almost 8 years ago

I moved 2.3 to ptII r61797, and at kepler r28349 i updated the ptolemy-kepler-2.3.0 branch. So it should be fixed but Christopher can you verify once I release another set of 2.3.0 installers?

#6 Updated by Christopher Brooks almost 8 years ago

I was able to run the Matlab interface in Kepler-2.3 "rc1". So I'm closing this one.

#7 Updated by Redmine Admin over 6 years ago

Original Bugzilla ID was 5460

Also available in: Atom PDF