matlabpool is not supported because Java is not currently available

5 次查看(过去 30 天)
I'm trying to run MultiStart solver in parallel from my c++ code. I compiled the matlab function containing matlabpool open 16 into a c++ shared library. However, when I call the function from c++ code, I get the following: Error using ==> matlabpool>iVerifyJava at 379 matlabpool is not supported because Java is not currently available.
Error in ==> matlabpool at 92
The shared library was compiled without -nojvm option. I guess, I have to use some additional argument when calling mclInitializeApplication. This is how I call it currently:
const char *args[] = {"-nodesktop", "-nodisplay", "-nosplash"};
if (!mclInitializeApplication(args, 3))
{
std::cerr << "mclInitializeApplication = false";
return false;
}
There is an option -java (<http://www.mathworks.com/help/toolbox/compiler/mclinitializeapplication.html)>, but when I try to use, it doesn't recognize it.
Any ideas?

回答(1 个)

Titus Edelhofer
Titus Edelhofer 2011-7-26
Hi Linar,
for using mclInitializeApplications for a shared library I would usually pass no arguments at all, i.e.,
if (!mclInitializeApplication(NULL, 0))
although I doubt this will make a difference, does it?
Titus
  1 个评论
Linar
Linar 2011-7-26
Hi Titus,
originally I didn't pass any arguments and it didn't work as well.
I was just trying to find out an argument which enables java.
Of course, "-nodesktop", "-nodisplay", "-nosplash" don't do this, but -nodisplay for example helps to get rid of unwanted plots which I found helpful.
Linar

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by