[mpich-discuss] libmpich.a "No such file or directory"

Si Hammond simon.hammond at gmail.com
Sun Aug 15 10:12:43 CDT 2010


Have you tried compiling with mpicc?

mpicc -o hello main.c 

This sets up the linking etc for you.



S.


On 15 Aug 2010, at 16:02, sasha lambert wrote:

> I'm fairly new to unix and mpich, so please bear with me.
> 
> I've tried to compile a simple "hello" program below:
> 
> /*The Parallel Hello World Program*/
> #include <stdio.h>
> #include <mpi.h>
> 
> main(int argc, char **argv)
> {
> 	int node;
> 	MPI_Init(&argc,&argv);
> 	MPI_Comm_rank(MPI_COMM_WORLD, &node);
> 	
> 	printf("Hello World from Node %d\n",node);
> 	
> 	MPI_Finalize();
> }
> 
> Here is the shell response:
> 
> $ gcc main.c -o hello
> Undefined symbols:
>   "_MPI_Comm_rank", referenced from:
>       _main in ccWLoMyo.o
>   "_MPI_Finalize", referenced from:
>       _main in ccWLoMyo.o
>   "_MPI_Init", referenced from:
>       _main in ccWLoMyo.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> 
> I tried searching for "MPI_init" in libmpich.a, thinking it might have to do with the added underscore in " _MPI_Init".
> Shell response:
> 
> $ nm libmpich.a | grep mpi_init
> nm: can't open file: libmpich.a (No such file or directory)
> 
> I've added usr/local/lib to the PATH, but still nothing. Any suggestions?
> 
> Thanks,
> Sasha
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss


---------------------------------------------------------------------------------------
Si Hammond

Research Fellow & Knowledge Transfer Associate
Performance Computing & Visualisation Group
Department of Computer Science
University of Warwick, CV4 7AL, UK
http://go.warwick.ac.uk/hpsg
----------------------------------------------------------------------------------------




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20100815/cdf643a1/attachment.htm>


More information about the mpich-discuss mailing list