MATLAB Answers

Bill Chou

MATLAB Coder: How do I setup the environment variables on ARM targets to point to the ARM Compute Library?

Asked by Bill Chou
on 10 Apr 2019
Latest activity Commented on by Davide Buellis on 25 Sep 2019 at 7:34
I see a few deep learning networks supported for code generation using MATLAB Coder:
And I've seen the question here about building the ARM Compute Library:
The next question I have is, how do I set the environment variables on ARM targets to point to the ARM Compute Library?


Sign in to comment.

2 Answers

Answer by Bill Chou
on 10 Apr 2019
 Accepted Answer

To avoid build failures on ARM hardware targets, such as the Raspberry Pi and Hikey960, you must set the necessary environment variables non-interactively.
For example, with the ComputeLibrary folder installed under ~, the user home directory, and the ARM Compute libraries stored at ~/ComputeLibrary/lib, you can add this code block to the file ~/.bashrc:
#Set below block, if you use your hardware non-interactively (through ssh from remote host or tty/new terminal onto local machine)
case $- in
*i*) ;;
export ARM_COMPUTELIB=~/ComputeLibrary
export PATH=${PATH}:~/ComputeLibrary
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:~/ComputeLibrary/lib

  1 Comment

Hi Bill!
Could you please help me on an issue I am encountering? I am performing the example "Code Generation for Deep Learning on Raspberry Pi" and I followed your tutorials on how to install the Arm Compute Library and the environmental variables.
Compiling, though, an error comes out:
Error executing command "touch -c /home/pi/remoteBuildDir/MATLAB_ws/R2019b/C/Users/Buellis/Documents/MATLAB/Examples/R2019a/deeplearning_shared/CodeGenerationForDeepLearningOnRaspberryPiExample/codegen/exe/squeezenet_raspi_predict/*.*;make -f all MATLAB_WORKSPACE="/home/pi/remoteBuildDir/MATLAB_ws/R2019b" -C /home/pi/remoteBuildDir/MATLAB_ws/R2019b/C/Users/Buellis/Documents/MATLAB/Examples/R2019a/deeplearning_shared/CodeGenerationForDeepLearningOnRaspberryPiExample/codegen/exe/squeezenet_raspi_predict". Details:
STDERR: In file included from /home/pi/remoteBuildDir/MATLAB_ws/R2019b/C/Users/Buellis/Documents/MATLAB/Examples/R2019a/deeplearning_shared/CodeGenerationForDeepLearningOnRaspberryPiExample/codegen/exe/squeezenet_raspi_predict/MWDepthConcatenationLayerImpl.hpp:6,
from /home/pi/remoteBuildDir/MATLAB_ws/R2019b/C/Users/Buellis/Documents/MATLAB/Examples/R2019a/deeplearning_shared/CodeGenerationForDeepLearningOnRaspberryPiExample/codegen/exe/squeezenet_raspi_predict/MWDepthConcatenationLayer.cpp:4:
/home/pi/remoteBuildDir/MATLAB_ws/R2019b/C/Users/Buellis/Documents/MATLAB/Examples/R2019a/deeplearning_shared/CodeGenerationForDeepLearningOnRaspberryPiExample/codegen/exe/squeezenet_raspi_predict/MWCNNLayerImpl.hpp:11:10: fatal error: arm_compute/runtime/NEON/NEFunctions.h: No such file or directory
#include "arm_compute/runtime/NEON/NEFunctions.h"
Seems it doesn't find the file "arm_compute/runtime/NEON/NEFunctions.h", but if I go in that directory in my RPi: /home/pi/ComputeLibrary/arm_compute/runtime/NEON, the file is present!
Do you have any idea what's causing it?

Sign in to comment.

Answer by Torbjörn Olsson on 24 Sep 2019 at 20:24

Hi Davide,
while you are awaiting an answer from a cunning person, I thought I draw your attention to a minor issue that perhaps could be at least part of the compiling error. The paths seems to differ by one character between the one in the error message and the one you mention in the latter part of your query, i.e. "arm_compute/runtime/" vs. "arm_compute_runtime/".

  1 Comment

Hi Torbjorn!
Thanks for your help! Sorry I made a typo, it is not "arm_compute_runtime/". I corrected the question.

Sign in to comment.