Borrar filtros
Borrar filtros

Using mcc to compile code which calls mex files

4 visualizaciones (últimos 30 días)
Tricia
Tricia el 31 de Jul. de 2012
I need to compile code which calls an outside function (GAMS) using mex files. I can compile the code with mcc and receive no errors. However, when I run the executable I get the following error,
sh: gams: command not found
Could not run (null): check gams.path
Error in ==> multistart_GAMS_initializer_v2_1>(parfor body) at 521
Error in ==> parallel_function at 477
Error in ==> multistart_GAMS_initializer_v2_1 at 501
Error in ==> restart at 7
MATGAMS:exec
where gams is the mex file calling the outside program.
gams is in the system folder containing the program, GAMS, to be called. The file pathdef.m is included in the folder from which matlab is being called so that the folder containing gams is on the matlabpath.
This code runs fine when it is not compiled.
My compile command is as follows:
/opt/MATLAB/R2011a/bin/mcc -m -a /opt/gams/23.5.1/gams.m -a /opt/gams/23.5.1/wgdx.m -a /opt/gams/23.5.1/writegdx.m -a /opt/gams/23.5.1/rgdx.m -a /opt/gams/23.5.1/readgdx.m -a /opt/gams/23.5.1/full2sp.m -a /opt/gams/23.5.1/sp2full.m -a /opt/gams/23.5.1/gams.mexa64 -a /opt/gams/23.5.1/gdxInfo.mexa64 -a /opt/gams/23.5.1/rgdx.mexa64 -a /opt/gams/23.5.1/wgdx.mexa64 -R -nodisplay -R -nodesktop

Respuestas (2)

Kaustubha Govind
Kaustubha Govind el 1 de Ag. de 2012
The error says "sh: gams: command not found" - so it seems like the "outside" program is not on the System path?
  6 comentarios
Tricia
Tricia el 4 de Ag. de 2012
No. I have the same problem with a test case without parallelization even when I run it in exactly the same place as the un-compiled code.
Kaustubha Govind
Kaustubha Govind el 6 de Ag. de 2012
Tricia: Sorry, I've run out of ideas. Perhaps you should contact MathWorks Tech Support to see if they have any ideas?

Iniciar sesión para comentar.


Titus Edelhofer
Titus Edelhofer el 6 de Ag. de 2012
Hi,
if you look into the file "multistart_GAMS_initializer_v2_1" that (from your error message) tries to start gams: does it do anything to the system path there? Or does it start some local shell script there (gams.sh or whatsoever) which is not there in the compiled application?
Titus

Categorías

Más información sobre MATLAB Compiler en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by