Simulink: fatal error: MQTTAsync.h: No such file or directory - matlab

I am trying to build an MQTT system on a raspberry pi. I was studying about MQTT and read about it a lot. I found a set of MQTT blocks in the Simulink Raspberry Pi Hardware Support Package that I assumed I could directly use. I configured an MQTT server and got all the right credentials and everything but I am now stuck on one part that has left me stumped.
I keep getting this error saying that "fatal error: MQTTAsync.h: No such file or directory". I have looked a lot trying to find anything that might help me but I couldn't. I don't know where to get the necessary files that I need or if there is any solution to sort this. I'm sharing the entire snippet of the error if that is of any help. Thanks in advance.
I apologize I'm not able to get to the whole error into a code block
Error executing command "touch -c /home/pi/MATLAB_ws/R2022a/C/Users/User/Documents/MATLAB/Project_RPi_ert_rtw/*.*;make -f Project_RPi.mk all MATLAB_WORKSPACE="/home/pi/MATLAB_ws/R2022a" -C /home/pi/MATLAB_ws/R2022a/C/Users/User/Documents/MATLAB/Project_RPi_ert_rtw LC_ALL=C". Details:
STDERR: In file included from /home/pi/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/realtime/targets/linux/src/MW_MQTT.c:5:
/home/pi/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/realtime/targets/linux/include/MW_MQTT.h:49:10: fatal error: MQTTAsync.h: No such file or directory
#include <MQTTAsync.h>
^~~~~~~~~~~~~
compilation terminated.
make: *** [Project_RPi.mk:411: MW_MQTT.c.o] Error 1
STDOUT: make: Entering directory '/home/pi/MATLAB_ws/R2022a/C/Users/User/Documents/MATLAB/Project_RPi_ert_rtw'
gcc -c -MMD -MP -MF"MW_MQTT.c.dep" -MT"MW_MQTT.c.o" -O2 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DMW_CAN_BITRATE=500000 -DMW_CAN_ALLOWALLMSGS=1 -DMW_NUM_MQTT_SUBSCRIBE=1 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=0 -D__linux__ -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DSTACK_SIZE=64 -DRT -DMODEL=Project_RPi -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -I/home/pi/MATLAB_ws/R2022a/C/Users/User/Documents/MATLAB -I/home/pi/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/realtime/targets/linux/include -I/home/pi/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/target/shared/svd/include -I/home/pi/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/realtime/targets/raspi/include -I/home/pi/MATLAB_ws/R2022a/C/Users/User/Documents/MATLAB/Project_RPi_ert_rtw -I/home/pi/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/extern/include -I/home/pi/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/simulink/include -I/home/pi/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/rtw/c/src -I/home/pi/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/rtw/c/src/ext_mode/common -I/home/pi/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/rtw/c/ert -I/home/pi/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/toolbox/coder/rtiostream/src/utils -I/home/pi/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/toolbox/target/codertarget/rtos/inc -o "MW_MQTT.c.o" "/home/pi/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/realtime/targets/linux/src/MW_MQTT.c"
make: Leaving directory '/home/pi/MATLAB_ws/R2022a/C/Users/User/Documents/MATLAB/Project_RPi_ert_rtw'

Related

"Fatal error: 'EXTERN.h' file not found" when I install Set::Object in MacBookPro BigSur 11

