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



我已经从以下GitHub下载了SuiteSparse的.zip。我正在尝试在 Ubuntu 中安装/编译 C/C++ 库。我正在使用适用于Linux的Windows子系统,并从Microsoft商店安装了Ubuntu。

SuiteSparse指令说要 cd 到 SuiteSparse-5.5.0 目录,然后键入make。在这里制作文件。自述文件建议我需要 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开始安装一堆库,并在这样做时停滞不前。我读过一些相关的问题。第一个似乎不适用于这里,因为我没有更改 PATH,第二个建议使用我已经在做的 Metis。

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

sudo apt install liblapack-dev  libopenblas-dev

相关内容

  • 没有找到相关文章

最新更新