symisc / sod

An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)
https://sod.pixlab.io
Other
1.75k stars 213 forks source link

Application/User Information #13

Closed TrevorHeyl closed 5 years ago

TrevorHeyl commented 5 years ago

I think some more work is needed on the user/application information for different platforms to help get this great library into embedded systems . The information provided says its only required to add 4 c-files to a project but this is not the case since these files reference many .h files that are not included in many toolchains for example GNU eabi toolchain used with STM32CubeIDE. Thank you

TrevorHeyl commented 5 years ago

Here is the project inclusion I have :

..Middelware\ ....\SOD sod_img_reader.h sod_img_writer.h sod.c sod.h

Here is part of the compile output frm an STM32 IDE project

08:02:37 Incremental Build of configuration Debug for project STM32F413H_DISCOVERY make all arm-none-eabi-gcc "../Middlewares/sod/sod.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DSTM32F413xx -DUSE_HAL_DRIVER -DUSE_STM32F413H_DISCOVERY -c -I../../../Inc -I../../../../../../../../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../../../../../../../../Drivers/STM32F4xx_HAL_Driver/Inc -I../../../../../../../../Drivers/BSP/STM32F413H-Discovery -I../../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../../Utilities/Log -I../../../../../../../../Utilities/Fonts -I../../../../../../../../Utilities/CPU -I../../../../../../../../Utilities -I../../../../../../../../Utilities/fonts -I../../../../../../../../Middlewares/Third_Party/FatFs/src -I../../../../../../../../Drivers/BSP/Components -I../../../../../../../../Drivers/CMSIS/Include -Os -ffunction-sections -Wall -fstack-usage -MMD -MP -MF"Middlewares/sod/sod.d" -MT"Middlewares/sod/sod.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Middlewares/sod/sod.o" ../Middlewares/sod/sod.c:1726:10: fatal error: sys/uio.h: No such file or directory

include <sys/uio.h>

      ^~~~~~~~~~~

compilation terminated. make: *** [Middlewares/sod/subdir.mk:18: Middlewares/sod/sod.o] Error 1 "make all" terminated with exit code 2. Build might be incomplete.

TrevorHeyl commented 5 years ago

sorry accidentally closed it

symisc commented 5 years ago

Hi @TrevorHeyl ,

You can safely remove the line 1726 from the sod.c source code which include the <sys/uio.h> header file that is never used. Let us know if SOD compile fine for you this time. Also note if your system is lacking floating point computation or some math function, then you have to disable the entire CNN layer via the compile time directive SOD_DISABLE_CNN.

TrevorHeyl commented 5 years ago

Hi symisc,

Thanks for your quick reply, This did work partly, I defined OS_OTHER , this forced exlcusion of uio.h. Maybe useful for others, since some small embedded file systems are neither WINNT nor UNIXES it is useful to simply change static const sod_vfs * sodExportBuiltinVfs(void) to a dummy pointer if user is sure not to call sod_img_load_from_file() )(and others) , as I call sod_img_load_from_mem().

symisc commented 5 years ago

Yes, this what UnQLite, our embedded database library exactly use. A dummy VFS pointer for platforms different from Unixes and Windows. We'll merge this feature on the next release of SOD. Note that you can disable the whole image reading/writing API via the compile directive SOD_DISABLE_IMG_READER. Find out more here at https://sod.pixlab.io/api.html#cmpl_im_reader.