LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2003-08-04 16:29:00


You probably want to use mpicc, not gcc. mpicc is a "wrapper" compiler
that simply adds in all the relevant -I, -L, and -l arguments for you and
then invokes the corresponding back-end compiler to actually compile/link
the file. This will fix the "undefined reference" problems that you are
seeing below.

On Mon, 4 Aug 2003, Dupros Fabrice wrote:

> I am trying to install the blocksolve95 package to solve a sparse
> linear system, Blocksolve uses the Petsc makefile facilities. I am
> running a linux cluster
>
> Everything is ok for building the library linkink with he libg2c.a library
> and the default gnu compiler
> When i try to execute the examples programs provided i have got this kind of
> error :
>
>
>
> gcc -DPARCH_linux -pipe -c -I/home/dupros/BlockSolve95/include -Dmpi
> -I/usr/local/lam/include -g -DPETSC_DEBUG -DPETSC_LOG -DPETSC_BOPT_g
> master4.c
> gcc -DPARCH_linux -pipe -c -I/home/dupros/BlockSolve95/include -Dmpi
> -I/usr/local/lam/include -g -DPETSC_DEBUG -DPETSC_LOG -DPETSC_BOPT_g
> worker4.c
> gcc -DPARCH_linux -pipe -c -I/home/dupros/BlockSolve95/include -Dmpi
> -I/usr/local/lam/include -g -DPETSC_DEBUG -DPETSC_LOG -DPETSC_BOPT_g
> get_mat4.c
> gcc -g -DPETSC_DEBUG -DPETSC_LOG -DPETSC_BOPT_g -o grid4.linux master4.o
> worker4.o get_mat4.o\
> num_grid3d.o free_grid.o
> /home/dupros/BlockSolve95/lib/libg/linux/libBS95.a /usr/lib/liblapack.a
> /usr/lib/libblas.a /usr/lib/gcc-lib/i386-redhat-linux/3.2/libg2c.a -lm
> /usr/local/lam/lib/libmpi.a /usr/lib/gcc-lib/i386-redhat-linux/3.2/libg2c.a
> -lm -lc -lm
> /usr/local/lam/lib/libmpi.a(allgather.o): In function `MPI_Allgather':
> allgather.o(.text+0x81): undefined reference to `_kio'
> allgather.o(.text+0xf5): undefined reference to `_kio'
> /usr/local/lam/lib/libmpi.a(allreduce.o): In function `MPI_Allreduce':
> allreduce.o(.text+0x59): undefined reference to `_kio'
> allreduce.o(.text+0xb9): undefined reference to `_kio'
> /usr/local/lam/lib/libmpi.a(barrier.o): In function `MPI_Barrier':
> barrier.o(.text+0x5d): undefined reference to `_kio'
> /usr/local/lam/lib/libmpi.a(barrier.o)(.text+0x1aa): more undefined
> references to `_kio' follow
> /usr/local/lam/lib/libmpi.a(finalize.o): In function `MPI_Finalize':
> finalize.o(.text+0x155): undefined reference to `lam_kexit'
> /usr/local/lam/lib/libmpi.a(finalize.o): In function `free_comm':
> finalize.o(.text+0x28d): undefined reference to `ah_free'
> finalize.o(.text+0x2ed): undefined reference to `ah_free'
> finalize.o(.text+0x2fe): undefined reference to `al_free'
> /usr/local/lam/lib/libmpi.a(gather.o): In function `MPI_Gather':
> gather.o(.text+0xb1): undefined reference to `_kio'
> gather.o(.text+0xe6): undefined reference to `_kio'
> /usr/local/lam/lib/libmpi.a(gather.o): In function `gather':
> gather.o(.text+0x1bd): undefined reference to `_kio'
> /usr/local/lam/lib/libmpi.a(init.o): In function `MPI_Init':
> init.o(.text+0xbe): undefined reference to `show_help'
> init.o(.text+0x13c): undefined reference to `_kio'
> init.o(.text+0x250): undefined reference to `_kio'
> init.o(.text+0x26a): undefined reference to `_kio'
>
>
>
>
> any ideas ?
> i also use the default gnu compiler to build the lam library
>
> thanks
>
>
>
>
>
> ****************************************************************************************
> Le contenu de cet e-mail et de ses pièces jointes est destiné à l'usage exclusif du
> (des) destinataire(s) expressément désigné(s) comme tel(s).
> En cas de réception de cet e-mail par erreur, le signaler à son expéditeur et ne pas en
> divulguer le contenu.
> L'absence de virus a été vérifiée à l'émission du message. Il convient néanmoins de
> vérifier l'absence de corruption à sa réception.
>
> The content of this e-mail and attachments is intended for the named recipients only.
> If you have received this e-mail by error, please notify the sender and do not disclose,
> in any case, its content.
> This mail was scanned for virus content when emitted, anyhow please check for any
> corruption upon reception.
> ****************************************************************************************
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/