MATLAB Coder: How do I setup the environment variables on ARM targets to point to the ARM Compute Library?
古いコメントを表示
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?
採用された回答
その他の回答 (2 件)
Hariprasad Ravishankar
2019 年 11 月 19 日
Hi all,
The build error "fatal error: arm_compute/runtime/NEON/NEFunctions.h: No such file or directory" suggests that the ARM_COMPUTELIB environment variable may be incorrectly set.
This may perhaps be if you have setup the envrionment variables at the end of the ~/.bashrc script instead of the beginning.
In order to execute commands non-interactively, such as the codegen command from MATLAB on a host to compile on the Raspberry Pi, the environment variables need to be setup inside the
case $- in
*i*) ;;
*)
...
return;;
esac
block in the ~/.bashrc script. This section can be found in the first few lines of the ~/.bashrc script for non-interactive,non-login shells.
Here is how it is setup for me for reference
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively
case $- in
*i*) ;;
*) export ARM_COMPUTELIB=~/ComputeLibrary
export PATH=${PATH}:~/ComputeLibrary
export LD_LIBRARY_PATH=~/opencv-3.2.0/build/lib:~/ComputeLibrary/lib:$LD_LIBRARY_PATH
return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
Alternatively, you can setup environment variables in the first few lines of the ~/.bashrc before the return;; statement
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
export ARM_COMPUTELIB=~/ComputeLibrary
export PATH=${PATH}:~/ComputeLibrary
export LD_LIBRARY_PATH=~/opencv-3.2.0/build/lib:~/ComputeLibrary/lib:$LD_LIBRARY_PATH
# If not running interactively
case $- in
*i*) ;;
*)
return;;
esac
5 件のコメント
Xiaoxing Wang
2021 年 4 月 20 日
編集済み: Xiaoxing Wang
2021 年 4 月 20 日
Dear Hariprasad,
Thank you for your solution. It worked perfectly!
After the modification, I can now run the Segmentation Deep Network on my Raspberry Pi 3B+.
Though it is redundant, below is my set up as a reference.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
export ARM_COMPUTELIB=~/ComputeLibrary
export PATH=${PATH}:~/ComputeLibrary
export LD_LIBRARY_PATH=~/opencv-3.2.0/build/lib:~/ComputeLibrary/lib:$LD_LIBRARY_PATH
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
...
Xisheng Yu
2024 年 9 月 25 日
Hi,
I am trying the case you provided : Deploy Signal Segmentation Deep Network on Raspberry Pi. the configuration I am currently using is MATLAB2023b, Raspberry Pi 4B. arm compute library is 20.02.1. when doing a PIL, everything is fine. But when generating the executable file using MATLAB Coder, it compiles with an error, the error is a missing header file with the name“ rt_nonfinite.h”. Have you ever encountered this problem while using it? How did you solve it? Looking forward to your reply.
Hariprasad Ravishankar
2024 年 9 月 25 日
Hariprasad Ravishankar
2024 年 9 月 25 日
I was able to reproduce the error. It seems that there are two issues with the ecgsegmentation_main.cpp shipping with the example. The #include "rt_nonfinite.h" is not requried, and the datatype of the variable 'out' should be cell_wrap_4.
I have fixed both issues and verified that the example works in R2023b. Please use the cpp file attached as part of the ZIP file to fix the issues.
I will ensure we fix this issue.
Hari
Xisheng Yu
2024 年 9 月 26 日
Very happy to hear from you and that the problem was solved with the new file. Thank you very much and best wishes to you.
Torbjörn Olsson
2019 年 9 月 24 日
0 投票
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 件のコメント
Davide Buellis
2019 年 9 月 25 日
Hi Torbjorn!
Thanks for your help! Sorry I made a typo, it is not "arm_compute_runtime/". I corrected the question.
カテゴリ
ヘルプ センター および File Exchange で ARM Cortex-A Processors についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!