gwsystems / sledge-serverless-framework

SLEdge: a serverless runtime designed for the Edge.
GNU General Public License v2.0
105 stars 16 forks source link

Make in Application Fails with fatal error: 'string.h' file not found #349

Closed DanielLee343 closed 2 years ago

DanielLee343 commented 2 years ago

Hi, I was building in docker. make in /sledge/runtime works fine, however make all in /sledge/applicationsseems to have some linking problem

root@wanda0:/sledge/applications# make clean all
...
1 error generated.
In file included from CMSIS_5/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q31.c:29:
CMSIS_5/CMSIS/DSP/Include/arm_math.h:395:10: fatal error: 'string.h' file not found
#include <string.h>
         ^~~~~~~~~~
1 error generated.
In file included from CMSIS_5/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q7.c:29:
CMSIS_5/CMSIS/DSP/Include/arm_math.h:395:10: fatal error: 'string.h' file not found
#include <string.h>
         ^~~~~~~~~~
1 error generated.
cifar10/arm_nnexamples_cifar10.c:93:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
make[2]: *** [Makefile:49: cifar10.wasm] Error 1
make[2]: Leaving directory '/sledge/applications/wasm_apps/CMSIS_5_NN'
make[1]: *** [Makefile:414: dist/cifar10.wasm] Error 2
make[1]: Leaving directory '/sledge/applications/wasm_apps'
make: *** [Makefile:39: wasm_apps/dist/cifar10.wasm] Error 2

Do you possibly know why this happens? install_llvm.sh inside docker seems to run successfully though.

bushidocodes commented 2 years ago

Appreciate the issue! I've been able to replicate this and will dig in further.

bushidocodes commented 2 years ago

@DanielLee343 - Sorry for the delay here! Should be fixed now if you pull latest and update submodules. We use an environment variable to tell clang where the WebAssembly sysroot is. This is needed to resolve headers and such. At some point in the past, it seems this was renamed, but the Dockerfile still had the older name, which now resolved to an empty string, and thus an invalid path. Because of this, clang didn't know where to find the proper header files.