Quantcast
Channel: MATLAB Central Newsreader - tag:"accelerator"
Viewing all 24 articles
Browse latest View live

Re: S-Function custom code with Simulink Accelerator

$
0
0
On 03/03/2017 9:17 AM, Attila wrote:
...

> Matlab 2016a still does not support custom code s-functions within model
> references in accelerator mode.
> Why is Mathwork still not able to provide the "SimUserIncludeDirs" or
> "CustomInclude" parameters to the link process for accelerator mode?
> Can't imaging anything easier.

Has anybody using Simulink ever submitted the enhancement request formally?

--

Problems accelerating a model that works fine in normal mode

$
0
0
Hi, as the subject says, I'm having problems in order to accelerate a Simulink model.
If I run two consecutive simulations without acceleration mode(normal mode on) and with acceleration mode, the model only works* in normal simulation mode.

*it finishes simulation without any error

After running it in acceleration mode I receive these errors:

---------------------------------------------------------------------------
-----------------------[ERRORS]------------------------------------------
---------------------------------------------------------------------------

C:\Users\Oscar\Desktop\Nuevo Imp-Mec efector\slprj\accel\MECH_IMP_VNUEVO_vDELETE3bis3>call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\..\..\VC\bin\vcvars64"
""C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\..\..\VC\bin\vcvars64"" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
 
C:\Users\Oscar\Desktop\Nuevo Imp-Mec efector\slprj\accel\MECH_IMP_VNUEVO_vDELETE3bis3>cd .
 
C:\Users\Oscar\Desktop\Nuevo Imp-Mec efector\slprj\accel\MECH_IMP_VNUEVO_vDELETE3bis3>nmake -f MECH_IMP_VNUEVO_vDELETE3bis3.mk GENERATE_REPORT=0
"nmake" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
 
C:\Users\Oscar\Desktop\Nuevo Imp-Mec efector\slprj\accel\MECH_IMP_VNUEVO_vDELETE3bis3>echo The make command returned an error of 9009
The make command returned an error of 9009
 
C:\Users\Oscar\Desktop\Nuevo Imp-Mec efector\slprj\accel\MECH_IMP_VNUEVO_vDELETE3bis3>An_error_occurred_during_the_call_to_make
"An_error_occurred_during_the_call_to_make" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

---------------------------------------------------------------------------
-----------------------[/ERRORS]------------------------------------------
---------------------------------------------------------------------------

(for more details, watch the piece of code located a few lines later in a .txt file).

I'm using Matlab R2010b.

Next, I paste the output from Matlab console (since I pressed start button until simulation crashed) in a .txt:

http://dl.dropbox.com/u/15482396/output%20after%20simulate%20acceleration%20mode.txt

Well, if I re-configure the compiler setup (I have Visual Studio Express 2010 + SDK installed, and is working fine according to some manuals I've read: i did some test to check if compiler was correctly detected by Matlab R2010b) the Matlab console gives me these lines:


---------------------------------------------------------------------------
-----------------------[COMPILER]------------------------------------------
---------------------------------------------------------------------------

>> mex -setup
Please choose your compiler for building external interface (MEX) files:
 
Would you like mex to locate installed compilers [y]/n? y
 
Select a compiler:
[1] Microsoft Visual C++ 2010 Express in C:\Program Files (x86)\Microsoft Visual Studio 10.0
 
[0] None
 
Compiler: 1
 
Please verify your choices:
 
Compiler: Microsoft Visual C++ 2010 Express
Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0
 
Are these correct [y]/n? y
 
***************************************************************************
  Warning: MEX-files generated using Microsoft Visual C++ 2010 require
           that Microsoft Visual Studio 2010 run-time libraries be
           available on the computer they are run on.
           If you plan to redistribute your MEX-files to other MATLAB
           users, be sure that they have the run-time libraries.
***************************************************************************
 
Trying to update options file: C:\Users\Oscar\AppData\Roaming\MathWorks\MATLAB\R2010b\mexopts.bat
From template: C:\PROGRA~1\MATLAB\R2010b\bin\win64\mexopts\msvc100freeopts.bat
 
Done . . .
 
**************************************************************************
  Warning: The MATLAB C and Fortran API has changed to support MATLAB
           variables with more than 2^32-1 elements. In the near future
           you will be required to update your code to utilize the new
           API. You can find more information about this at:
           http://www.mathworks.com/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9
           Building with the -largeArrayDims option enables the new API.
**************************************************************************

---------------------------------------------------------------------------
-----------------------[/COMPILER]------------------------------------------
---------------------------------------------------------------------------

After doing that, the accelerator mode continues working wrong and gives me the same error...

If it would be a important data, in both cases, after of receving the error from Matlab, I've realised that source files (.h, .c, etc..) have been createad in a folder named "splrj" located in my work folder.

Related pics:
Created folders : http://dl.dropbox.com/u/15482396/03-01-2011%2018-22-28.png

Created files in two different folder:
http://dl.dropbox.com/u/15482396/03-01-2011%2018-30-50.png
and
http://dl.dropbox.com/u/15482396/03-01-2011%2018-28-28.png

The rest of subfolders and folders are empty.

To conclude, I paste some pics of the configuration of my simulink .mdl (only the fields that I consider that can affect to the accelerator mode working -> fields located "Configuration Parameters" with names: "Solver", "Data Import/Export", "Optimization", respectively):

http://dl.dropbox.com/u/15482396/03-01-2011%2018-48-30.png
http://dl.dropbox.com/u/15482396/03-01-2011%2018-48-39.png
http://dl.dropbox.com/u/15482396/03-01-2011%2018-48-50.png


That's all. Thanks in advance.

If anybody knows anything to solve this problem I would be very pleased.... I wait four your response.


Óscar.

Re: Problems accelerating a model that works fine in normal mode

$
0
0
While it may not be the most elegant solution, this is what I do.

1. Run the accelerator and get the error message.

2. Goto "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" and copy nmake.exe.

3. Goto the folder where the accelerator model files are "../slprj/accel/MODELNAME/"
and paste nmake.exe into this folder.

4. Run the accelerator and it should compile. You will now have MODELNAME.mexw64 in your working directory

5. If someone knows of a simpler solution let me know. While this method works, its somewhat annoying.

Re: Simulink accelerator not working!

$
0
0
"Sérgio Cruz" wrote in message <gt9kdh$hrv$1@fred.mathworks.com>...
> "Jeff Koechling" <jckoechling.no.spam@yahoo.no.spam.com> wrote in message <gt7nfh$j6m$1@fred.mathworks.com>...
> > Sergio,
> >
> > Try setting environment variable VS80COMNTOOLS to the same value as VS90COMNTOOLS.
> >
> > Jeff
> >
>
> Jeff!
>
> It works!!!! Finally the accelerator is running in Simulink.
> Thanks a lot for your help! I owe you one :)
>
> Sergio


Hi,
I have the same problem, I use Windows 7 64-bits, but I don't have VS80 neither VS90, I have VS100... What can I do to run accelerator mode??

Thanks!!
Viewing all 24 articles
Browse latest View live