在 Ubuntu 中编译 SuiteSparse,在安装 CHOLMOD 时中断

Compiling SuiteSparse in Ubuntu, breaks when installing CHOLMOD

我从以下 GitHub 下载了 SuiteSparse 的 .zip。我正在尝试 install/compile C/C++ Ubuntu 中的库。我正在为 Linux 使用 Windows 子系统,并从 Microsoft Store 安装了 Ubuntu。

SuiteSparse 说明说要 cd 到 SuiteSparse-5.5.0 目录,然后键入 make。生成文件 here。自述文件建议我需要 make、g++、gcc 和 cmake,因此我使用 sudo apt install <package name> 安装了它们。这是我从 make 2>error:

得到的错误信息
/mnt/c/Users/Anshu/path/to/SuiteSparse-5.5.0/metis-5.1.0/GKlib/csr.c: In function ‘gk_csr_Normalize’:
/mnt/c/Users/Anshu/path/to/SuiteSparse-5.5.0/metis-5.1.0/GKlib/csr.c:1344:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
    else if (norm == 1)
         ^~
/mnt/c/Users/Anshu/path/to/SuiteSparse-5.5.0/metis-5.1.0/GKlib/csr.c:1346:11: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
           for (j=ptr[i]; j<ptr[i+1]; j++)
           ^~~
/mnt/c/Users/Anshu/path/to/SuiteSparse-5.5.0/metis-5.1.0/GKlib/csr.c:1371:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
    else if (norm == 1)
         ^~
/mnt/c/Users/Anshu/path/to/SuiteSparse-5.5.0/metis-5.1.0/GKlib/csr.c:1373:11: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
           for (j=ptr[i]; j<ptr[i+1]; j++)
           ^~~
/mnt/c/Users/Anshu/path/to/SuiteSparse-5.5.0/metis-5.1.0/GKlib/getopt.c: In function ‘gk_getopt_internal’:
/mnt/c/Users/Anshu/path/to/SuiteSparse-5.5.0/metis-5.1.0/GKlib/getopt.c:343:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (gk_optind == 0)
     ^~
/mnt/c/Users/Anshu/path/to/SuiteSparse-5.5.0/metis-5.1.0/GKlib/getopt.c:345:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
       optstring = gk_getopt_initialize (argc, argv, optstring);
       ^~~~~~~~~
/mnt/c/Users/Anshu/path/to/SuiteSparse-5.5.0/metis-5.1.0/GKlib/getopt.c:700:2: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
  else
  ^~~~
/mnt/c/Users/Anshu/path/to/SuiteSparse-5.5.0/metis-5.1.0/GKlib/getopt.c:703:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
    nextchar = NULL;
    ^~~~~~~~
ar: creating libsuitesparseconfig.a
cc1: warning: command line option ‘-Woverloaded-virtual’ is valid for C++/ObjC++ but not for C
ar: creating libamd.a
ar: creating libbtf.a
ar: creating libcamd.a
ar: creating libccolamd.a
ar: creating libcolamd.a
ar: creating libcholmod.a
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lopenblas
collect2: error: ld returned 1 exit status
make[3]: *** [/mnt/c/Users/Anshu/path/to/SuiteSparse-5.5.0/lib/libcholmod.so.3.0.13] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [library] Error 2
make[1]: *** [all] Error 2
make: *** [go] Error 2

我已经关闭了防病毒软件,它一直在阻止 makefile 写入某些文件夹。可能出了什么问题?似乎 makefile 试图安装一堆以 CHOLMOD 开头的库,但在安装时停滞了。我读了一些 related questions。第一个似乎不适用于此处,因为我没有更改 PATH,第二个建议使用我已经在做的 Metis。

安装 LLAPACK 和 OpenBLAS 开发库。在 Ubuntu 上,命令是:

sudo apt install liblapack-dev  libopenblas-dev