Hello! I’m trying to build libtorch for android with linear algebra support LAPACK. For building I’ve used this guide: https://github.com/pytorch/pytorch/tree/master/android 14 and similar solution for iOS Problems with LAPACK on iOS 11
After adding flag  CMAKE_ARGS+=("-DUSE_LAPACK=ON")
The compiler results in error linking LAPACK (some external function are not found)
> Task :fbjni:compileReleaseJavaWithJavac
Note: Some input files use unchecked or unsafe operations.
....
> Task :pytorch_android:externalNativeBuildRelease
Build multiple targets pytorch_jni_arm64-v8a fbjni_arm64-v8a
ninja: Entering directory 
....
[17/17] Linking CXX shared library ../../../../build/intermediates/cmake/release/obj/arm64-v8a/libpytorch_jni.so
FAILED: ../../../../build/intermediates/cmake/release/obj/arm64-v8a/libpytorch_jni.so
: && /home/dmitryv/Android/Sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --gcc-toolchain=/home/dmitryv/Android/Sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/dmitryv/Android/Sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security   -O2 -DNDEBUG  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -shared -Wl,-soname,libpytorch_jni.so -o ../../../../build/intermediates/cmake/release/obj/arm64-v8a/libpytorch_jni.so CMakeFiles/pytorch_jni.dir/src/main/cpp/pytorch_jni_jit.cpp.o CMakeFiles/pytorch_jni.dir/src/main/cpp/pytorch_jni_common.cpp.o  ../../../../build/intermediates/cmake/release/obj/arm64-v8a/libfbjni.so -Wl,--gc-sections -Wl,--whole-archive ../../../../src/main/jniLibs/arm64-v8a/libtorch.a ../../../../src/main/jniLibs/arm64-v8a/libtorch_cpu.a -Wl,--no-whole-archive ../../../../src/main/jniLibs/arm64-v8a/libc10.a ../../../../src/main/jniLibs/arm64-v8a/libnnpack.a ../../../../src/main/jniLibs/arm64-v8a/libXNNPACK.a ../../../../src/main/jniLibs/arm64-v8a/libpytorch_qnnpack.a ../../../../src/main/jniLibs/arm64-v8a/libeigen_blas.a ../../../../src/main/jniLibs/arm64-v8a/libcpuinfo.a ../../../../src/main/jniLibs/arm64-v8a/libclog.a -landroid -llog -latomic -lm && :
../../../../src/main/jniLibs/arm64-v8a/libtorch_cpu.a(BatchLinearAlgebra.cpp.o): In function `void at::native::lapackSolve<std::__ndk1::complex<double> >(int, int, std::__ndk1::complex<double>*, int, int*, std::__ndk1::complex<double>*, int, int*)':
/storage/pytorch/build_android/../aten/src/ATen/native/BatchLinearAlgebra.cpp:131: undefined reference to `zgesv_'

Which library do I have to link?
Any thoughts would be appreciated!