Failed Building PyTorch 1.6.0 on aarch64(arm64) systems

username: WMF1997
cooked: <p>Hello everyone,<br>
I manage to build PyTorch 1.6.0 from source on my Manjaro aarch64 KDE on Raspberry Pi 4 (4GB memory), but failed.</p>
<p>After installing Manjaro aarch64 system, I just installed gcc/g++, cmake, python-yaml, and some other packages. I installed them by <code>sudo pacman -S</code>, which is the ordinary installation method.</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/c/8cead491c0a9d1c5846f5f820a26298a98130b01.png" data-download-href="https://discuss.pytorch.org/uploads/default/8cead491c0a9d1c5846f5f820a26298a98130b01" title="1"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/8/c/8cead491c0a9d1c5846f5f820a26298a98130b01_2_690x388.png" alt="1" data-base62-sha1="k6BXZjT9Ox2DJsmlBZy1tMY6N3P" width="690" height="388" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/8/c/8cead491c0a9d1c5846f5f820a26298a98130b01_2_690x388.png, https://discuss.pytorch.org/uploads/default/optimized/3X/8/c/8cead491c0a9d1c5846f5f820a26298a98130b01_2_1035x582.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/8/c/8cead491c0a9d1c5846f5f820a26298a98130b01_2_1380x776.png 2x" data-dominant-color="171717"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">1</span><span class="informations">1600×900 89.8 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/2/a/2ab6c08651898ff7bb5adc1711773d1f833665dc.png" data-download-href="https://discuss.pytorch.org/uploads/default/2ab6c08651898ff7bb5adc1711773d1f833665dc" title="3"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2ab6c08651898ff7bb5adc1711773d1f833665dc_2_690x388.png" alt="3" data-base62-sha1="65RB5yo44sTKOXZJYjEJ1O6xhYU" width="690" height="388" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2ab6c08651898ff7bb5adc1711773d1f833665dc_2_690x388.png, https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2ab6c08651898ff7bb5adc1711773d1f833665dc_2_1035x582.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2ab6c08651898ff7bb5adc1711773d1f833665dc_2_1380x776.png 2x" data-dominant-color="151515"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">3</span><span class="informations">1600×900 70.2 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/c/d/cd724a84270336e9b59d7c23ad8c9ee7feaee430.png" data-download-href="https://discuss.pytorch.org/uploads/default/cd724a84270336e9b59d7c23ad8c9ee7feaee430" title="2"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/c/d/cd724a84270336e9b59d7c23ad8c9ee7feaee430_2_690x388.png" alt="2" data-base62-sha1="tjsKqXCWM5wgdz0cvnwnTVKxWKI" width="690" height="388" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/c/d/cd724a84270336e9b59d7c23ad8c9ee7feaee430_2_690x388.png, https://discuss.pytorch.org/uploads/default/optimized/3X/c/d/cd724a84270336e9b59d7c23ad8c9ee7feaee430_2_1035x582.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/c/d/cd724a84270336e9b59d7c23ad8c9ee7feaee430_2_1380x776.png 2x" data-dominant-color="111212"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">2</span><span class="informations">1600×900 54.2 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/e/5/e5f66a4f8a083188b670ba73476dd3ab94fc633e.png" data-download-href="https://discuss.pytorch.org/uploads/default/e5f66a4f8a083188b670ba73476dd3ab94fc633e" title="4"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/e/5/e5f66a4f8a083188b670ba73476dd3ab94fc633e_2_690x388.png" alt="4" data-base62-sha1="wOlhxXiOy5cWZ4rEMDwkYpHxCh0" width="690" height="388" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/e/5/e5f66a4f8a083188b670ba73476dd3ab94fc633e_2_690x388.png, https://discuss.pytorch.org/uploads/default/optimized/3X/e/5/e5f66a4f8a083188b670ba73476dd3ab94fc633e_2_1035x582.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/e/5/e5f66a4f8a083188b670ba73476dd3ab94fc633e_2_1380x776.png 2x" data-dominant-color="191719"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">4</span><span class="informations">1600×900 105 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/e/6e3102455e603cc9dd2fbe39ee05c7df7b857fd6.png" data-download-href="https://discuss.pytorch.org/uploads/default/6e3102455e603cc9dd2fbe39ee05c7df7b857fd6" title="5"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/6/e/6e3102455e603cc9dd2fbe39ee05c7df7b857fd6_2_690x388.png" alt="5" data-base62-sha1="fINwpx17hY4t9EJY0qiqCxxR7kq" width="690" height="388" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/6/e/6e3102455e603cc9dd2fbe39ee05c7df7b857fd6_2_690x388.png, https://discuss.pytorch.org/uploads/default/optimized/3X/6/e/6e3102455e603cc9dd2fbe39ee05c7df7b857fd6_2_1035x582.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/6/e/6e3102455e603cc9dd2fbe39ee05c7df7b857fd6_2_1380x776.png 2x" data-dominant-color="1A181A"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">5</span><span class="informations">1600×900 107 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>here,<br>
“警告” in chinese means warning in english,<br>
“已弃用” in chinese means deprecated in english.</p>
<p>I check that there warnings also appear when building XNNPACK and QNNPACK.</p>
<p>I also rerun the issue on many other aarch64 OSs, for example, Ubuntu Server 18.04 &amp; 20.04, and Raspberry Pi OS (aarch64 version, NOT armv7l version!), all of the building processes met the same “pthreadpool deprecated” issue.</p>
<p>In fact, I built pytorch/libtorch on Raspberry Pi OS (armv7l version) at the very beginning, it was built sucessfully, and no “pthreadpool deprecated” issue was met at all. I thought “the armv7l sucess can be directly used in building pytorch on aarch64”, but it failed.</p>
<p>Building from source on Linux x86-64 does not meet the “pthreadpool” issue, and it is also sucess.</p>
<p>So, I want to ask why this “pthreadpool deprecated” appears in aarch64? And how can I build a “correct” pytorch/libtorch on aarch64 OSs?</p>
<p>Notice that building newer version of PyTorch can be a little different from building older versions.</p>