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