Matlab error using accelerator mode - matlab

I´m building a complex model in Simulink which took 50 minutes to run completely. I would like to use the accelerator mode but, after install the right version of virtual studio and SDK (http://www.mathworks.com/matlabcentral/answers/96050-how-can-i-set-up-microsoft-visual-studio-2008-express-edition-for-use-with-matlab-7-7-r2008b-on-32) I still have this error:
### Building the Accelerator target for model: deg_final_FAST
### Generating code into build directory: H:\ale peticchia_March2016\Simulink\model\deg_final_FAST_accel_rtw
Warning: Function H:\ale peticchia_March2016\Simulink\model\input.m has
the same name as a MATLAB builtin. We suggest you rename the function to
avoid a potential name conflict.
### Invoking Target Language Compiler on deg_final_FAST.rtw
tlc
-r
H:\ale peticchia_March2016\Simulink\model\deg_final_FAST_accel_rtw\deg_final_FAST.rtw
C:\Program Files\MATLAB\R2008b\rtw\c\accel\accel.tlc
-OH:\ale peticchia_March2016\Simulink\model\deg_final_FAST_accel_rtw
-IC:\Program Files\MATLAB\R2008b\rtw\c\accel
-IH:\ale peticchia_March2016\Simulink\model\deg_final_FAST_accel_rtw\tlc
-IC:\Program Files\MATLAB\R2008b\rtw\c\tlc\mw
-IC:\Program Files\MATLAB\R2008b\rtw\c\tlc\lib
-IC:\Program Files\MATLAB\R2008b\rtw\c\tlc\blocks
-IC:\Program Files\MATLAB\R2008b\rtw\c\tlc\fixpt
-IC:\Program Files\MATLAB\R2008b\stateflow\c\tlc
-aEnforceIntegerDowncast=1
-aFoldNonRolledExpr=1
-aInlineInvariantSignals=0
-aInlineParameters=0
-aLocalBlockOutputs=1
-aRollThreshold=5
-aForceBlockIOInitOptimize=0
-aGenerateReport=0
-aGenCodeOnly=0
-aRTWVerbose=1
-aIncludeHyperlinkInReport=0
-aLaunchReport=0
-aGenerateTraceInfo=0
-aForceParamTrailComments=0
-aGenerateComments=1
-aIgnoreCustomStorageClasses=1
-aIncHierarchyInIds=0
-aMaxRTWIdLen=31
-aShowEliminatedStatements=0
-aIncDataTypeInIds=0
-aInsertBlockDesc=0
-aIgnoreTestpoints=0
-aSimulinkBlockComments=1
-aInlinedPrmAccess="Literals"
-aTargetFcnLib="ansi_tfl_table_tmw.mat"
-aIsPILTarget=0
-aLogVarNameModifier="rt_"
-aGenerateFullHeader=1
-aGenerateTraceInfo=0
-aIgnoreTestpoints=0
-p10000
### Loading TLC function libraries
...
### Initial pass through model to cache user defined code
....
### Caching model source code
......................................................................
### Writing header file deg_final_FAST_acc_types.h
### Writing header file deg_final_FAST_acc.h
### Writing source file deg_final_FAST_acc.c
.
### Writing header file deg_final_FAST_acc_private.h
### Writing source file deg_final_FAST_acc_data.c
### Writing header file rt_nonfinite.h
### Writing source file rt_nonfinite.c
.
### Writing header file rtGetInf.h
### Writing source file rtGetInf.c
### Writing header file rtGetNaN.h
### Writing source file rtGetNaN.c
.
### TLC code generation complete.
Warning: Function H:\ale peticchia_March2016\Simulink\model\input.m has
the same name as a MATLAB builtin. We suggest you rename the function to
avoid a potential name conflict.
.
### Processing Template Makefile: C:\Program Files\MATLAB\R2008b\rtw\c\accel\accel_vcx64.tmf
### deg_final_FAST.mk which is generated from C:\Program Files\MATLAB\R2008b\rtw\c\accel\accel_vcx64.tmf is up to date
### Building deg_final_FAST: .\deg_final_FAST.bat
H:\ale peticchia_March2016\Simulink\model\deg_final_FAST_accel_rtw>call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\/../../VC/vcvarsall" AMD64
Setting environment for using Microsoft Visual Studio 2008 Beta2 x64 tools.
WindowsSdkDir not found
Microsoft (R) Program Maintenance Utility, Version 9.00.21022.08
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
C:\PROGRA~1\MATLAB\R2008b\rtw\c\tools\vctools.mak(8) : fatal error U1052: Datei "ntwin32.mak" nicht gefunden
Stop.
The make command returned an error of 2
'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
operable program or batch file.
### Real-Time Workshop build procedure for model: 'deg_final_FAST' aborted due to an error.
Warning: Function H:\ale peticchia_March2016\Simulink\model\input.m has
the same name as a MATLAB builtin. We suggest you rename the function to
avoid a potential name conflict.
Warning: Function H:\ale peticchia_March2016\Simulink\model\input.m has
the same name as a MATLAB builtin. We suggest you rename the function to
avoid a potential name conflict.
Warning: Function H:\ale peticchia_March2016\Simulink\model\input.m has
the same name as a MATLAB builtin. We suggest you rename the function to
avoid a potential name conflict.
??? Error using ==> Degradation_model_matlab_fast at 27
Problem creating Accelerator MEX file for model 'deg_final_FAST'. Error
returned is:
Error using ==> genMakefileAndBuild at 1079
Error(s) encountered while building model "deg_final_FAST".
Do you have suggestions?
Thanks for your help!
matlab R2008b
win7 64bit

Related

Abaqus UMAT subroutine - error after execution (warning LNK4210?)

I am trying to run my first UMAT subroutine with an ABAQUS job.
Fortran compiler seems to be linked to ABAQUS, since Abaqus command
abaqus verify -user_std
results to pass the check
Abaqus/Standard with user subroutines
...PASS
Continuing...
But trying to run the subroutine, an error occurs. The message file of the job reports:
Abaqus/Standard Analysis exited with an error - Please see the message file for possible error messages if the file exists.*
No message file (.msg) is produced by the software for the job.
The .log file reports the following:
Analysis initiated from SIMULIA established products
Abaqus JOB JOB NAME
Abaqus 2020
Abaqus License Manager checked out the following licenses:
Abaqus/Standard checked out 5 tokens from Flexnet server COMPUTER NAME
<1019 out of 1024 licenses remain available>.
Begin Compiling Abaqus/Standard User Subroutines
21/09/2021 12:15:52
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.3.0 Build ***************
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.
End Compiling Abaqus/Standard User Subroutines
Begin Linking Abaqus/Standard User Subroutines
Creazione della libreria standardU.lib e dell'oggetto standardU.exp
libirc.lib(fast_mem_ops.obj) : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators
End Linking Abaqus/Standard User Subroutines
21/09/2021 12:16:00
Begin Analysis Input File Processor
21/09/2021 12:16:00
Run pre.exe
21/09/2021 12:16:05
End Analysis Input File Processor
Begin Abaqus/Standard Analysis
21/09/2021 12:16:05
Run standard.exe
21/09/2021 12:16:06
Abaqus Error: Abaqus/Standard Analysis exited with an error - Please see the
message file for possible error messages if the file exists.
Begin SIM Wrap-up
21/09/2021 12:16:06
Run SMASimUtility.exe
21/09/2021 12:16:06
End SIM Wrap-up
Abaqus/Analysis exited with errors
I have checked some previous questions on the web, but it's hard to get further for me.
Any contribution is welcome.
Try adding the following to your environment file:
link_sl='LINK /NODEFAULTLIB:LIBCMT.LIB /dll /def:%E /out:%U %F %A %L %B'
Source

VS Code and pytest: Where is the default junit-xml output path defined and why is there one?

I am trying to run a debug the tests of my Python project inside the VS Code interface.
I followed the instruction from VS Code's website using pytest but when trying to run a test the output fails:
============================= test session starts =============================
platform win32 -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: c:\Users\myUserName\Projects\myProjectName
plugins: localserver-0.5.0
collected 1 item
myProjectName\tests\test_static_analysis.py . [100%]
- generated xml file: C:\Users\MYUSERNAME\AppData\Local\Temp\tmp-26696NTXW7ChqfMEN.xml
-
============================== 1 passed in 0.18s ==============================
Error: Error: cannot open file:///c%3A/Users/myUserName/Projects/myProjectName/C. Detail:
Unable to read file 'c:\Users\myUserName\Projects\myProjectName\C' (Error: Unable to resolve
non-existing file 'c:\Users\myUserName\Projects\myProjectName\C')
Error: Error: cannot open file:///c%3A/Users/myUserName/Projects/myProjectName/C. Detail:
Unable to read file 'c:\Users\myUserName\Projects\myProjectName\C' (Error: Unable to resolve
non-existing file 'c:\Users\myUserName\Projects\myProjectName\C')
Maybe VS Code doesn't have the authorization to write in AppData.
What concerns me is why is VS Code launching pytest with a junit-xml output option?
The command actually executed by VS Code is:
c:; cd 'c:\Users\myUserName\Projects\myProjectName'; & 'C:\ProgramData\Anaconda3\envs\venv-myProjectName\python.exe' 'c:\Users\myUserName\.vscode\extensions\ms-python.python-2021.8.1105858891\pythonFiles\lib\python\debugpy\launcher' '53774' '--' 'c:\Users\myUserName\.vscode\extensions\ms-python.python-2021.8.1105858891\pythonFiles\testlauncher.py' 'c:\Users\myUserName\Projects\myProjectName' 'pytest' '--override-ini' 'junit_family=xunit1' '--rootdir' 'c:\Users\myUserName\Projects\myProjectName' '--junit-xml=C:\Users\MYUSERNAME\AppData\Local\Temp\tmp-26696pYh1w3pF2cXx.xml' './myProjectName/tests/test_static_analysis.py::TestStaticAnalysisVesselForceOnLateralCenter::test_pos_surge_on_vessel'
When going in Settings > python.testing.pytestArgs it is empty.
Where is this output path defined?
How can I change it to be in the local working directory?
Do I need to have a junit-xml output? Is it mandatory for VS Code UI to work?

How to fix missing simulink simulation artificats issue when running test in parallel mode?

I have 29 Simulink/Matlab Test. It has a lot of different reference models. Before running a 20 second simulation , it has to load all reference models and create a lot of simulation artifacts in a work folder. A lot of reference model are shared in-between test.
When running one test at a time, I have no issue, all simulation artifact are created and used to run the various simulation. Everything Passes.
When running it all via parallel processing. I have a issue.Some simulation artifact are not built or missing, hence my simulation fails even before running.But surprisingly, not all 29 of them fail. It actually random,last time it was 17, another time it was 22. And it even ran once with 0 fail.
Another note, I only have this issue when running it on a self-hosted computer on Azure-Pipelines for CI purposes.
I would like to fix this issue and reproduce stable test pass/fail results of one at a time run, but on parallel process run. How would I do that?
Error:
2020-11-03T03:16:27.1083996Z Making simulation target "Foo_src_sfun", ...
2020-11-03T03:16:27.1084227Z
2020-11-03T03:16:27.1084361Z
2020-11-03T03:16:27.1084502Z
2020-11-03T03:16:27.1084789Z Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
2020-11-03T03:16:27.1085188Z Copyright (C) Microsoft Corporation. All rights reserved.
2020-11-03T03:16:27.1085441Z
2020-11-03T03:16:27.1085815Z NMAKE : fatal error U1052: file 'Foo_src_sfun.mak' not found
2020-11-03T03:16:27.1086175Z Stop.
2020-11-03T03:16:27.1089399Z ================================================================================
2020-11-03T03:16:27.1089936Z Error occurred in TestSim/testSim(File=test_FooTest1_slx) and it did not run to completion.
2020-11-03T03:16:27.1090308Z
2020-11-03T03:16:27.1090497Z ---------
2020-11-03T03:16:27.1090720Z Error ID:
2020-11-03T03:16:27.1090946Z ---------
2020-11-03T03:16:27.1091254Z 'Slvnv:simcoverage:SimulationFailed'
2020-11-03T03:16:27.1091481Z
2020-11-03T03:16:27.1091669Z --------------
2020-11-03T03:16:27.1091919Z Error Details:
2020-11-03T03:16:27.1092186Z --------------
2020-11-03T03:16:27.1092419Z Error using cvsim
2020-11-03T03:16:27.1092659Z Simulation failed
2020-11-03T03:16:27.1092864Z
2020-11-03T03:16:27.1093112Z Error in testRunner (line 145)
2020-11-03T03:16:27.1093477Z [cvdo, simOutRes] = cvsim(testObj,paramStruct) ;
2020-11-03T03:16:27.1093765Z
2020-11-03T03:16:27.1094034Z Error in TestSim/testSim (line 30)
2020-11-03T03:16:27.1094373Z [cvdo, simOutRes, ErrLog] = testRunner(File,20);
2020-11-03T03:16:27.1094638Z
2020-11-03T03:16:27.1094830Z Caused by:
2020-11-03T03:16:27.1095168Z Error using autobuild_kernel>autobuild_local (line 219)
2020-11-03T03:16:27.1095612Z Unable to create mex function 'Foo_src_sfun.mexw64'
2020-11-03T03:16:27.1096006Z required for simulation.
2020-11-03T03:16:27.1096427Z ================================================================================
Update:
I found that I have also another kind of error, leads pretty much to same result.
2020-11-03T03:18:36.1668328Z Making simulation target "Foo2_src_sfun", ...
2020-11-03T03:18:36.1668601Z
2020-11-03T03:18:36.1668735Z
2020-11-03T03:18:36.1669087Z 'Foo2_src_sfun.bat' is not recognized as an internal or external command,
2020-11-03T03:18:36.1669483Z operable program or batch file.
2020-11-03T03:18:36.1669685Z
2020-11-03T03:18:36.1669892Z >>Removing MiL paths...
2020-11-03T03:18:36.1670104Z >>Done
I made a runSingleTest() that I run before my parallel run. Before running it creates all required model reference mexw64 files in the **/work/sim_artifact folder.
Hence when the parallel run they don't need to create any new files, they either use whats already there or update the files.
I have been having no issue since that change. Just a longer run time because of that repetitive test.

Linking the Intel Math Kernel Library (MKL) with ABAQUS 2019 user-subroutines

I'm currently struggeling with linking / activating the MKL for ABAQUS 2019 user-subroutines. In detail I want to make use of the LAPACK functions dgetrf, dgetrs and xerbla in one of my UMAT subroutines.
While compiling, I get the following error message (hope the German version does not bother you):
LemaitreDamageModel.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "xerbla" in Funktion "solve_for_inverse".
LemaitreDamageModel.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "dgetrf" in Funktion "solve_for_inverse".
LemaitreDamageModel.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "dgetrs" in Funktion "solve_for_inverse".
I then had a look at my Abaqus batch file, which looks like this:
#echo off
IF NOT DEFINED abaqus_intel_compiler (
call "C:\Program Files (x86)\Intel\ifort\compilers_and_libraries\windows\bin\ifortvars.bat" intel64
set abaqus_intel_compiler=1
)
"C:\SIMULIA\CAE\2019\win_b64\code\bin\ABQLauncher.exe" %*
The called batch file ifortvars.bat holds the following line, which looks like the MKL is already poperly incoorporated in the process:
if exist "%BIN_ROOT%..\mkl\bin\mklvars.bat" #call "%BIN_ROOT%..\mkl\bin\mklvars.bat" %C_TARGET_ARCH% %TARGET_VS% %LP64_ILP64%
The file mklvar.bat is definetly there. I also tried to do the call via a direct path to the file, but that also didn't helped.
However, what can I do to get rid of the above error message? Obviously, there is still something wrong with the MKL linking.

VHDL/ModelSim - Could Not Find Entity

I am trying to simulate my VHDL file, but am running into the following error:
# ** Error: (vcom-11) Could not find work.lab1.
#
# ** Error: (vcom-1195) Cannot find expanded name "work.lab1".
#
# ** Error: Unknown expanded name.
# ** Error: VHDL Compiler exiting
# ** Error: c:/altera/12.1/modelsim_ase/win32aloem/vcom failed.
# Error in macro ./DE2_TOP_run_msim_rtl_vhdl.do line 8
# c:/altera/12.1/modelsim_ase/win32aloem/vcom failed.
# while executing
# "vcom -93 -work work"
I compiled the code successfully through both Quartus II and the ModelSim compiler before attempting to simulate. I do have a lab1 entity and architecture in my code (I can even see it in the Design Units tab of the Quartus Project Navigator), so I don't really understand this error. Anyone know what's causing this?
When the simulator is compiling the toplevel (DE2_TOP) it want to know how the used components are like. So, you should have compiled the lowerlevel components before compiling the upperlevel components.
What I do most of the times to fix this is compiling all components in correct order and then use the 'vmake' ('vmake -work work > work.vmake') command of Modelsim to generate a makefile out of the library (work). Once you have the makefile you can execute it with (make -f work.vmake). And all files will be compiled in order.
Note: Verilog is much more relaxed in those things...