google / XNNPACK

High-efficiency floating-point neural network inference operators for mobile, server, and Web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build (compile) error - xnnpack::aarch64::VRegister - Ubuntu 21.10 (WSL)

misterBart opened this issue · comments

My company attempts to incorporate XNNPACK in their neural network software. The master branch however fails to build under Ubuntu 21.10 (WSL). The errors relate to xnnpack::aarch64::VRegister in src/xnnpack/aarch64-assembler.h.
I attached the output of scripts/build-local.sh
xnnpackBuildErrors.txt

Thanks, scripts/build-local.sh builds without errors now. A few warnings are issued, and if you're interested they are:

[455/3944] Building CXX object CMakeFiles/bench-utils.dir/bench/utils.cc.o
../../bench/utils.cc: In function ‘void InitWipeBuffer()’:
../../bench/utils.cc:45:24: warning: ignoring return value of ‘int posix_memalign(void**, size_t, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   45 |   (void) posix_memalign((void**) &wipe_buffer, 128, wipe_buffer_size);
      |          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[3608/3944] Building C object clog/CMakeFiles/clog.dir/src/clog.c.o
clog-source/deps/clog/src/clog.c: In function ‘clog_vlog_fatal’:
clog-source/deps/clog/src/clog.c:112:25: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  112 |                         write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clog-source/deps/clog/src/clog.c: In function ‘clog_vlog_error’:
clog-source/deps/clog/src/clog.c:188:25: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  188 |                         write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clog-source/deps/clog/src/clog.c: In function ‘clog_vlog_warning’:
clog-source/deps/clog/src/clog.c:264:25: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  264 |                         write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clog-source/deps/clog/src/clog.c: In function ‘clog_vlog_info’:
clog-source/deps/clog/src/clog.c:340:25: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  340 |                         write(STDOUT_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clog-source/deps/clog/src/clog.c: In function ‘clog_vlog_debug’:
clog-source/deps/clog/src/clog.c:416:25: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  416 |                         write(STDOUT_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I also tried to build today's master by executing cmake . followed by cmake --build . -j But this yields errors at the end, after the linking step. I attached the output to this post.
errorsCmake.txt

Just tried mkdir build && cd build && cmake .. && cmake --build . -j and it works. The errors in the attached file looks unrelated to XNNPACK, seems like the linker is running out of memory on your machine.

You're right, the error got somewhat buried among all the other messages/errors. Never seen that linker error.
Culprit was the -j flag, which seems to spawn many processes when left unspecified, consequently taking up large amounts of memory. scripts/build-local.sh uses cmake --build . -j$(nproc), so passing a fairly low number to -j solved the problem.

Follow-up question about building: What is preferred? Execute scripts/build-local.sh (which sets a few flags) or execute cmake . followed by cmake --build . -j$(nproc)?

There's no preferred way. scripts/build-local.sh is a helper script with typical parameters, but you don't have to use it.