tensorflow / tflite-micro

Infrastructure to enable deployment of ML models to low-power resource-constrained embedded targets (including microcontrollers and digital signal processors).
Apache License 2.0
1.74k stars 770 forks source link

Use posix style path separator for better compatibility. #2547

Closed Logiase closed 2 months ago

Logiase commented 2 months ago

Use posix separator / instead of Windows \ for better compatibility when building with Makefile on Windows.

The original version generate a wrong source file path when building with Makefile on Windows.

For example:

make -f tensorflow/lite/micro/tools/make/Makefile TARGET=cortex_m_generic TARGET_ARCH=cortex-m33+nodsp OPTIMIZE_KERNEL_DIR=cmsis_nn microlite

The above command failed on both git-bash, powershell and cmd with the following error:

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.
tensorflow/lite/micro/tools/make/downloads/cmsis already exists, skipping the download.
/path/to/arm-none-eabi-g++ -std=c++11 -fno-rtti -fno-exceptions -fno-threadsafe-statics -Wnon-virtual-dtor -Werror -fno-unwind-tables -ffunction-sections -fdata-sections -fmessage-length=0 -DTF_LITE_STATIC_MEMORY -DTF_LITE_DISABLE_X86_NEON -Wsign-compare -Wdouble-promotion -Wunused-variable -Wunused-function -Wswitch -Wvla -Wall -Wextra -Wmissing-field-initializers -Wstrict-aliasing -Wno-unused-parameter -DKERNELS_OPTIMIZED_FOR_SPEED -mcpu=cortex-m33+nodsp -mfpu=auto -DTF_LITE_MCU_DEBUG_LOG -mthumb -mfloat-abi=soft -funsigned-char -mlittle-endian -Wno-type-limits -Wno-unused-private-field -fomit-frame-pointer -MD -DCPU_M33=1 -DCMSIS_DEVICE_ARM_CORTEX_M_XX_HEADER_FILE=\""ARMCM33".h\" -D"ARMCM33" -Os -I. -Itensorflow/lite/micro/tools/make/downloads -Itensorflow/lite/micro/tools/make/downloads/gemmlowp -Itensorflow/lite/micro/tools/make/downloads/flatbuffers/include -Itensorflow/lite/micro/tools/make/downloads/kissfft -Itensorflow/lite/micro/tools/make/downloads/ruy -Itensorflow/lite/micro/tools/make/downloads/cmsis/Device/ARM/"ARMCM33"/Include -Itensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/Core/Include -Igen/cortex_m_generic_cortex-m33+nodsp_default_gcc/genfiles/ -Igen/cortex_m_generic_cortex-m33+nodsp_default_gcc/genfiles/ -c tensorflow/lite/micro/cortex_m_generic\debug_log.cc -o gen/cortex_m_generic_cortex-m33+nodsp_default_gcc/obj/core/tensorflow/lite/micro/cortex_m_generic\debug_log.o
cc1plus.exe: fatal error: tensorflow/lite/micro/cortex_m_genericdebug_log.cc: No such file or directory
compilation terminated.
make: *** [tensorflow/lite/micro/tools/make/Makefile:795: gen/cortex_m_generic_cortex-m33+nodsp_default_gcc/obj/core/tensorflow/lite/micro/cortex_m_generic\debug_log.o] Error 1

This simple PR would fix the separator error.

google-cla[bot] commented 2 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.