I'm a totally fresh man in bioinformatics and this is my first time to ask for help in english language web. When I tried to install 'BioPerl' in my MacBookPro BigSur 11.5.2, something strange happened.
Firstly, when doing cpan install BioPerl, it failed and told to me that
one dependency not OK (Graph::Directed); additionally test harness failed
Secondly, I tried to install Graph::Directed, and ...
Result: FAIL
Failed 63/84 test programs. 11/740 subtests failed.
make: *** [test_dynamic] Error 255
ETJ/Graph-0.9724.tar.gz
one dependency not OK (Set::Object); additionally test harness failed
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports ETJ/Graph-0.9724.tar.gz
Thirdly, I installed Set::Object, this failed again...
cc -c -g -pipe -fno-strict-aliasing -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -Os -DVERSION=\"1.41\" -DXS_VERSION=\"1.41\" -iwithsysroot "/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE" Object.c
Object.xs:5:10: fatal error: 'EXTERN.h' file not found
#include "EXTERN.h"
^~~~~~~~~~
1 error generated.
make: *** [Object.o] Error 1
RURBAN/Set-Object-1.41.tar.gz
/usr/bin/make -- NOT OK
After that, I find some answers ("Fatal error: 'EXTERN.h' file not found" while installing Perl modules1) but not work, my perl is 5.30.2 (result of 'perl -v' in terminal) while '/Library/Developer/CommandLineTools/SDKs' just including 'MacOSX10.14.sdk' and 'MacOSX10.15.sdk' (no 'MacOSX11sdk') and when I use
find /Library/Developer/CommandLineTools -name EXTERN.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/EXTERN.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.28/darwin-thread-multi-2level/CORE/EXTERN.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/EXTERN.h
Versions in my Mac maybe in chaos? so I have no idea to solve this question now. That is very upsetting to a new man but I will never give up...
After the failure of all the above, I look for perl 5.30.2 file, and it is in "usr/perl" and "sys/lib", compared with which i "find"(sys/lib/developer/), the "CORE" file is empty and cannot be edited (I want to copy the absent file from 5.28 but failed and does not work). That is the results to those errors. While, I cannot fix it...

Trying to install the mongodb extension (MacOS Big Sur)

