Compilation errors "cmake -DXNNPACK_BUILD_TESTS=OFF -DXNNPACK_BUILD_BENCHMARKS=OFF .."
The command "cmake -DXNNPACK_BUILD_TESTS=OFF -DXNNPACK_BUILD_BENCHMARKS=OFF .." in the master branch. Returns a compilation error.
Configuration: Raspberry PI 5 8G, Ubunta-server 2024.04
rigin@raspberrypi-server:~/XNNPACK/build$ cmake -DXNNPACK_BUILD_TESTS=OFF -DXNNPACK_BUILD_BENCHMARKS=OFF .. -- The C compiler identification is GNU 14.2.0 -- The CXX compiler identification is GNU 14.2.0 -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/cc -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Building for XNNPACK_TARGET_PROCESSOR: arm64 -- Enabling KleidiAI for Arm64 -- Downloading cpuinfo to /home/rigin/XNNPACK/build/cpuinfo-source (define CPUINFO_SOURCE_DIR to avoid it) -- Configuring done (0.1s) -- Generating done (0.0s) -- Build files have been written to: /home/rigin/XNNPACK/build/cpuinfo-download [ 11%] Creating directories for 'cpuinfo' [ 22%] Performing download step (download, verify and extract) for 'cpuinfo' -- Downloading... dst='/home/rigin/XNNPACK/build/cpuinfo-download/cpuinfo-prefix/src/3c8b1533ac03dd6531ab6e7b9245d488f13a82a5.zip' timeout='none' inactivity timeout='none' -- Using src='https://github.com/pytorch/cpuinfo/archive/3c8b1533ac03dd6531ab6e7b9245d488f13a82a5.zip' -- verifying file... file='/home/rigin/XNNPACK/build/cpuinfo-download/cpuinfo-prefix/src/3c8b1533ac03dd6531ab6e7b9245d488f13a82a5.zip' -- Downloading... done -- extracting... src='/home/rigin/XNNPACK/build/cpuinfo-download/cpuinfo-prefix/src/3c8b1533ac03dd6531ab6e7b9245d488f13a82a5.zip' dst='/home/rigin/XNNPACK/build/cpuinfo-source' -- extracting... [tar xfz] -- extracting... [analysis] -- extracting... [rename] -- extracting... [clean up] -- extracting... done [ 33%] No update step for 'cpuinfo' [ 44%] No patch step for 'cpuinfo' [ 55%] No configure step for 'cpuinfo' [ 66%] No build step for 'cpuinfo' [ 77%] No install step for 'cpuinfo' [ 88%] No test step for 'cpuinfo' [100%] Completed 'cpuinfo' [100%] Built target cpuinfo -- Downloading FP16 to /home/rigin/XNNPACK/build/FP16-source (define FP16_SOURCE_DIR to avoid it) -- Configuring done (0.1s) -- Generating done (0.0s) -- Build files have been written to: /home/rigin/XNNPACK/build/FP16-download [ 11%] Creating directories for 'fp16' [ 22%] Performing download step (download, verify and extract) for 'fp16' -- Downloading... dst='/home/rigin/XNNPACK/build/FP16-download/fp16-prefix/src/0a92994d729ff76a58f692d3028ca1b64b145d91.zip' timeout='none' inactivity timeout='none' -- Using src='https://github.com/Maratyszcza/FP16/archive/0a92994d729ff76a58f692d3028ca1b64b145d91.zip' -- [download 2% complete] -- [download 4% complete] -- [download 5% complete] -- [download 7% complete] -- [download 8% complete] -- [download 10% complete] -- [download 11% complete] -- [download 13% complete] -- [download 14% complete] -- [download 16% complete] -- [download 17% complete] -- [download 18% complete] -- [download 19% complete] -- [download 21% complete] -- [download 22% complete] -- [download 24% complete] -- [download 25% complete] -- [download 27% complete] -- [download 28% complete] -- [download 30% complete] -- [download 31% complete] -- [download 33% complete] -- [download 34% complete] -- [download 36% complete] -- [download 39% complete] -- [download 40% complete] -- [download 42% complete] -- [download 43% complete] -- [download 45% complete] -- [download 46% complete] -- [download 48% complete] -- [download 49% complete] -- [download 51% complete] -- [download 52% complete] -- [download 54% complete] -- [download 55% complete] -- [download 57% complete] -- [download 58% complete] -- [download 60% complete] -- [download 61% complete] -- [download 63% complete] -- [download 64% complete] -- [download 66% complete] -- [download 67% complete] -- [download 69% complete] -- [download 70% complete] -- [download 72% complete] -- [download 73% complete] -- [download 76% complete] -- [download 77% complete] -- [download 79% complete] -- [download 80% complete] -- [download 82% complete] -- [download 83% complete] -- [download 85% complete] -- [download 86% complete] -- [download 88% complete] -- [download 89% complete] -- [download 91% complete] -- [download 92% complete] -- [download 94% complete] -- [download 95% complete] -- [download 97% complete] -- [download 98% complete] -- [download 100% complete] -- verifying file... file='/home/rigin/XNNPACK/build/FP16-download/fp16-prefix/src/0a92994d729ff76a58f692d3028ca1b64b145d91.zip' -- Downloading... done -- extracting... src='/home/rigin/XNNPACK/build/FP16-download/fp16-prefix/src/0a92994d729ff76a58f692d3028ca1b64b145d91.zip' dst='/home/rigin/XNNPACK/build/FP16-source' -- extracting... [tar xfz] -- extracting... [analysis] -- extracting... [rename] -- extracting... [clean up] -- extracting... done [ 33%] No update step for 'fp16' [ 44%] No patch step for 'fp16' [ 55%] No configure step for 'fp16' [ 66%] No build step for 'fp16' [ 77%] No install step for 'fp16' [ 88%] No test step for 'fp16' [100%] Completed 'fp16' [100%] Built target fp16 -- Downloading FXdiv to /home/rigin/XNNPACK/build/FXdiv-source (define FXDIV_SOURCE_DIR to avoid it) -- Configuring done (0.0s) -- Generating done (0.0s) -- Build files have been written to: /home/rigin/XNNPACK/build/FXdiv-download [ 11%] Creating directories for 'fxdiv' [ 22%] Performing download step (download, verify and extract) for 'fxdiv' -- Downloading... dst='/home/rigin/XNNPACK/build/FXdiv-download/fxdiv-prefix/src/b408327ac2a15ec3e43352421954f5b1967701d1.zip' timeout='none' inactivity timeout='none' -- Using src='https://github.com/Maratyszcza/FXdiv/archive/b408327ac2a15ec3e43352421954f5b1967701d1.zip' -- verifying file... file='/home/rigin/XNNPACK/build/FXdiv-download/fxdiv-prefix/src/b408327ac2a15ec3e43352421954f5b1967701d1.zip' -- Downloading... done -- extracting... src='/home/rigin/XNNPACK/build/FXdiv-download/fxdiv-prefix/src/b408327ac2a15ec3e43352421954f5b1967701d1.zip' dst='/home/rigin/XNNPACK/build/FXdiv-source' -- extracting... [tar xfz] -- extracting... [analysis] -- extracting... [rename] -- extracting... [clean up] -- extracting... done [ 33%] No update step for 'fxdiv' [ 44%] No patch step for 'fxdiv' [ 55%] No configure step for 'fxdiv' [ 66%] No build step for 'fxdiv' [ 77%] No install step for 'fxdiv' [ 88%] No test step for 'fxdiv' [100%] Completed 'fxdiv' [100%] Built target fxdiv -- Downloading pthreadpool to /home/rigin/XNNPACK/build/pthreadpool-source (define PTHREADPOOL_SOURCE_DIR to avoid it) -- Configuring done (0.0s) -- Generating done (0.0s) -- Build files have been written to: /home/rigin/XNNPACK/build/pthreadpool-download [ 11%] Creating directories for 'pthreadpool' [ 22%] Performing download step (download, verify and extract) for 'pthreadpool' -- Downloading... dst='/home/rigin/XNNPACK/build/pthreadpool-download/pthreadpool-prefix/src/4fe0e1e183925bf8cfa6aae24237e724a96479b8.zip' timeout='none' inactivity timeout='none' -- Using src='https://github.com/Maratyszcza/pthreadpool/archive/4fe0e1e183925bf8cfa6aae24237e724a96479b8.zip' -- [download 1% complete] -- [download 3% complete] -- [download 5% complete] -- [download 7% complete] -- [download 9% complete] -- [download 11% complete] -- [download 12% complete] -- [download 14% complete] -- [download 16% complete] -- [download 18% complete] -- [download 20% complete] -- [download 22% complete] -- [download 23% complete] -- [download 25% complete] -- [download 26% complete] -- [download 28% complete] -- [download 32% complete] -- [download 34% complete] -- [download 36% complete] -- [download 38% complete] -- [download 40% complete] -- [download 42% complete] -- [download 44% complete] -- [download 45% complete] -- [download 47% complete] -- [download 49% complete] -- [download 51% complete] -- [download 53% complete] -- [download 55% complete] -- [download 57% complete] -- [download 59% complete] -- [download 62% complete] -- [download 64% complete] -- [download 66% complete] -- [download 68% complete] -- [download 70% complete] -- [download 72% complete] -- [download 96% complete] -- [download 100% complete] -- verifying file... file='/home/rigin/XNNPACK/build/pthreadpool-download/pthreadpool-prefix/src/4fe0e1e183925bf8cfa6aae24237e724a96479b8.zip' -- Downloading... done -- extracting... src='/home/rigin/XNNPACK/build/pthreadpool-download/pthreadpool-prefix/src/4fe0e1e183925bf8cfa6aae24237e724a96479b8.zip' dst='/home/rigin/XNNPACK/build/pthreadpool-source' -- extracting... [tar xfz] -- extracting... [analysis] -- extracting... [rename] -- extracting... [clean up] -- extracting... done [ 33%] No update step for 'pthreadpool' [ 44%] No patch step for 'pthreadpool' [ 55%] No configure step for 'pthreadpool' [ 66%] No build step for 'pthreadpool' [ 77%] No install step for 'pthreadpool' [ 88%] No test step for 'pthreadpool' [100%] Completed 'pthreadpool' [100%] Built target pthreadpool -- Downloading KleidiAI to /home/rigin/XNNPACK/build/kleidiai-source (define KLEIDIAI_SOURCE_DIR to avoid it) -- Configuring done (0.0s) -- Generating done (0.0s) -- Build files have been written to: /home/rigin/XNNPACK/build/kleidiai-download [ 11%] Creating directories for 'kleidiai' [ 22%] Performing download step (download, verify and extract) for 'kleidiai' -- Downloading... dst='/home/rigin/XNNPACK/build/kleidiai-download/kleidiai-prefix/src/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' timeout='none' inactivity timeout='none' -- Using src='https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' -- Retrying... -- Using src='https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' -- Retry after 5 seconds (attempt #2) ... -- Using src='https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' -- Retry after 5 seconds (attempt #3) ... -- Using src='https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' -- Retry after 15 seconds (attempt #4) ... -- Using src='https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' -- Retry after 60 seconds (attempt #5) ... -- Using src='https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' CMake Error at kleidiai-download/kleidiai-prefix/src/kleidiai-stamp/download-kleidiai.cmake:163 (message): Each download failed!
error: downloading 'https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' failed
status_code: 6
status_string: "Couldn't resolve host name"
log:
--- LOG BEGIN ---
timeout on name lookup is not supported
getaddrinfo(3) failed for gitlab.arm.com:443
Could not resolve host: gitlab.arm.com
Closing connection
--- LOG END ---
error: downloading 'https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' failed
status_code: 6
status_string: "Couldn't resolve host name"
log:
--- LOG BEGIN ---
timeout on name lookup is not supported
getaddrinfo(3) failed for gitlab.arm.com:443
Could not resolve host: gitlab.arm.com
Closing connection
--- LOG END ---
error: downloading 'https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' failed
status_code: 6
status_string: "Couldn't resolve host name"
log:
--- LOG BEGIN ---
timeout on name lookup is not supported
getaddrinfo(3) failed for gitlab.arm.com:443
Could not resolve host: gitlab.arm.com
Closing connection
--- LOG END ---
error: downloading 'https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' failed
status_code: 6
status_string: "Couldn't resolve host name"
log:
--- LOG BEGIN ---
timeout on name lookup is not supported
getaddrinfo(3) failed for gitlab.arm.com:443
Could not resolve host: gitlab.arm.com
Closing connection
--- LOG END ---
error: downloading 'https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' failed
status_code: 6
status_string: "Couldn't resolve host name"
log:
--- LOG BEGIN ---
timeout on name lookup is not supported
getaddrinfo(3) failed for gitlab.arm.com:443
Could not resolve host: gitlab.arm.com
Closing connection
--- LOG END ---
error: downloading 'https://gitlab.arm.com/kleidi/kleidiai/-/archive/8fda0bd9224cad4360c011a09bbb582c5ab7496a/kleidiai-8c6cf04366a3602ca974c4b262e29ae24b699556.zip' failed
status_code: 6
status_string: "Couldn't resolve host name"
log:
--- LOG BEGIN ---
timeout on name lookup is not supported
getaddrinfo(3) failed for gitlab.arm.com:443
Could not resolve host: gitlab.arm.com
Closing connection
--- LOG END ---
gmake[2]: *** [CMakeFiles/kleidiai.dir/build.make:100: kleidiai-prefix/src/kleidiai-stamp/kleidiai-download] Ошибка 1 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/kleidiai.dir/all] Ошибка 2 gmake: *** [Makefile:91: all] Ошибка 2 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE CMake Deprecation Warning at build/FP16-source/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED): Compatibility with CMake < 3.5 will be removed from a future version of CMake.
Update the VERSION argument
-- Downloading PSimd to /home/rigin/XNNPACK/build/psimd-source (define PSIMD_SOURCE_DIR to avoid it) CMake Deprecation Warning at CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED): Compatibility with CMake < 3.5 will be removed from a future version of CMake.
Update the VERSION argument
-- Configuring done (0.1s) -- Generating done (0.0s) -- Build files have been written to: /home/rigin/XNNPACK/build/psimd-download [ 11%] Creating directories for 'psimd' [ 22%] Performing download step (git clone) for 'psimd' Клонирование в «psimd-source»... Уже на «master» Эта ветка соответствует «origin/master». [ 33%] Performing update step for 'psimd' -- Fetching latest from the remote origin [ 44%] No patch step for 'psimd' [ 55%] No configure step for 'psimd' [ 66%] No build step for 'psimd' [ 77%] No install step for 'psimd' [ 88%] No test step for 'psimd' [100%] Completed 'psimd' [100%] Built target psimd CMake Deprecation Warning at build/psimd-source/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED): Compatibility with CMake < 3.5 will be removed from a future version of CMake.
Update the VERSION argument
CMake Error at CMakeLists.txt:1232 (ADD_SUBDIRECTORY): The source directory
/home/rigin/XNNPACK/build/kleidiai-source
does not contain a CMakeLists.txt file.
-- Configuring incomplete, errors occurred!
I figured out this error. There it was necessary to manually download a file that was not downloaded by the script.
But another error occurred. When installing Stable Diffusion cmake -DMAX_SPEED=ON -DXNNPACK_DIR=/home/rigin/XNNPACK/ .. Answer. Building CXX object CMakeFiles/sd.dir/sd.cpp.o /home/rigin/OnnxStream/src/sd.cpp: In function ‘int main(int, char**)’: /home/rigin/OnnxStream/src/sd.cpp:1890:19: warning: format not a string literal and no format arguments [-Wformat-security] 1890 | printf(("Invalid command line argument: "" + arg + "".\n\n").c_str()); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/rigin/OnnxStream/src/sd.cpp:1918:23: warning: format not a string literal and no format arguments [-Wformat-security] 1918 | printf(("Argument "" + arg + "" should be followed by a string.").c_str()); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 66%] Building CXX object CMakeFiles/sd.dir/onnxstream.cpp.o /home/rigin/OnnxStream/src/onnxstream.cpp:22:10: fatal error: xnnpack.h: No such file or directory 22 | #include <xnnpack.h> | ^~~~~~~~~~~ compilation terminated. gmake[2]: *** [CMakeFiles/sd.dir/build.make:90: CMakeFiles/sd.dir/onnxstream.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/sd.dir/all] Error 2 gmake: *** [Makefile:91: all] Error 2
hi,
could you try removing the slash at the end of XNNPACK_DIR?
The xnnpack.h file should be located here: /home/rigin/XNNPACK/include/xnnpack.h
Vito
Thanks for your response. Should the OnnxStream folder be placed in XNNPACK/build or can it be located independently?
No, it still doesn't find it.
root@raspberrypi-server:/home/rigin/XNNPACK/build/OnnxStream/src/build# cmake -DMAX_SPEED=ON -DOS_LLM=OFF -DOS_CUDA=OFF -DXNNPACK_DIR=/home/rigin/XNNPACK .. -- The C compiler identification is GNU 14.2.0 -- The CXX compiler identification is GNU 14.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done (0.6s) -- Generating done (0.0s) -- Build files have been written to: /home/rigin/XNNPACK/build/OnnxStream/src/build root@raspberrypi-server:/home/rigin/XNNPACK/build/OnnxStream/src/build# cmake --build . --config Release [ 33%] Building CXX object CMakeFiles/sd.dir/sd.cpp.o /home/rigin/XNNPACK/build/OnnxStream/src/sd.cpp: In function ‘int main(int, char**)’: /home/rigin/XNNPACK/build/OnnxStream/src/sd.cpp:1890:19: warning: format not a string literal and no format arguments [-Wformat-security] 1890 | printf(("Invalid command line argument: "" + arg + "".\n\n").c_str()); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/rigin/XNNPACK/build/OnnxStream/src/sd.cpp:1918:23: warning: format not a string literal and no format arguments [-Wformat-security] 1918 | printf(("Argument "" + arg + "" should be followed by a string.").c_str()); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 66%] Building CXX object CMakeFiles/sd.dir/onnxstream.cpp.o In file included from /home/rigin/XNNPACK/build/OnnxStream/src/onnxstream.cpp:1: /home/rigin/XNNPACK/build/OnnxStream/src/onnxstream.h: In member function ‘onnxstream::tensor_vector<T> onnxstream::DiskPrefetchWeightsProvider::provide(const std::string&)’: /home/rigin/XNNPACK/build/OnnxStream/src/onnxstream.h:545:22: error: ‘reverse’ is not a member of ‘std’ 545 | std::reverse(m_entries.begin(), m_entries.end()); | ^~~~~~~ /home/rigin/XNNPACK/build/OnnxStream/src/onnxstream.cpp: In destructor ‘onnxstream::XnnPack::~XnnPack()’: /home/rigin/XNNPACK/build/OnnxStream/src/onnxstream.cpp:520:21: warning: ‘throw’ will always call ‘terminate’ [-Wterminate] 520 | throw std::runtime_error("failed to delete operator"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/rigin/XNNPACK/build/OnnxStream/src/onnxstream.cpp:520:21: note: in C++11 destructors default to ‘noexcept’ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/vector:62, from /home/rigin/XNNPACK/build/OnnxStream/src/onnxstream.h:4: /usr/include/c++/14/bits/stl_pair.h: In instantiation of ‘constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = float&; _T2 = float&; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = float; typename decay<_Tp>::type = float; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = float; typename decay<_Tp2>::type = float]’: /home/rigin/XNNPACK/build/OnnxStream/src/onnxstream.cpp:3230:30: required from here 3230 | return std::make_pair(prl_ctx.first, prl_ctx.second); | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1132:5: note: parameter passing for argument of type ‘std::pair<float, float>’ when C++17 is enabled changed to match C++14 in GCC 10.1 1132 | make_pair(_T1&& __x, _T2&& __y) | ^~~~~~~~~ gmake[2]: *** [CMakeFiles/sd.dir/build.make:90: CMakeFiles/sd.dir/onnxstream.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/sd.dir/all] Error 2 gmake: *** [Makefile:91: all] Error 2
The file /home/rigin/XNNPACK/include/xnnpack.h is present.
The error is different now: it appears to find xnnpack.h.
The same error as in this issue occurs now:
https://github.com/vitoplantamura/OnnxStream/issues/82, starting from my
comment suggesting to insert the "#include
Can you follow the steps of that issue (starting from the advice to add the
line "#include
Thanks, Vito
Add #include
Received:
root@raspberrypi-server:/home/rigin/OnnxStream/src/build# cmake -DMAX_SPEED=ON -DOS_LLM=OFF -DOS_CUDA=OFF -DXNNPACK_DIR=/home/rigin/XNNPACK .. -- Configuring done (0.0s) -- Generating done (0.0s) -- Build files have been written to: /home/rigin/OnnxStream/src/build root@raspberrypi-server:/home/rigin/OnnxStream/src/build# cmake --build . --config Release [ 33%] Building CXX object CMakeFiles/sd.dir/sd.cpp.o /home/rigin/OnnxStream/src/sd.cpp: In function ‘int main(int, char**)’: /home/rigin/OnnxStream/src/sd.cpp:1891:19: warning: format not a string literal and no format arguments [-Wformat-security] 1891 | printf(("Invalid command line argument: "" + arg + "".\n\n").c_str()); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/rigin/OnnxStream/src/sd.cpp:1919:23: warning: format not a string literal and no format arguments [-Wformat-security] 1919 | printf(("Argument "" + arg + "" should be followed by a string.").c_str()); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 66%] Linking CXX executable sd [100%] Built target sd root@raspberrypi-server:/home/rigin/OnnxStream/src/build#
It worked.
Could you create a Pull Request? Or alternatively could you list me all the changes you've made, so I can update the code?
Thank you, Vito
Dear Vito. I have already listed all the changes.
Add #include <algorithm> to onnxstream.h,
add #include <cstring> to sd.cpp.
i used this url https://u-labs.de/portal/ki-bilder-auf-dem-raspberry-pi-mit-onnxstream-stable-diffusion-generieren/
merged with the setup on github here... https://github.com/vitoplantamura/OnnxStream
BUT for compiling (i used make -j3 on my rpi4 (2gb), not cmake (TOOOOooooook forever)) replaced from the german (translated) site
cmake -DMAX_SPEED=ON -DXNNPACK_DIR=$baseDir/XNNPACK .. make -j3
with this cmake -DMAX_SPEED=ON -DOS_LLM=OFF -DOS_CUDA=OFF -DXNNPACK_DIR=<DIRECTORY_WHERE_XNNPACK_WAS_CLONED> .. make -j3
then running cd $baseDir/OnnxStream/src/build/ time ./sd --turbo --rpi --models-path $baseDir/stable-diffusion-xl-turbo-1.0-onnxstream --prompt "An astronaut riding a horse on Mars" --steps 1 --output astronaut.png
the big difference for me that worked overall was the german site's
export baseDir=/home/u-labs/sd-rpi mkdir $baseDir cd $baseDir thats /\ what worked for me
I came from https://u-labs.de/portal/ki-bilder-auf-dem-raspberry-pi-mit-onnxstream-stable-diffusion-generieren/
And compilation didn't work, you gave me the right idea, the tutorial on https://github.com/vitoplantamura/OnnxStream#how-to-build-the-stable-diffusion-example-on-linuxmacwindowstermuxfreebsd
is up to date, it seems as if the versions of XNNPACK and OnnxStream have to fit together, compilation or execution might failed if the parts doesn't fit together.