Build error in CMakeFiles/tensorflow_build

Hi, I am following quick start guide to build by using “python3 ./build_default.py --toolchain arm”. I got build error as below.
[ 6%] Building TensorFlow Lite Micro library… /bin/sh: 1: Syntax error: “(” unexpected make[2]: *** [CMakeFiles/tensorflow_build.dir/build.make:71: CMakeFiles/tensorflow_build] Error 2 make[1]: *** [CMakeFiles/Makefile2:537: CMakeFiles/tensorflow_build.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs…

I am new to this project so this question may be sound basic. I checked the files mentioned in above error message and they were CMAKE generated files with “DO NOT EDIT!” notice. Would someone help me to resolve this issue?

Add more info, I just did a fresh clone of the repo and get the same error. My code is synced to tag: 22.11-rc1 (hash:71f282e) and my working tree is clean. Could be some environment setting issue? I will attach build log. It does not allow me to attach the log and seems only picture or image can be attached.

Hi there,

Sorry to hear that you are having trouble building the Embedded Evaluation Kit. We are having a look into what can be causing this issue and think we might have found the cause of it. To help us out could you tell what version of Python you are using to run the script?

Thanks,
Richard

Hi @Kaipingli88, it will also be useful to send us the full cmake configuration and build log for us to diagnose the issue.

Thanks,
Kshitij

Hi @Burton2000,

My python version is 3.8.10.

Thanks a lot for your help!
Kaiping

Please see attached build log. I am not sure which file is full cmake configuration so I attached Makefile, cmake_install.cmake, CMakeCache.txt, CTestTestfile.cmake from cmake-build-mps3-sse-300-ethos-u55-128-arm directory.

Many Thanks!

Kaiping

image001.jpg

(Attachment log_build_default.log is missing)

(Attachment Makefile is missing)

(Attachment cmake_install.cmake is missing)

(Attachment CMakeCache.txt is missing)

(Attachment CTestTestfile.cmake is missing)

Hi @kshitij-sisodia-arm,

I just tried attached log files by replying to Kshitij Sisodia Arm via Discourse noreply@discuss.mlplatform.org with attachment but it is apparently failed.
Please let me know how to send your required files.

Many Thanks!
Kaiping

Hi @Kaipingli88,

You should be able to attach the log within the message if nothing else works:

cat log_build_default.log 
INFO:root:Downloading resources.
INFO:root:'resources_downloaded' directory exists.
INFO:root:/home/user/ml-embedded-evaluation-kit/resources_downloaded/env/bin/python3 -m pip freeze
INFO:root:cffi==1.14.3
cmake==3.23.3
ethos-u-vela==3.5.0
flatbuffers==1.12
Jinja2==2.11.2
llvmlite==0.38.0
lxml==4.9.1
MarkupSafe==1.1.1
numba==0.55.1
numpy==1.21.3
Pillow==7.2.0
pkg_resources==0.0.0
pycparser==2.20

However, while we wait for these logs, one thing you can try straight away is:

Navigate to dependencies/tensorflow from the root of the repo and run these commands:

$ make -f tensorflow/lite/micro/tools/make/Makefile clean_downloads
tensorflow/lite/micro/tools/make/downloads/flatbuffers already exists, skipping the download.
tensorflow/lite/micro/tools/make/downloads/kissfft already exists, skipping the download.
tensorflow/lite/micro/tools/make/downloads/pigweed already exists, skipping the download.
find: ‘tensorflow/lite/micro/tools/gen_micro_mutable_op_resolver_test/person_detect’: No such file or directory
rm -rf tensorflow/lite/micro/tools/make/downloads
$ make -f tensorflow/lite/micro/tools/make/Makefile third_party_download
...

If the above command succeeds, then, re-run the default build script again.

Hoping the above helps clear out any stale downloads from TensorFlow Lite Micro. But if this doesn’t fix the issue, we will try and diagnose further with the logs.

Thanks,
Kshitij

Hi @kshitij-sisodia-arm,

I cannot past the build log here and send out because limitation of message size & 2 links for new user.
I just tried your suggestion. The first command executed without any issue. The 2nd one seems has issue and below is the last part of output executing your 2nd command in dependencies/tensorflow directory.

Switched to a new branch ‘tflm’ Applying /home/likaiping/ml-embedded-evaluation-kit/dependencies/tensorflow/tensorflow/lite/micro/tools/make/downloads/kissfft/.//…/…/kissfft.patch to /home/likaiping/ml-embedded-evaluation-kit/dependencies/tensorflow/tensorflow/lite/micro/tools/make/downloads/kissfft/./ Cloning into ‘tensorflow/lite/micro/tools/make/downloads/pigweed’… remote: Sending approximately 36.88 MiB … remote: Total 55790 (delta 27167), reused 55790 (delta 27167) Receiving objects: 100% (55790/55790), 36.88 MiB | 1.92 MiB/s, done. Resolving deltas: 100% (27167/27167), done. Updating files: 100% (3501/3501), done. Note: switching to ‘47268dff45019863e20438ca3746c6c62df6ef09’. You are in ‘detached HEAD’ state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -c Or undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at 47268dff pw_hdlc_lite: Client I/O improvements Switched to a new branch ‘tflm’ Applying /home/likaiping/ml-embedded-evaluation-kit/dependencies/tensorflow/tensorflow/lite/micro/tools/make/downloads/pigweed/.//…/…/pigweed.patch to /home/likaiping/ml-embedded-evaluation-kit/dependencies/tensorflow/tensorflow/lite/micro/tools/make/downloads/pigweed/./ make: *** No rule to make target ‘third_party_download’. Stop.

Many Thanks!
Kaiping

Hi @Kaipingli88,

Sorry, there’s an “s” missing at the end (third_party_downloads) the command should be:

We will publish a change soon that will do this at configuration stage. Will let you know once that change is in.

Thanks,
Kshitij

Hi @kshitij-sisodia-arm,

I added “s” (third_party_downloads) and the 2nd command executed fine. However, re-run the default build script still has problem. Please give instruction on what is the next step or provide fix to test.

Thanks,
Kaiping

Continuing the conversation via messages. @Kaipingli88, you should have a message from me in your inbox :slight_smile:.

The issue was resolved - the cause was a stray “(” character in the PATH variable - passed from Windows’ mount directory in the WSL2 environment.