04-19-2021 04:00 AM - edited 04-19-2021 04:30 AM
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.
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
05-20-2021 04:58 AM
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:
Best wishes,
Nick
05-20-2021 06:07 AM
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.