undefined reference to `bi_f77_get_constants_ ??

Open discussion regarding features, bugs, issues, vendors, etc.

undefined reference to `bi_f77_get_constants_ ??

Postby Rob » Fri Apr 21, 2006 6:32 am

Hi,

I am running Fedora Linux Enterprise Edition, with:
Intel Fortran compiler
Intel C/C++ compiler
Open MPI

Now I also have BLACS and scalapack installed, which
seems to go alright. However, when I compile my code
against these libraries, I get this error message:

/opt/lib/blacsCinit_MPI-LINUX-0.a(Cblacs_pinfo.o)(.text+0x4e):
In function `Cblacs_pinfo':
: undefined reference to `bi_f77_get_constants_'

I link my code against these libraries:
/opt/lib/libscalapack.a
/opt/lib/blacs_MPI-LINUX-0.a
/opt/lib/blacsCinit_MPI-LINUX-0.a
/opt/lib/blacsF77init_MPI-LINUX-0.a
-lmkl_lapack -lmkl -lgoto


Does somebody have an idea where this error message comes from?
Is something wrong in SRC/MPI/INTERNAL/ of BLACS?

See below for my Bmake.inc and SLmake.inc files
(I have stripped the comment lines).

Thank you,
Rob.

### Bmake.inc begin ###
SHELL = /bin/sh
BTOPdir = $(HOME)/Software/BLACS
COMMLIB = MPI
PLAT = LINUX
BLACSdir = $(BTOPdir)/LIB
BLACSDBGLVL = 0
BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
MPIdir = /opt
MPIdev = ch_p4
MPIplat = LINUX
MPILIBdir = $(MPIdir)/lib
MPIINCdir = $(MPIdir)/include
MPILIB = $(MPILIBdir)/libmpi_f90.a -L$(MPILIBdir) -lmpi
BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSCINIT) $(MPILIB)
INSTdir = $(BTOPdir)/INSTALL/EXE
TESTdir = $(BTOPdir)/TESTING/EXE
FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL)
CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL)
SYSINC = -I$(MPIINCdir)
INTFACE = -DAdd_
SENDIS =
BUFF = -DNoMpiBuff
TRANSCOMM = -DCSameF77
WHATMPI =
SYSERRORS =
DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL)
DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) \
$(DEBUGLVL)
BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) \
$(SYSERRORS)
F77 = mpif90
F77NO_OPTFLAGS = -xW
F77FLAGS = $(F77NO_OPTFLAGS) -O3
F77LOADER = $(F77)
F77LOADFLAGS =
CC = mpicc
CCFLAGS = $(F77FLAGS)
CCLOADER = $(CC)
CCLOADFLAGS =
ARCH = ar
ARCHFLAGS = r
RANLIB = ranlib
### Bmake.inc end ###


### SLmake.inc begin ###
SHELL = /bin/sh
home = $(HOME)/Software/scalapack-1.7.3
PLAT = LINUX
BLACSDBGLVL = 0
BLACSdir = /opt/lib
USEMPI = -DUsingMpiBlacs
SMPLIB = -L/opt/lib -lmpi -lsvml
BLACSFINIT = $(BLACSdir)/blacsF77init_MPI-LINUX-0.a
BLACSCINIT = $(BLACSdir)/blacsCinit_MPI-LINUX-0.a
BLACSLIB = $(BLACSdir)/blacs_MPI-LINUX-0.a
TESTINGdir = $(home)/TESTING
CBLACSLIB = $(BLACSCINIT) $(BLACSLIB)
FBLACSLIB = $(BLACSFINIT) $(BLACSLIB)
PBLASdir = $(home)/PBLAS
SRCdir = $(home)/SRC
TESTdir = $(home)/TESTING
PBLASTSTdir = $(TESTINGdir)
TOOLSdir = $(home)/TOOLS
REDISTdir = $(home)/REDIST
REDISTTSTdir = $(TESTINGdir)
F77 = mpif90
CC = mpicc
NOOPT =
F77FLAGS = -O3 $(NOOPT) -xW
CCFLAGS = -O3 -xW
SRCFLAG =
F77LOADER = $(F77)
CCLOADER = $(CC)
F77LOADFLAGS =
CCLOADFLAGS =
CDEFS = -DAdd_
ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib
SCALAPACKLIB = $(home)/libscalapack.a
BLASLIB = /opt/lib/libgoto.a
PBLIBS = $(SCALAPACKLIB) $(FBLACSLIB) $(BLASLIB) $(SMPLIB)
PRLIBS = $(SCALAPACKLIB) $(CBLACSLIB) $(SMPLIB)
RLIBS = $(SCALAPACKLIB) $(FBLACSLIB) $(CBLACSLIB) $(BLASLIB) $(SMPLIB)
LIBS = $(PBLIBS) $(PRLIBS)
### SLmake.inc end ###
Rob
 
Posts: 2
Joined: Fri Apr 21, 2006 5:43 am

Re: undefined reference to `bi_f77_get_constants_ ??

Postby Rob » Fri Apr 21, 2006 10:36 am

Hi,

I'm replying to my own message, as I have found a
dirty trick to bypass the problem.

At final linking stage of my code, I add the file

BLACS/SRC/MPI/INTERNAL/bi_f77_get_constants.o

to the list of object files and libraries.
Then the problem of the undefined reference is solved.

For some strange reason, this object file doesn't make it into
the blacs library files.

Any idea why this can happen?

Regards,
Rob.
Rob
 
Posts: 2
Joined: Fri Apr 21, 2006 5:43 am

Postby kajiyama » Tue Jul 18, 2006 7:09 am

Hi Rob,

I got the same error. I first tried the same workaround you showed
and the problem was fixed. Thank you for the information.

Later, I learned that the problem would not happen if Cblacs_pinfo
is called. (I had two ScaLAPACK application programs in C and only
one of them had the problem, so I tried to figured out what's the
difference.) AFAIK, a call for Cblacs_pinfo is optional, but it seems
always necessary, at lease in the case of Intel compilers.

I hope this helps future users of ScaLAPACK.
kajiyama
 
Posts: 1
Joined: Tue Jul 18, 2006 6:52 am

Postby mwojc » Sun Jul 30, 2006 3:48 pm

Hallo!

Guys, I got the same linking errors and this is in fact a strange ifort linker issue. You should compile with

/opt/lib/blacs_MPI-LINUX-0.a
/opt/lib/blacsCinit_MPI-LINUX-0.a
/opt/lib/blacsF77init_MPI-LINUX-0.a
and once again
/opt/lib/blacs_MPI-LINUX-0.a

This is because blacsCinit and blacsF77init calls functions from blacs library. This is strange however that the library order is of importance here. Is there an option for ifort which can fix it?
mwojc
 
Posts: 1
Joined: Sun Jul 30, 2006 3:34 pm

Postby Julien Langou » Tue Aug 01, 2006 9:57 am

Hello,
yes this is a general rule and this has nothing to do with the ifort. The Intel linker is doing his job correclty and you will have this problem with any reasonnable linker. For a blacs programm, you (almost) always need to repeat the libraries in the order you mentionned, there is no way around at the user level.
Julien.
Julien Langou
 
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 3 guests