0

按照 tarball 顶层目录中 INSTALL 文件中的说明,我执行了

cp Make.inc/Makefile.debian.PAR ./Makefile.inc

然后我跑了make。但是,我遇到了以下错误。

make[1]: Entering directory '../MUMPS_5.2.1/examples'
mpif90 -O -fopenmp  -I. -I../include -I../src -c dsimpletest.F -o dsimpletest.o
mpif90 -o dsimpletest -O -fopenmp dsimpletest.o  ../lib/libdmumps.a ../lib/libmumps_common.a   
-L/usr/lib  -lmetis -L../PORD/lib/ -lpord -L/usr/lib -lesmumps -lscotch -lscotcherr -lscalapack- 
openmpi -llapack  -lblas -lpthread
/usr/bin/ld: ../lib/libdmumps.a(dend_driver.o): undefined reference to symbol 'blacs_gridexit_'
//usr/lib/libblacs-openmpi.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:36: recipe for target 'dsimpletest' failed
make[1]: *** [dsimpletest] Error 1
make[1]: Leaving directory '/.../MUMPS_5.2.1/examples'
Makefile:52: recipe for target 'dexamples' failed
make: *** [dexamples] Error 2

为了追查错误的来源,我依次尝试了每个精度

make s     # single precision real
make d     # double precision real
make c     # complex
make z     # double complex

他们每个人都跑到完成。只有未编译的示例以下命令均无效。他们都因相同的错误而失败

make sexamples
make dexamples
make cexamples
make zexamples

常见错误:

mpif90 -o dsimpletest -O -fopenmp dsimpletest.o  ../lib/libdmumps.a ../lib/libmumps_common.a   
-L/usr/lib  -lmetis -L../PORD/lib/ -lpord -L/usr/lib -lesmumps -lscotch -lscotcherr -lscalapack- 
openmpi -llapack  -lblas -lpthread
/usr/bin/ld: ../lib/libdmumps.a(dend_driver.o): undefined reference to symbol 'blacs_gridexit_'
//usr/lib/libblacs-openmpi.so.1: error adding symbols: DSO missing from command line

我安装了所有这些包含 blacs 的软件包,但仍然无法正常工作

   sudo apt install libscalapack-openmpi1
   sudo apt install libscalapack-mpi-dev
   sudo apt install libblacs-mpi-dev
   sudo apt install libblacs-openmpi1
   sudo apt install blacs-mpi-test blacs-test-common

接下来做什么 ?

4

1 回答 1

0

tarball 中的示例目录有自己的 Makefile。它从顶层目录导入 Makefile.inc

原始的 Makefile.inc

LIBBLAS = -lblas
LIBOTHERS = -lpthread

如果你已经安装了上面所有的 blacs 包,你的 /usr/lib 看起来像这样

 find . -iname "*blacs*"
./libblacs-openmpi.so.1.1
./libblacsF77init-openmpi.a
./libblacsCinit-openmpi.so.1
./libblacsF77init-openmpi.so.1
./blacs
./blacs/fblacs_test_shared-openmpi
./blacs/cblacs_test_shared-openmpi
./blacs/fblacs_test_static-openmpi
./blacs/cblacs_test_static-openmpi
./libblacsCinit-openmpi.a
./libblacs-openmpi.a
./libblacsCinit-openmpi.so.1.1
./libblacsF77init-openmpi.so.1.1
./libblacs-openmpi.so
./libblacsF77init-openmpi.so
./libblacsCinit-openmpi.so
./libblacs-openmpi.so.1

将 Makefile.inc 中的行更改为

LIBBLAS   = -lblas
LIBOTHERS = -lpthread -lblacs-openmpi

一切都开始为我工作。现在执行的编译器命令是

mpif90 -o dsimpletest -O -fopenmp dsimpletest.o  ../lib/libdmumps.a ../lib/libmumps_common.a    
-L/usr/lib  -lmetis -L../PORD/lib/ -lpord -L/usr/lib -lesmumps -lscotch -lscotcherr -lscalapack-
openmpi -llapack  -lblas -lpthread -lblacs-openmpi

...与没有 -lblacs-openmpi 链接器命令的原始命令相反。

现在示例目录包含所有构建的可执行示例。

于 2019-11-11T07:57:35.857 回答