Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: engOpen() always returns 0
Date: Sun, 9 Nov 2008 17:19:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <gf7626$r2i$1@fred.mathworks.com>
References: <gf15od$8ij$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226251142 27730 172.30.248.37 (9 Nov 2008 17:19:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 9 Nov 2008 17:19:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1281511
Xref: news.mathworks.com comp.soft-sys.matlab:499783


Hi Thomas,

I had the same problem a few days ago on the newest Ubuntu distro. I suggest you check the following:

- Do you have csh installed?  engOpen tries to run matlab through csh.

- If csh is present, is matlab on the csh search path?  On my system, Matlab installs to /opt/matlab/bin, with a symlink from /usr/local/share. Neither is on PATH by default (this pertains to bash, I'm just guessing that csh works similarly).

- You should be able to run '/bin/csh -f -c <matlab>' from the command line, where <matlab> is whatever argument you send to engOpen, or simply "matlab" if you send NULL.  This is the command launched by engOpen.

- Finally, if all else fails, put a call to engOpen into a minimal test
program and try 'strace -f ./test-matlab 2>&1 |less'.  You might be able to track down the source of the problem this way.  engOpen forks/clones, the -f argument to strace makes sure it tracks the child process as well. This was at least how I found the problem on my system: the call to csh returned '-1
ENOENT (No such file or directory)'

Regards and good luck,

Boye