Pytorch-1.19 issue in building

kush: <p>Hi guys</p>
<p>i cloned pytorch source file from github link : <a href="https://github.com/pytorch/pytorch/tree/v1.9.0" class="inline-onebox" rel="noopener nofollow ugc">GitHub - pytorch/pytorch at v1.9.0</a><br>
i am facing issue in building pytorch-1.19, I am getting this log, if anyone having any solution please help me.</p>
<h2>
<a name="warning-pytorch-v190gitautoinc08ce5eedf5-r0-do_populate_lic-pytorch-no-generic-license-file-exists-for-unknown-in-any-provider-warning-pytorch-v190gitautoinc08ce5eedf5-r0-do_populate_lic-pytorch-no-generic-license-file-exists-for-bsd-3-in-any-provider-error-pytorch-v190gitautoinc08ce5eedf5-r0-do_configure-execution-of-homeperformpackage-createkushsourcesfu540-buildtmp-glibcworkriscv64-oe-linuxpytorchv190gitautoinc08ce5eedf5-r0temprundo_configure7816-failed-with-exit-code-1-the-cxx-compiler-identification-is-gnu-1020-the-c-compiler-identification-is-gnu-1020-detecting-cxx-compiler-abi-info-detecting-cxx-compiler-abi-info-done-check-for-working-cxx-compiler-homeperformpackage-createkushsourcesfu540-buildtmp-glibcworkriscv64-oe-linuxpytorchv190gitautoinc08ce5eedf5-r0recipe-sysroot-nativeusrbinriscv64-oe-linuxriscv64-oe-linux-g-skipped-detecting-cxx-compile-features-detecting-cxx-compile-features-done-detecting-c-compiler-abi-info-detecting-c-compiler-abi-info-done-check-for-working-c-compiler-homeperformpackage-createkushsourcesfu540-buildtmp-glibcworkriscv64-oe-linuxpytorchv190gitautoinc08ce5eedf5-r0recipe-sysroot-nativeusrbinriscv64-oe-linuxriscv64-oe-linux-gcc-skipped-detecting-c-compile-features-detecting-c-compile-features-done-not-forcing-any-particular-blas-to-be-found-could-not-find-ccache-consider-installing-ccache-to-speed-up-compilation-build-type-not-set-defaulting-to-release-performing-test-compiler_works-cmake-error-try_run-invoked-in-cross-compiling-mode-please-set-the-following-cache-variables-appropriately-compiler_works_exitcode-advanced-compiler_works_exitcode__tryrun_output-advanced-for-details-see-homeperformpackage-createkushsourcesfu540-buildtmp-glibcworkriscv64-oe-linuxpytorchv190gitautoinc08ce5eedf5-r0buildtryrunresultscmake-performing-test-compiler_works-failed-performing-test-support_glibcxx_use_c99-performing-test-support_glibcxx_use_c99-success-performing-test-caffe2_exception_ptr_supported-performing-test-caffe2_exception_ptr_supported-success-stdexception_ptr-is-supported-performing-test-caffe2_need_to_turn_off_deprecation_warning-performing-test-caffe2_need_to_turn_off_deprecation_warning-failed-turning-off-deprecation-warning-due-to-glog-performing-test-caffe2_compiler_supports_avx2_extensions-performing-test-caffe2_compiler_supports_avx2_extensions-failed-performing-test-caffe2_compiler_supports_avx512_extensions-performing-test-caffe2_compiler_supports_avx512_extensions-failed-performing-test-compiler_supports_hidden_visibility-performing-test-compiler_supports_hidden_visibility-success-performing-test-compiler_supports_hidden_inline_visibility-performing-test-compiler_supports_hidden_inline_visibility-success-performing-test-compiler_supports_rdynamic-performing-test-compiler_supports_rdynamic-success-building-using-own-protobuf-under-third_party-per-request-use-custom-protobuf-build-1" class="anchor" href="#warning-pytorch-v190gitautoinc08ce5eedf5-r0-do_populate_lic-pytorch-no-generic-license-file-exists-for-unknown-in-any-provider-warning-pytorch-v190gitautoinc08ce5eedf5-r0-do_populate_lic-pytorch-no-generic-license-file-exists-for-bsd-3-in-any-provider-error-pytorch-v190gitautoinc08ce5eedf5-r0-do_configure-execution-of-homeperformpackage-createkushsourcesfu540-buildtmp-glibcworkriscv64-oe-linuxpytorchv190gitautoinc08ce5eedf5-r0temprundo_configure7816-failed-with-exit-code-1-the-cxx-compiler-identification-is-gnu-1020-the-c-compiler-identification-is-gnu-1020-detecting-cxx-compiler-abi-info-detecting-cxx-compiler-abi-info-done-check-for-working-cxx-compiler-homeperformpackage-createkushsourcesfu540-buildtmp-glibcworkriscv64-oe-linuxpytorchv190gitautoinc08ce5eedf5-r0recipe-sysroot-nativeusrbinriscv64-oe-linuxriscv64-oe-linux-g-skipped-detecting-cxx-compile-features-detecting-cxx-compile-features-done-detecting-c-compiler-abi-info-detecting-c-compiler-abi-info-done-check-for-working-c-compiler-homeperformpackage-createkushsourcesfu540-buildtmp-glibcworkriscv64-oe-linuxpytorchv190gitautoinc08ce5eedf5-r0recipe-sysroot-nativeusrbinriscv64-oe-linuxriscv64-oe-linux-gcc-skipped-detecting-c-compile-features-detecting-c-compile-features-done-not-forcing-any-particular-blas-to-be-found-could-not-find-ccache-consider-installing-ccache-to-speed-up-compilation-build-type-not-set-defaulting-to-release-performing-test-compiler_works-cmake-error-try_run-invoked-in-cross-compiling-mode-please-set-the-following-cache-variables-appropriately-compiler_works_exitcode-advanced-compiler_works_exitcode__tryrun_output-advanced-for-details-see-homeperformpackage-createkushsourcesfu540-buildtmp-glibcworkriscv64-oe-linuxpytorchv190gitautoinc08ce5eedf5-r0buildtryrunresultscmake-performing-test-compiler_works-failed-performing-test-support_glibcxx_use_c99-performing-test-support_glibcxx_use_c99-success-performing-test-caffe2_exception_ptr_supported-performing-test-caffe2_exception_ptr_supported-success-stdexception_ptr-is-supported-performing-test-caffe2_need_to_turn_off_deprecation_warning-performing-test-caffe2_need_to_turn_off_deprecation_warning-failed-turning-off-deprecation-warning-due-to-glog-performing-test-caffe2_compiler_supports_avx2_extensions-performing-test-caffe2_compiler_supports_avx2_extensions-failed-performing-test-caffe2_compiler_supports_avx512_extensions-performing-test-caffe2_compiler_supports_avx512_extensions-failed-performing-test-compiler_supports_hidden_visibility-performing-test-compiler_supports_hidden_visibility-success-performing-test-compiler_supports_hidden_inline_visibility-performing-test-compiler_supports_hidden_inline_visibility-success-performing-test-compiler_supports_rdynamic-performing-test-compiler_supports_rdynamic-success-building-using-own-protobuf-under-third_party-per-request-use-custom-protobuf-build-1"></a>WARNING: pytorch-v1.9.0+gitAUTOINC+08ce5eedf5-r0 do_populate_lic: pytorch: No generic license file exists for: Unknown in any provider<br>
WARNING: pytorch-v1.9.0+gitAUTOINC+08ce5eedf5-r0 do_populate_lic: pytorch: No generic license file exists for: BSD-3 in any provider<br>
ERROR: pytorch-v1.9.0+gitAUTOINC+08ce5eedf5-r0 do_configure: Execution of ‘/home/perform/package-create/kush/sources/fu540-build/tmp-glibc/work/riscv64-oe-linux/pytorch/v1.9.0+gitAUTOINC+08ce5eedf5-r0/temp/run.do_configure.7816’ failed with exit code 1:<br>
– The CXX compiler identification is GNU 10.2.0<br>
– The C compiler identification is GNU 10.2.0<br>
– Detecting CXX compiler ABI info<br>
– Detecting CXX compiler ABI info - done<br>
– Check for working CXX compiler: /home/perform/package-create/kush/sources/fu540-build/tmp-glibc/work/riscv64-oe-linux/pytorch/v1.9.0+gitAUTOINC+08ce5eedf5-r0/recipe-sysroot-native/usr/bin/riscv64-oe-linux/riscv64-oe-linux-g++ - skipped<br>
– Detecting CXX compile features<br>
– Detecting CXX compile features - done<br>
– Detecting C compiler ABI info<br>
– Detecting C compiler ABI info - done<br>
– Check for working C compiler: /home/perform/package-create/kush/sources/fu540-build/tmp-glibc/work/riscv64-oe-linux/pytorch/v1.9.0+gitAUTOINC+08ce5eedf5-r0/recipe-sysroot-native/usr/bin/riscv64-oe-linux/riscv64-oe-linux-gcc - skipped<br>
– Detecting C compile features<br>
– Detecting C compile features - done<br>
– Not forcing any particular BLAS to be found<br>
– Could not find ccache. Consider installing ccache to speed up compilation.<br>
– Build type not set - defaulting to Release<br>
– Performing Test COMPILER_WORKS<br>
CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:<br>
COMPILER_WORKS_EXITCODE (advanced)<br>
COMPILER_WORKS_EXITCODE__TRYRUN_OUTPUT (advanced)<br>
For details see /home/perform/package-create/kush/sources/fu540-build/tmp-glibc/work/riscv64-oe-linux/pytorch/v1.9.0+gitAUTOINC+08ce5eedf5-r0/build/TryRunResults.cmake<br>
– Performing Test COMPILER_WORKS - Failed<br>
– Performing Test SUPPORT_GLIBCXX_USE_C99<br>
– Performing Test SUPPORT_GLIBCXX_USE_C99 - Success<br>
– Performing Test CAFFE2_EXCEPTION_PTR_SUPPORTED<br>
– Performing Test CAFFE2_EXCEPTION_PTR_SUPPORTED - Success<br>
– std::exception_ptr is supported.<br>
– Performing Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING<br>
– Performing Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING - Failed<br>
– Turning off deprecation warning due to glog.<br>
– Performing Test CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS<br>
– Performing Test CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS - Failed<br>
– Performing Test CAFFE2_COMPILER_SUPPORTS_AVX512_EXTENSIONS<br>
– Performing Test CAFFE2_COMPILER_SUPPORTS_AVX512_EXTENSIONS - Failed<br>
– Performing Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY<br>
– Performing Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY - Success<br>
– Performing Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY<br>
– Performing Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY - Success<br>
– Performing Test COMPILER_SUPPORTS_RDYNAMIC<br>
– Performing Test COMPILER_SUPPORTS_RDYNAMIC - Success<br>
– Building using own protobuf under third_party per request.<br>
– Use custom protobuf build.</h2>
<p>– 3.11.4.0<br>
– Looking for pthread.h<br>
– Looking for pthread.h - found<br>
– Performing Test CMAKE_HAVE_LIBC_PTHREAD<br>
– Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed<br>
– Check if compiler accepts -pthread<br>
– Check if compiler accepts -pthread - yes<br>
– Found Threads: TRUE<br>
– Performing Test protobuf_HAVE_BUILTIN_ATOMICS<br>
– Performing Test protobuf_HAVE_BUILTIN_ATOMICS - Success<br>
– Caffe2 protobuf include directory: $&lt;BUILD_INTERFACE:/home/perform/package-create/kush/sources/fu540-build/tmp-glibc/work/riscv64-oe-linux/pytorch/v1.9.0+gitAUTOINC+08ce5eedf5-r0/git/third_party/protobuf/src&gt;$&lt;INSTALL_INTERFACE:include&gt;<br>
– Trying to find preferred BLAS backend of choice: MKL<br>
– MKL_THREADING = OMP<br>
– Looking for sys/types.h<br>
– Looking for sys/types.h - found<br>
– Looking for stdint.h<br>
– Looking for stdint.h - found<br>
– Looking for stddef.h<br>
– Looking for stddef.h - found<br>
– Check size of void*<br>
– Check size of void* - done<br>
– MKL_THREADING = OMP<br>
CMake Warning at cmake/Dependencies.cmake:156 (message):<br>
MKL could not be found.  Defaulting to Eigen<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:632 (include)</p>
<p>CMake Warning at cmake/Dependencies.cmake:179 (message):<br>
Preferred BLAS (MKL) cannot be found, now searching for a general BLAS<br>
library<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:632 (include)</p>
<p>– MKL_THREADING = OMP<br>
– Checking for [mkl_intel_lp64 - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_intel_lp64: not found<br>
– Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_intel_lp64: not found<br>
– Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_intel: not found<br>
– Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_intel: not found<br>
– Checking for [mkl_gf_lp64 - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_gf_lp64: not found<br>
– Checking for [mkl_gf_lp64 - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_gf_lp64: not found<br>
– Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_gf: not found<br>
– Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_gf: not found<br>
– Checking for [mkl_intel_lp64 - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_intel_lp64: not found<br>
– Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_intel_lp64: not found<br>
– Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_intel: not found<br>
– Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_intel: not found<br>
– Checking for [mkl_gf_lp64 - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_gf_lp64: not found<br>
– Checking for [mkl_gf_lp64 - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_gf_lp64: not found<br>
– Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_gf: not found<br>
– Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_gf: not found<br>
– Checking for [mkl_intel_lp64 - mkl_gnu_thread - mkl_core - pthread - m - dl]<br>
–   Library mkl_intel_lp64: not found<br>
– Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - pthread - m - dl]<br>
–   Library mkl_intel_lp64: not found<br>
– Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]<br>
–   Library mkl_intel: not found<br>
– Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]<br>
–   Library mkl_intel: not found<br>
– Checking for [mkl_gf_lp64 - mkl_gnu_thread - mkl_core - pthread - m - dl]<br>
–   Library mkl_gf_lp64: not found<br>
– Checking for [mkl_gf_lp64 - mkl_intel_thread - mkl_core - pthread - m - dl]<br>
–   Library mkl_gf_lp64: not found<br>
– Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]<br>
–   Library mkl_gf: not found<br>
– Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]<br>
–   Library mkl_gf: not found<br>
– Checking for [mkl_intel_lp64 - mkl_sequential - mkl_core - m - dl]<br>
–   Library mkl_intel_lp64: not found<br>
– Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]<br>
–   Library mkl_intel: not found<br>
– Checking for [mkl_gf_lp64 - mkl_sequential - mkl_core - m - dl]<br>
–   Library mkl_gf_lp64: not found<br>
– Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]<br>
–   Library mkl_gf: not found<br>
– Checking for [mkl_intel_lp64 - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_intel_lp64: not found<br>
– Checking for [mkl_intel - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_intel: not found<br>
– Checking for [mkl_gf_lp64 - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_gf_lp64: not found<br>
– Checking for [mkl_gf - mkl_core - gomp - pthread - m - dl]<br>
–   Library mkl_gf: not found<br>
– Checking for [mkl_intel_lp64 - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_intel_lp64: not found<br>
– Checking for [mkl_intel - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_intel: not found<br>
– Checking for [mkl_gf_lp64 - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_gf_lp64: not found<br>
– Checking for [mkl_gf - mkl_core - iomp5 - pthread - m - dl]<br>
–   Library mkl_gf: not found<br>
– Checking for [mkl_intel_lp64 - mkl_core - pthread - m - dl]<br>
–   Library mkl_intel_lp64: not found<br>
– Checking for [mkl_intel - mkl_core - pthread - m - dl]<br>
–   Library mkl_intel: not found<br>
– Checking for [mkl_gf_lp64 - mkl_core - pthread - m - dl]<br>
–   Library mkl_gf_lp64: not found<br>
– Checking for [mkl_gf - mkl_core - pthread - m - dl]<br>
–   Library mkl_gf: not found<br>
– Checking for [mkl - guide - pthread - m]<br>
–   Library mkl: not found<br>
– MKL library not found<br>
– Checking for [blis]<br>
–   Library blis: BLAS_blis_LIBRARY-NOTFOUND<br>
– Checking for [Accelerate]<br>
–   Library Accelerate: BLAS_Accelerate_LIBRARY-NOTFOUND<br>
– Checking for [vecLib]<br>
–   Library vecLib: BLAS_vecLib_LIBRARY-NOTFOUND<br>
– Checking for [openblas]<br>
–   Library openblas: BLAS_openblas_LIBRARY-NOTFOUND<br>
– Checking for [openblas - pthread - m]<br>
–   Library openblas: BLAS_openblas_LIBRARY-NOTFOUND<br>
– Checking for [openblas - pthread - m - gomp]<br>
–   Library openblas: BLAS_openblas_LIBRARY-NOTFOUND<br>
– Checking for [goto2 - gfortran]<br>
–   Library goto2: BLAS_goto2_LIBRARY-NOTFOUND<br>
– Checking for [goto2 - gfortran - pthread]<br>
–   Library goto2: BLAS_goto2_LIBRARY-NOTFOUND<br>
– Checking for [acml - gfortran]<br>
–   Library acml: BLAS_acml_LIBRARY-NOTFOUND<br>
– Checking for [blis]<br>
–   Library blis: BLAS_blis_LIBRARY-NOTFOUND<br>
– Could NOT find Atlas (missing: Atlas_CBLAS_INCLUDE_DIR Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY)<br>
– Checking for [ptf77blas - atlas - gfortran]<br>
–   Library ptf77blas: BLAS_ptf77blas_LIBRARY-NOTFOUND<br>
– Checking for [blas]<br>
–   Library blas: BLAS_blas_LIBRARY-NOTFOUND<br>
– Cannot find a library with BLAS API. Not using BLAS.<br>
CMake Warning at cmake/Dependencies.cmake:257 (message):<br>
Target architecture “riscv64” is not supported in {Q/X}NNPACK.  Supported<br>
architectures are x86, x86-64, ARM, and ARM64.  Turn this warning off by<br>
USE_{Q/X}NNPACK=OFF.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:632 (include)</p>
<p>CMake Warning at third_party/cpuinfo/CMakeLists.txt:65 (MESSAGE):<br>
Target processor architecture “riscv64” is not supported in cpuinfo.<br>
cpuinfo will compile, but cpuinfo_initialize() will always fail.</p>
<p>CMake Warning at cmake/Dependencies.cmake:705 (message):<br>
A compiler with AVX512 support is required for FBGEMM.  Not compiling with<br>
FBGEMM.  Turn this warning off by USE_FBGEMM=OFF.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:632 (include)</p>
<p>CMake Warning at cmake/Dependencies.cmake:744 (message):<br>
Turning USE_FAKELOWP off as it depends on USE_FBGEMM.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:632 (include)</p>
<p>– Could NOT find Numa (missing: Numa_INCLUDE_DIR Numa_LIBRARIES)<br>
CMake Warning at cmake/Dependencies.cmake:793 (message):<br>
Not compiling with NUMA.  Suppress this warning with -DUSE_NUMA=OFF<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:632 (include)</p>
<p><strong>After getting this issue, i build successfully numpy and typing-extensions and adding in recipes of pytorch, again I am facing this, please help me.</strong></p>
<p>T&amp;R<br>
Kush Kumar</p>

ptrblck: <p>Based on the log it seems the build is failing in:</p>
<pre><code class="lang-auto">CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:
COMPILER_WORKS_EXITCODE (advanced)
COMPILER_WORKS_EXITCODE__TRYRUN_OUTPUT (advanced)
For details see /home/perform/package-create/kush/sources/fu540-build/tmp-glibc/work/riscv64-oe-linux/pytorch
</code></pre>
<p>which points towards cross-compiling for a RISCV platform so you might need to set these cmake variables.</p>
<p>PS: you can post code snippets and logs by wrapping them into three backticks ```, which would make debugging easier. <img src="https://discuss.pytorch.org/images/emoji/apple/wink.png?v=9" title=":wink:" class="emoji" alt=":wink:"></p>