flomesh-io / pipy

Pipy is a programmable proxy for the cloud, edge and IoT.
https://flomesh.io/pipy
Other
743 stars 70 forks source link

Cannot build on macOS with silicon chip #182

Closed reaver-flomesh closed 1 week ago

reaver-flomesh commented 2 weeks ago

Got below error if execute ./build.sh

[ 61%] Building CXX object deps/leveldb-1.23/CMakeFiles/leveldbutil.dir/db/leveldbutil.cc.o
Created configdata.pm
Running configdata.pm
[ 61%] Linking CXX executable leveldbutil
Created Makefile.in
[ 61%] Built target leveldbutil
Created Makefile

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************
make[3]: warning: -jN forced in submake: disabling jobserver mode.
In file included from In file included from ../apps/lib/app_libctx.c../apps/lib/app_params.c::910:
:
In file included from In file included from ../apps/include/app_libctx.h../apps/include/apps.h::1313:
:
In file included from In file included from ../include/openssl/types.h../include/internal/e_os.h::3216:
:
In file included from In file included from ../include/openssl/e_os2.h../include/openssl/e_os2.h::234234:
:
/Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/inttypes.h:21/Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/inttypes.h::1521: :15fatal error: : 'inttypes.h' file not foundfatal error:
'inttypes.h' file not found
#include_next <inttypes.h>#include_next <inttypes.h>
              ^~~~~~~~~~~~

              ^~~~~~~~~~~~
1 error generated.
1 error generated.
make[4]: *** [apps/lib/libapps-lib-app_libctx.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [apps/lib/libapps-lib-app_params.o] Error 1
make[3]: *** [build_sw] Error 2
make[2]: *** [/Users/linyang/workspace/flomesh-projects/pipy/deps/openssl-3.2.0/build/libcrypto.a] Error 2
make[1]: *** [CMakeFiles/OpenSSL.dir/all] Error 2
make: *** [all] Error 2

OS information:

uname -a
Darwin XXX-MBP-2021.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64
Hou-Xiaoxuan commented 2 weeks ago

I've had this problem before, and don't know why, but just add a environment variable will solve the problem:

# fish shell
set SDKROOT (xcrun --show-sdk-path)
# bash shell
export SDKROOT=$(xcrun --show-sdk-path)
reaver-flomesh commented 2 weeks ago

I've had this problem before, and don't know why, but just add a environment variable will solve the problem:

# fish shell
set SDKROOT (xcrun --show-sdk-path)
# bash shell
export SDKROOT=$(xcrun --show-sdk-path)

Thanks, it works.