I am compiling the package BLACS on Linux. I compiled the package, the contents of the INSTALL directory. When I try to build the contents of the directory TESTING, I get errors
blacstest.f:(.text+0xb9): undefined reference to `blacs_gridinit_'
etc.
When I tried looking for the function in the library, the message I get is,
~/sources/BLACS/LIB$ nm blacs_MPI-LINUX-0.a | less | grep blacs_gridinit_
blacs_gridinit_.o:
0000000000000000 T blacs_gridinit__
Cblacs_gridinit_.oo:
So the function exists, but with a double underscore. How to make it have just one?
I have tried a few things in Bmake.inc.
# INTFACE = -Df77IsF2C
# INTFACE = -fno-underscoring
INTFACE = -DAdd_
But none of it seems to work. Anyone has some experience with this?
Thanks,
Elan.
EDIT:
BLACS comes with a .inc file where everything is configured. I have:
F77 = mpif77
F77NO_OPTFLAGS =
F77FLAGS = $(F77NO_OPTFLAGS) -O -fPIC
F77LOADER = $(F77)
F77LOADFLAGS =
CC = mpicc
CCFLAGS = -O4 -fPIC
CCLOADER = $(CC)
CCLOADFLAGS =
-assume 2underscore was not accepted in either of the compile flags. In addition, the template .inc file says:
# ---------------------------------------------------------------------------
# The Fortran 77 to C interface to be used. If you are unsure of the correct
# setting for your platform, compile and run BLACS/INSTALL/xintface.
# Choices are: Add_, NoChange, UpCase, or f77IsF2C.
# ---------------------------------------------------------------------------
# INTFACE = -Df77IsF2C
EasyBuild (partially) solves this issue for you, see https://github.com/hpcugent/easybuild-easyblocks/blob/master/easybuild/easyblocks/b/blacs.py for the Python code that implements the build procedure for BLACS.
It doesn’t build the tests (yet), but it does build BLACS in the correct way.
As you already saw in the template.inc file, you should build the xintface tool and run it, which will help you figure out what the correct setting for INTFACE is.
You also need to make sure the TRANSCOMM setting is correct, you can use the xtc_CsameF77 and xtc_UseMpich tools for that.
Once you’ve figured the values for INTFACE and TRANSCOMM out, rebuild BLACS and set these on the make command line. Then try building the tests again (using the same options).