Edit mex configuration programmatically
6 次查看(过去 30 天)
显示 更早的评论
Hi all,
I'd like to be able to edit the mex configuration programatically. There are some recent changes to the configuration options, having moved from mexopts.bat (windows) to xml files. For now let's assume I'm using the newer approach. You can query information regarding the compiler configuration using:
mex.getCompilerConfigurations
There doesn't seem to be a way to use this information to change anything.
My use case is the following. I'd like to use the flag /MDt instead of /MD for Visual Studio 2012. If I do:
COMPFLAGS="$COMPFLAGS /MDt"
The /MD flag that is present overrides the /MDt directive I passed in. Thus it seems that I need to actually remove the /MD flag in the options file.
Any suggestions?
Thanks, Jim
1 个评论
James Tursa
2014-6-18
编辑:James Tursa
2014-6-18
In the past, I have actually opened up the old mexopts.bat file and copied it to a new file with modifications, then used that new file. I don't know how to do something similar under the new scheme where there is apparently no mexopts.bat file to work with.
回答(2 个)
James Tursa
2014-6-18
Can you go into the mexopts directory, copy all of the setup files for the compiler you are using into new files with slightly different names, then edit those new files to get the /MDt option you want? Maybe that will let the mex command see that to use. Under the new scheme, I don't know how to coax the mex command to use that option set though. Maybe make it alphabetically first in the file listing? I don't have a recent version of MATLAB to experiment with for this unfortunately. Maybe you will have to simply edit the existing mexopts files instead of creating copies.
0 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!