Unrecognized function or variable 'gcp' in compiled stand alone application
Mostrar comentarios más antiguos
Hi,
Compiling via mcc i get the following error at runtime (m2022a).
Is there a specific options or compile directive to ensure the paralell toolbox is included in the standalone application?
Unrecognized function or variable 'gcp'.
Error in MatlabThreads.Helper.StartThreadPool (line 28)
'gcp' may have been excluded from the MATLAB search path at compilation due to misuse of the path related mcc flags (-N, -p, -I).
Have the application owner verify that these flags were correctly used.
Contact the application owner for more details.
Thanks
1 comentario
LP
el 24 de Ag. de 2022
Respuestas (2)
Walter Roberson
el 24 de Ag. de 2022
Movida: Walter Roberson
el 24 de Ag. de 2022
0 votos
Notice that the documentation for gcp does not have any Extended Capabilities section. It might not be available in compiled executables.
Instead record the output of the call that creates the pool and use that variable.
4 comentarios
LP
el 24 de Ag. de 2022
Walter Roberson
el 24 de Ag. de 2022
You could attach the pool as UserData to a figure, but that is effectively the same as a global variable.
You could create a static member of a handle class, but that is effectively the same as a persistent variable.
LP
el 24 de Ag. de 2022
Walter Roberson
el 24 de Ag. de 2022
Well if a persistent or global variable is not acceptable then I guess your next option would be to reimplement in a different programming language.
Ed Mitchell
el 24 de Ag. de 2022
0 votos
I would not expect you to need a specific flag to include gcp. I put together a super simple code example:
if(isempty(gcp('nocreate')))
parpool('threads')
end
parfor i=1:10
disp(rand(10))
end
delete(gcp);
and compiled it with:
mcc -m SimpleThreadPoolCompiler.m
When I run it from the command prompt, it works without issue. If you compile this simple example and attempt to run it, do you hit the same error?
Categorías
Más información sobre Parallel Computing Fundamentals en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!