gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 14:32:43 36 4
gpt4 key购买 nike

我已从以下位置下载了 SuiteSparse 的 .zip GitHub 。我正在尝试在 Ubuntu 中安装/编译 C/C++ 库。我正在使用适用于 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

关于c++ - 在 Ubuntu 中编译 SuiteSparse,安装 CHOLMOD 时中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59696445/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com