Building latest version of MUMPS 5.2.1 on Ubuntu 16.04

518 views Asked by At

As instructed in the INSTALL file in the top directory of the tarball, I executed

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

Then I ran make. However, i ran into the following error.

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

To hunt down the source of the error, i tried each of the precisions in turn

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

Each of them ran to completion. It's only the examples that were not compiling None of the following commands worked. They all failed with the same error

make sexamples
make dexamples
make cexamples
make zexamples

Common error :

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

I installed all these packages that contain blacs, but still did not work

   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

What to do next ?

1

There are 1 answers

0
Arjun J Rao On

The examples directory inside the tarball has its own Makefile. It imports the Makefile.inc from the toplevel directory

The original Makefile.inc

LIBBLAS = -lblas
LIBOTHERS = -lpthread

If you've installed all the blacs package above, your /usr/lib will look something like this

 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

Change the lines in Makefile.inc to

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

Everything started working for me. The executed compiler command is now

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

... as opposed to the original command without the -lblacs-openmpi linker command.

Now the examples directory contains all the built executable examples.