I am trying to use the Simulink Embedded coder to build the blinking LED app on a Raspberry PI. Everything works except the link fails at the end because it cannot resolve the pthread functions. The generated link command is:
gcc -lrt -lpthread -ldl -o ../test.elf devices.c.o LED.c.o test.c.o test_data.c.o MW_raspi_init.c.o MW_Pyserver_control.c.o linuxinitialize.c.o ert_main.c.o -lm -lm -lstdc++
But it should be:
gcc -lrt -lpthread -ldl -o ../test.elf devices.c.o LED.c.o test.c.o test_data.c.o MW_raspi_init.c.o MW_Pyserver_control.c.o linuxinitialize.c.o ert_main.c.o -lm -lm -lstdc++ -lpthread
With the -lpthread being after the list of .o files. If I execute the second command by hand, the link succeeds and the test runs as expected.
Question: How can I fix that, or how can I add -lpthread after the .o files? I am using Matlab 2022 on a MAC and could not find any way of doing it in the Model Configuration Parameters menu.
Thanks