Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: engOpen() always returns 0
Date: Fri, 7 Nov 2008 10:37:01 +0000 (UTC)
Organization: UGent
Lines: 30
Message-ID: <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 1226054221 8787 172.30.248.37 (7 Nov 2008 10:37:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 7 Nov 2008 10:37:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1482055
Xref: news.mathworks.com comp.soft-sys.matlab:499474


My aim is to call Matlab from a java plugin I'm writing.
I was already able to do this some time ago, but since a recent re-install, the very same application just stopped working.

The java application always returns 'Can't open engine' as the native function engOpen(char*) returns 0.

I now tried several approaches:
- calling engOpen("\0") from a simple enginedemo.c program
- calling engOpen(null) from java, using JNA mapped to libeng.so
- calling engine.engOpen() from java, using JMatLink (which uses JNI).

Every time getting an engine pointer = 0
I didn't get any errors compiling enginetest.c or compiling libJMatLink.so.

compiling C example:
gcc $(MIN) $(MLIB) -leng -lmx enginetest.c -o enginetest.out

LD_LIBRARY_PATH points to $(MATLAB)/bin/glnx86
So I'm not getting any linking errors, not when compiling, not when running... but engOpen() just fails to open a matlab engine. It simply returns 0, apparently without any further errors.

What could I be missing here?
Matlab itself works fine when I enter 'matlab' on the command line.

My system:
Fedora 9
gcc 4.3.0
Sun Java 1.6.0_10
Matlab 7.6.0 (R2008a)

Thanks for every hint about what could be going wrong here... I've already lost several days on this problem.