When writing this command line
sudo C_INCLUDE_PATH=/usr/local/opt/openssl/include /Applications/XAMPP/xamppfiles/bin/pecl install mongodb
I get this error.
fatal error: 'unicode/usprep.h' file not found
#include <unicode/usprep.h>
^~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [src/libmongoc/src/libmongoc/src/mongoc/mongoc-scram.lo] Error 1
ERROR: `make' failed
It says something with the usprep.h, it took for me days to figure out in many different ways but unfortunately you guys may support me to solve it.

Install CLAPACK-3.2.1 in fedora 23

Hi I use fedora23 to calculate matrix.
So I am trying to install CLAPACK-3.2.1 to my computer.
In the procedure,
1. download clapack.tgz (version 3.2.1) from www.netlib.org/clapack -> done
2. cd CLAPACK-3.2.1 and cp make.inc.example make.inc -> done
3. make f2clib -> done properly
4. make blaslib -> done properly
5. make (this takes a while) -> problem starts here.
in a procedure of make, there are two errors. The error message is this.
make[2]: Leaving directory '/home/optics/CLAPACK/TESTING/EIG'
NEP: Testing Nonsymmetric Eigenvalue Problem routines
./xeigtstz < nep.in > znep.out 2>&1
/bin/sh: line 1: 9412 Segmentation fault (core dumped) ./xeigtstz < nep.in > znep.out 2>&1
Makefile:438: recipe for target 'znep.out' failed
make[1]: *** [znep.out] Error 139
make[1]: Leaving directory '/home/optics/CLAPACK/TESTING'
Makefile:44: recipe for target 'lapack_testing' failed
make: *** [lapack_testing] Error 2
==============================================================================
I cannot understand this. Please help me dealing with these errors.
I have also encountered this problem and was able to resolve it by increasing the stack size using ulimit as suggested here. The following worked for me:
$ sudo ulimit -s 100000
Followed by running make as usual. If you would like a primer on what this command does, check out this question: What does “ulimit -s unlimited” do?. Basically, it increases the limits on the scratch space in memory allocated to a thread.
In Kubuntu 17.10 it worked in this way:
ulimit -s unlimited

Unexpected EOF when linking Arduino project in Eclipse on OS X

I have been trying to link Arduino and Eclipse, and I feel like I'm close.
Where should I start looking for this?
Similar errors have been caused by extra/incomplete quote blocks (according to google searches). I have already dug through my AVR linker settings looking for quotes, but haven't had much luck.
Am I looking in the right place?
Which files should I check?
I have already looked in the file I have written myself (in this case, the basic Arduino blink program).
**** Build of configuration Release for project C64_Arduino1 ****
make all
Building target: C64_Arduino1.elf
Invoking: AVR C++ Linker
avr-gcc --cref -s -Os -o"C64_Arduino1.elf" ./C64_Arduino1.o ./CDC.o ./HID.o
./HardwareSerial.o ./Print.o ./Stream.o ./Tone.o ./USBCore.o ./WInterrupts.o ./WMath.o ./WString.o ./malloc.o ./wiring.o ./wiring_analog.o ./wiring_digital.o ./wiring_pulse.o
./wiring_shift.o -l"Arduino_Mega_2560_or_Mega_ADK" -lm -L/Users/Chet/Desktop/Chet's Shit/Side Projects/Programming/C64_Arduino1/Release -L"/Users/Chet/Desktop/Chet's Shit/Side
Projects/Programming/C64_Arduino1" -mmcu=atmega2560
/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [C64_Arduino1.elf] Error 2
**** Build Finished ****
EDIT:
I have commented out all of my code (including #include's) except the main (which is empty) and I still get the error. I have set up my IDE as specified Here and also Here. Still nothing.
Looking at the actual error message:
/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file
I can see that the problem is most likely due to some kind of Makefile syntax error.
When you write a make rule such like:
foo:
touch foo
What make does, it first checkes whether file called foo exists already, if not, then it runs command /bin/sh -c 'touch foo'. So the line where we said touch foo should have valid shell script syntax.
Looking at the command that you ended up running:
avr-gcc --cref -s -Os -o"C64_Arduino1.elf" ./C64_Arduino1.o ./CDC.o ./HID.o
./HardwareSerial.o ./Print.o ./Stream.o ./Tone.o ./USBCore.o ./WInterrupts.o ./WMath.o ./WString.o ./malloc.o ./wiring.o ./wiring_analog.o ./wiring_digital.o ./wiring_pulse.o
./wiring_shift.o -l"Arduino_Mega_2560_or_Mega_ADK" -lm -L/Users/Chet/Desktop/Chet's Shit/Side Projects/Programming/C64_Arduino1/Release -L"/Users/Chet/Desktop/Chet's Shit/Side
Projects/Programming/C64_Arduino1" -mmcu=atmega2560
I can see that the issue is with the ' character in some of the directory paths. You should either escape it (as in "/Users/Chet/Desktop/Chet\'s Shit") or, as a quick work-around symlink or move the directory.
As a general methodology tip, you should first check whether everything works in CLI, and then move on to teaching Eclipse what commands it should run.
Also, I would consider using the tool called ino instead of make, it might just work with minimum configuration. I have had some experience replacing Arduino IDE with just a Makefile, but it gets hairy when you need to use different boards and perhaps several connected at the same time. Give ino a try, it looks quite promising.

Why can't MATLAB deploytool output exe file?

deploytool works well until creating exe file using mbuild then get this error:
Executing command: mbuild -O -v -output "U1" -I"e:\Mat2009\work\ntst1\U1\src" "e:\Mat2009\work\ntst1\U1\src\U1_main.c" "e:\Mat2009\work\ntst1\U1\src\U1_delay_load.c" "e:\Mat2009\work\ntst1\U1\src\U1_mcc_component_data.c" -link exe -env MCR_DELAYLOAD=/delayload:mclmcrrt710.dll -env
MCR_DELAYLIB=delayimp.lib -outdir "e:\Mat2009\work\ntst1\U1\src"
Error: An error occurred while shelling out to mbuild (error code = -1).
Unable to build executable.
??? Error using ==> mcc
Error executing mcc, return status = 1 (0x1).
How can I resolve this error?
This error looks similar to an error I encountered once (after upgrading to 2012b), I cannot recall the source but I found two potential solutions:
Make sure there are no spaces in the path to the compiler
Try building a few times and cross your fingers
Given the time frame I had I chose to go for option two and after 5-10 attempts it suprisingly worked.
have found that COMSPEC env. var had a wrong value, so I deleted the wrong path, restarted MATLAB then it worked well.