VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot create so file from any Simulink model

Hi,

I try to compile a Simulink model to a .so file so that I can use it in Veristand. However, even the most simple model fails building. Versions: Veristand 2020R3, Model Framework 2020R2, MATLAB/SIMULINK 2018b.

 

r-hans_0-1618821122719.png

 

r-hans_1-1618821169003.png

 

All builds fail with the below error (the complete log is attached): 
C:/PROGRA~1/MATLAB/R2018b/rtw/c/src/rt_logging.c:21:20: fatal error: stdlib.h: No such file or directory

 

The generated makefiles look also suspicious to me, since I find the line 

 

INCLUDES_ADDITIONAL = -I--sysroot=C:\build\17.0\x64\sysroots\core2-64-nilrt-linux\usr\include

 

The given path contains stdlib.h but the macro INCLUDES_ADDITIONAL is not used anywhere.(I attached the makefile as well)

Also the further entries are empty: e,g.

 

TOOLCHAIN_SRCS =
TOOLCHAIN_INCS =
TOOLCHAIN_LIBS =

 

or 

 

###########################################################################
## SYSTEM LIBRARIES
###########################################################################

SYSTEM_LIBS =

 

Is that expected or are the path information missing in my makefiles? Something is fundamentally broken and I cannot figure out what.   Each help is appreciated.

 

PS: Generating a dll works fine, only the *.so linux build is broken. 

PSS: I can enter the include path manually in the configuration pane, but then the build fails in a later stage with:

c:/build/17.0/x64/sysroots/i686-nilrtsdk-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc/x86_64-nilrt-linux/4.9.2/ld.exe: cannot find crti.o: No such file or directory

 

Greetings,

Raphael

Download All
Message 1 of 3
(2,581 Views)

Heya all,

 

Posting this as an intermediate answer - the Eclipse toolchain finds the include files by checking the Environment Variables on the machine. Any variable with /usr/bin can interfere with executables looking at other /usr/bin paths. 

 

I'm currently investigating why this is happening and how to work around this, but in the meantime, I would encourage anyone else who has this issue to confirm:

  • Whether the Eclipse toolchain installed correctly (you should be able to open the executable "C:\Program Files (x86)\National Instruments\Eclipse\17.0\eclipse.exe")
  • That the files exist in C:\build\17.0\x64
  • Nothing interfering is set in the model Custom Code options
  • That the Eclipse/build variables are set correctly in the path variables.
  • That no other /usr/bin paths are set in the Environment Variables of the system

 

Best wishes,

Nick

Message 2 of 3
(2,452 Views)

Many Thanks @NPowl! This work around works for me!

 

Just to highlight again to be crystal clear:

It is not sufficient to move the NI Veristand build path's in the environments "path" variable to the top. All path with the pattern */usr/bin have to be completely remove - from system and user path variables.

0 Kudos
Message 3 of 3
(2,446 Views)