[CPMD-list] IFC: "undefined reference"

Dr. Balasubramanian Sundaram bala at jncasr.ac.in
Thu Feb 26 08:08:49 CET 2004


Dear Axel,
   Thanks for your help. I was not doing a "make install" earlier (for
lam),
as I wanted the original rpm-loaded binaries to be intact. Anyway, after
your advice, I did the full installation, and cpmd compiled fine. (Also,
the "-us" flag was not necessary). So, as you pointed out, it appears to 
have been an issue of misdirected library searches or something of that
sort.
Thanks!

   Currently, my Makefile (which created a cpmd.x successfully) looks
like:
--------------------------------------
FFLAGS = -c -r8 -w90 -w95 -O3 -pc64 -axM -ip -tpp7 
LFLAGS =  \
         -L/opt/intel/mkl60/lib/32 -lmkl_lapack \
         -lmkl_ia32  -lmkl_p4 -lguide \
         -static-libcxa -Xlinker -Bstatic -lsvml         \
	 /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1/libg2c.a  \
	 -Vaxlib -Xlinker -Bdynamic  
CFLAGS = -c -O2 -Wall
CPP = /lib/cpp -P -C -traditional 
CPPFLAGS = -D__Linux -D__PGI -DLAPACK -DFFT_DEFAULT \
               -DMP_LIBRARY=__MPI -DMYRINET -DLINUX_IFC  
NOOPT_FLAG = 
CC = mpicc
FC = mpif77
LD = mpif77
-----------------------------------

NOTE: The -lg2c seems to be required by libmkl_lapack; If I remove it
from 
LFLAGS, I get an undefined reference for s_copy. The following is the 
error message.
====================
/opt/intel/mkl60/lib/32/libmkl_lapack.a(ilaenv.o)(.text+0x52a): In
function `__MKL_SERV_ilaenv':
: undefined reference to `s_copy'
===================

Strangely, cpmd.x give a runtime error. I have lambooted 2 nodes
properly, and actually tried to run a job only on one node. This job
runs fine for a serial cpmd executable that was compiled with IFC and
MKL.
So, the input file seems to be fine.
I get the following runtime error.
-----------------------------
 PROGRAM CPMD STARTED AT: Thu Feb 26 12:31:44 2004  
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC        Routine            Line       
Source             
cpmd.x             08677134  Unknown               Unknown  Unknown
cpmd.x             08243965  Unknown               Unknown  Unknown
cpmd.x             00000000  Unknown               Unknown  Unknown
-----------------------------------------------------------------------------
It seems that [at least] one of the processes that was started with
mpirun did not invoke MPI_INIT before quitting (it is possible that
more than one process did not invoke MPI_INIT -- mpirun was only
notified of the first one, which was on node n0).

mpirun can *only* be used with MPI programs (i.e., programs that
invoke MPI_INIT and MPI_FINALIZE).  You can use the "lamexec" program
to run non-MPI programs over the lambooted nodes.
-----------------------------------------------------------------------------

Thanks again for your considerable help,

Best Regards,
Bala







Axel Kohlmeyer wrote:
> 
> On Wed, 25 Feb 2004, Dr. Balasubramanian Sundaram wrote:
> 
> BS> Dear All,
> BS>
> BS>     I have been having this trivial, yet nagging problem, and thought
> BS> I should seek help to preserve my sanity!
> BS>
> BS> Details: CPMD 3.7.2, IFORT (IFC's new name): version 8.0,
> BS> P4 at 3.0 GHz (with HT), Mandrake Linux 9.2 (kernel 2.4.22), with
> BS> Intel's MKL version 6.0, gcc, lam-mpi version 7.0.4
> BS>
> BS> I compiled lam-mpi using ifort compiler, using "FFLAGS=-us" option
> BS> (i.e., equivalent of "-assume underscore"). lam-mpi compiled fine,
> BS> and I could compile and run their examples/pi/fpi code properly
> BS> on two nodes.
> 
> dear bala,
> 
> stupid question: why are you messing with the underscoring, when
> you are compiling cpmd _and_ lam with the intel compiler anyway?
> 
> BS>
> BS> I have problems at the link stage for CPMD. I provide at the end of this
> BS> mail, my Makefile. Here, I give the output of the command,
> BS>
> BS> /home/bala/lam-7.0.4/tools/wrappers/mpif77 -showme
> BS>
> BS> OUTPUT:
> BS> ifort -I/usr/include -llammpio -llamf77mpi -lmpi -llam -lutil
> 
> hmm. you seem to be running lam from the compilation directory.
> most likely you are not picking up the new libraries, but
> an old set, that is installed in the default library search
> path. if my assertion is correct, than you would have to run
> 'make install' first. alternatively, you may be able to get
> away with telling the linker via -L/home/bala/lam-7.0.4/and/so/on...
> where to pick up the new libraries. but then again, you will
> run into trouble when you start the lam daemons, since lamboot
> will not find the matching executables.
> 
> BS>
> BS> All CPMD routines compile fine, but at the linker stage, I get the
> BS> error message,
> BS> =================
> BS> my_para.o(.text+0x6): In function `my_start_':
> BS> : undefined reference to `mpi_init_'
> BS> my_para.o(.text+0xbe5): In function `my_end_':
> BS> : undefined reference to `mpi_finalize_'
> BS> =================
> BS>
> BS> I appreciate your help,
> BS>
> BS> Thanks,
> BS>
> BS> Regards,
> BS> Bala
> BS> -------------------------MAKEFILE HEADER--------------------------
> BS>
> BS> FFLAGS = -c -r8 -w90 -w95 -O3 -pc64 -axM -ip -tpp7 -us
> BS>
> BS> LFLAGS =  \
> BS>          -L/opt/intel/mkl60/lib/32 -lmkl_lapack \
> BS>          -lmkl_ia32 -lmkl_p4 -lguide \
> BS>          -static-libcxa -Xlinker -Bstatic -lsvml         \
> BS>      /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1/libg2c.a  \
>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> you should not need this. this is the g77 runtime. in fact it
> may collide with the intel fortran runtime.
> 
> hope this helps,
>         axel kohlmeyer.
> 
> BS>      -Vaxlib -Xlinker -Bdynamic
> BS> CFLAGS = -c -O2 -Wall
> BS> CPP = /lib/cpp -P -C -traditional
> BS>
> BS> CPPFLAGS = -D__Linux -D__PGI -DLAPACK -DFFT_DEFAULT \
> BS>                -DMP_LIBRARY=__MPI -DMYRINET -DLINUX_IFC
> BS> NOOPT_FLAG =
> BS>
> BS> CC = /home/bala/lam-7.0.4/tools/wrappers/mpicc
> BS> FC = /home/bala/lam-7.0.4/tools/wrappers/mpif77
> BS> LD = /home/bala/lam-7.0.4/tools/wrappers/mpif77
> BS> ---------------------------------------------------------------------
> BS> _______________________________________________
> BS> CPMD-list mailing list
> BS> CPMD-list at cpmd.org
> BS> http://www.cpmd.org/mailman/listinfo/cpmd-list
> BS>
> BS>
> 
> --
> 
> =======================================================================
> Dr. Axel Kohlmeyer                        e-mail: axel.kohlmeyer at rub.de
> Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
> Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
> D-44780 Bochum  http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/
> =======================================================================



More information about the CPMD-list mailing list