Lapack 和 Blas 库(更改相关的 Gfortran 编译器)

Lapack 和 Blas 库(更改相关的 Gfortran 编译器)

我使用的是 Ubuntu 16.04 LTS 系统,它自带本机gcc-5gfortran-5编译器。我正在构建一个项目,该项目推荐使用 gfortran 6.3 及更高版本。因此,我安装了 PPA 测试工具链并下载了gcc-7gfortran-7编译器。并将它们设为系统默认设置。

我的程序也使用 Lapack 和 Blas 库,我通过apt-get(Synaptic 包管理器)下载了它们。

$ gfortran --version
GNU Fortran (Ubuntu 7.2.0-1ubuntu1~16.04) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ gcc --version
gcc (Ubuntu 7.2.0-1ubuntu1~16.04) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

但是,在编译程序时,我收到以下警告:

/usr/bin/ld: warning: libgfortran.so.3, needed by /usr/lib/lapack/liblapack.so,
may conflict with libgfortran.so.4

库文件.so.3

$ strings /usr/lib/gcc/x86_64-linux-gnu/5.4.1/libgfortran.so | grep "GFORTRAN_"
GFORTRAN_1.0
GFORTRAN_1.1
GFORTRAN_1.2
GFORTRAN_1.3
GFORTRAN_1.4
GFORTRAN_1.5
GFORTRAN_1.6
GFORTRAN_1.7
GFORTRAN_C99_1.0
GFORTRAN_C99_1.1
GFORTRAN_STDIN_UNIT
GFORTRAN_STDOUT_UNIT
GFORTRAN_STDERR_UNIT
GFORTRAN_UNBUFFERED_ALL
GFORTRAN_SHOW_LOCUS
GFORTRAN_OPTIONAL_PLUS
GFORTRAN_DEFAULT_RECL
GFORTRAN_LIST_SEPARATOR
GFORTRAN_CONVERT_UNIT
GFORTRAN_ERROR_BACKTRACE
GFORTRAN_UNBUFFERED_PRECONNECTED

库文件.so.4

$ strings /usr/lib/gcc/x86_64-linux-gnu/7.2.0/libgfortran.so | grep "GFORTRAN_"
GFORTRAN_7
GFORTRAN_F2C_7
GFORTRAN_C99_7
GFORTRAN_STDIN_UNIT
GFORTRAN_STDOUT_UNIT
GFORTRAN_STDERR_UNIT
GFORTRAN_UNBUFFERED_ALL
GFORTRAN_SHOW_LOCUS
GFORTRAN_OPTIONAL_PLUS
GFORTRAN_DEFAULT_RECL
GFORTRAN_LIST_SEPARATOR
GFORTRAN_CONVERT_UNIT
GFORTRAN_ERROR_BACKTRACE
GFORTRAN_UNBUFFERED_PRECONNECTED

有没有办法力量(因为我对此很陌生,所以可能忽略了一些显而易见的东西,所以我使用这个术语比较宽泛)要使用 lapack 和 blas 库gfortran-7吗?

相关内容