Build error in makefile

Hi, I am following quick start guide to build by using ./build_default.py and got the build error below
[ 55%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_q15.c.obj
[ 55%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_q31.c.obj
[ 55%] Linking C static library …/lib/libcmsis-dsp.a
[ 55%] Built target cmsis-dsp
make: *** [Makefile:146: all] Error 2

Can anyone help me with this problem?

I am kind new to using this makefiles and linux.

Thank you!

Hi @Sooyeon,

Thanks for raising this. Can you please share some more details with us, especially:

  1. Are you on a Linux based system or are you using WSL2 under Windows?
  2. Can you share the contents of the log file build_default.py would have produced? It should be a file named log_build_default.log.
  3. Did you verify you have all the prerequisites as mentioned here: building.md: build-prerequisites, and can you share the output of those commands with us?
  4. Can you check if you have the third_party-build-prerequisites installed?

Thanks,
Kshitij

  1. I am using WSL2 under Window.

  2. I cannot upload .log file so I am writing some of the log.

INFO:root:/home/parksean210/git/MLplatform/ml-embedded-evaluation-kit/resources_downloaded/env/bin/python3 -m pip freeze

INFO:root:cffi==1.15.0

cmake==3.23.3

ethos-u-vela==3.6.0

flatbuffers==2.0.7

Jinja2==2.11.2

llvmlite==0.38.0

lxml==4.9.2

MarkupSafe==2.0.1

numba==0.55.1

numpy==1.21.3

Pillow==9.2.0

pycparser==2.20

resampy==0.3.1

scipy==1.7.3

six==1.16.0

SoundFile==0.10.3.post1

INFO:root:[ 53%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_mfcc_q15.c.obj

INFO:root:[ 53%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_mfcc_q31.c.obj

INFO:root:[ 53%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_f32.c.obj

INFO:root:[ 53%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_fast_f16.c.obj

INFO:root:[ 53%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_fast_f32.c.obj

INFO:root:[ 54%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_fast_f64.c.obj

INFO:root:[ 54%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_fast_init_f16.c.obj

INFO:root:[ 54%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_fast_init_f32.c.obj

INFO:root:[ 54%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_fast_init_f64.c.obj

INFO:root:[ 54%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_init_f32.c.obj

INFO:root:[ 55%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_init_q15.c.obj

INFO:root:[ 55%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_init_q31.c.obj

INFO:root:[ 55%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_q15.c.obj

INFO:root:[ 55%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/TransformFunctions/arm_rfft_q31.c.obj

INFO:root:[ 55%] Linking C static library …/lib/libcmsis-dsp.a

INFO:root:[ 55%] Built target cmsis-dsp

INFO:root:make: *** [Makefile:146: all] Error 2

the last lines

I have checked the prerequisites.

Thank you for your reply!

INFO:root:/bin/sh: 1: Syntax error: “(” unexpected

INFO:root:make[2]: *** [CMakeFiles/tensorflow_build.dir/build.make:71: CMakeFiles/tensorflow_build] Error 2

INFO:root:make[1]: *** [CMakeFiles/Makefile2:537: CMakeFiles/tensorflow_build.dir/all] Error 2

INFO:root:make[1]: *** Waiting for unfinished jobs…

Some errors in the log

The issue is similar to the one raised here: Build error in CMakeFiles/tensorflow_build - #9 by kshitij-sisodia-arm
The problem there was that the PATH variable in WSL2 environment contained some Windows’ mounted directories that had spaces and “(” characters - like “Program Files (x86)”. Can you share what’s there in your PATH please ($ echo $PATH)?

If there are any Windows directories, can you please remove them and then try the build again?

I am new to Linux so I am not sure that you asked this information.

/home/parksean210/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/ImageMagick-7.1.0-Q16-HDRI:/mnt/c/Program Files/Microsoft MPI/Bin/:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/System32/Wbem:/mnt/c/windows/System32/WindowsPowerShell/v1.0/:/mnt/c/windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/d/Program Files/MATLAB/R2022a/bin:/mnt/c/Program Files/MATLAB/R2020b/runtime/win64:/mnt/c/Program Files/MATLAB/R2020b/bin:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Git/cmd:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/mingw64/bin:/mnt/c/Users/sean210.park/AppData/Local/Programs/Python/Python311/Scripts/:/mnt/c/Users/sean210.park/AppData/Local/Programs/Python/Python311/:/mnt/c/Users/sean210.park/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/JetBrains/PyCharm Community Edition 2022.2/bin:/mnt/c/Program Files/JetBrains/DataSpell 2021.3.2/bin:/mnt/c/Users/sean210.park/AppData/Local/Programs/Python/Python39/Scripts:/mnt/c/Users/sean210.park/AppData/Local/Programs/MiKTeX/miktex/bin/x64/:/mnt/c/Users/sean210.park/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin:/opt/gcc-arm-none-eabi/bin:/opt/gcc-arm-none-eabi/bin:/opt/gcc-arm-none-eabi/bin:/opt/gcc-arm-none-eabi/bin:/mnt/c/Users/sean210.park/AppData/Local/Programs/Microsoft VS Code/bin:/.local/node:/opt/gcc-arm-none-eabi/bin

Thank you!

Do you mean I have to remove every /mnt/…

Is that right?

This will cause an issue with the build. Can you please set the PATH without any “(” or space characters? Other option is to escape all of them, but I don’t think you need any of them anyway.

For example:

$ PATH=/home/parksean210/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib::/snap/bin:/opt/gcc-arm-none-eabi/bin:/.local/node

should be sufficient.

This was helpful! :slight_smile:

and You are my life saver.

Thank you :slight_smile:

No worries @Sooyeon, glad to know it was helpful - I will mark this issue as closed :slight_smile:.

Hi,

I too face the same issue

I am building the applications in native windows (not WSL)

[ 47%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/BasicMathFunctions/arm_sub_q7.o
[ 47%] Linking C static library …\lib\libcmsis-dsp.a
[ 47%] Built target cmsis-dsp
make[1]: *** [CMakeFiles/ethos-u-alif_img_class.dir/rule] Error 2
make: *** [ethos-u-alif_img_class] Error 2

echo $PATH
$ echo $PATH
/c/Users/Srinivasa Rao Ragolu/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/Srinivasa Rao Ragolu/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/Program Files/ArmCompilerforEmbedded6.18/bin:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/cmd:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files/PowerShell/7:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/c/mingw64/bin:/c/Program Files/CMake/bin:/c/python:/c/python/Scripts:/c/Program Files/ArmCompilerforEmbedded6.18/bin:/c/make-3.81/bin:/c/make-3.81-dep/bin:/c/python/Scripts:/c/python:/usr/bin/vendor_perl:/usr/bin/core_perl

Do I need to install the all dependent binaries and utilities where path should not have spaces and ‘’(" ?

Or is there any way to continue to resolve this issue?

Thanks,
Srinivas.

Even after removing the spaces and “(” , getting the same linking error

somewhere between I could see

[ 45%] Building C object cmsis_device/CMakeFiles/cmsis_ensemble.dir///////dependencies/cmsis-ensemble/Alif_CMSIS/Source/Driver_PINMUX_AND_PINPAD.o
[ 45%] Building C object cmsis_device/CMakeFiles/cmsis_ensemble.dir///////dependencies/cmsis-ensemble/Alif_CMSIS/Source/Driver_USART.o
Access is denied
[ 45%] Building C object cmsis_device/CMakeFiles/cmsis_ensemble.dir///////dependencies/cmsis-ensemble/Alif_CMSIS/Source/LPTIMER_ll_drv.o
[ 45%] Building C object cmsis_device/CMakeFiles/cmsis_ensemble.dir///////dependencies/cmsis-ensemble/components/Source/PHY_Generic.o
make[3]: *** [CMakeFiles/tensorflow_build] Error 1
[ 45%] Building C object cmsis_device/CMakeFiles/cmsis_ensemble.dir///////dependencies/cmsis-ensemble/Alif_CMSIS/Source/Driver_DMA.o
make[2]: *** [CMakeFiles/tensorflow_build.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs…



[ 88%] Linking C static library …\lib\libcmsis-dsp.a
[ 88%] Built target cmsis-dsp
make[1]: *** [CMakeFiles/ethos-u-alif_kws.dir/rule] Error 2
make: *** [ethos-u-alif_kws] Error 2

any help in resolving this issue??