<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Can you try...<div><br></div><div>mpicc -o main.o -c main.c</div><div>mpicc -o hello main.o</div><div><br></div><div>You should see the main.o in the directory, if no errors on the screen then it sounds like its working fine.</div><div><br></div><div><br></div><div>S.</div><div><br><div><div>On 15 Aug 2010, at 16:21, sasha lambert wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I tried compiling using mpicc, and nothing seems to happen.<div>The prompt just reappears and no executable file has been made.</div><div><br></div><div>Sasha<br><div><br><div class="gmail_quote">On Sun, Aug 15, 2010 at 11:12 AM, Si Hammond <span dir="ltr">&lt;<a href="mailto:simon.hammond@gmail.com">simon.hammond@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">Have you tried compiling with mpicc?<div><br></div><div>mpicc -o hello main.c&nbsp;</div>
<div><br></div><div>This sets up the linking etc for you.</div><div><br></div><div><br></div><div><br></div><div>S.</div><div><br></div><div><br><div><div><div></div><div class="h5"><div>On 15 Aug 2010, at 16:02, sasha lambert wrote:</div>
<br></div></div><blockquote type="cite"><div><div></div><div class="h5">I'm fairly new to unix and mpich, so please bear with me.<div><br></div><div>I've tried to compile a simple "hello" program below:</div>
<div><br></div><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(0, 139, 0)">
/*The Parallel Hello World Program*/</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(126, 70, 35)">#include <span style="color:#e00000">&lt;stdio.h&gt;</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(126, 70, 35)">
#include <span style="color:#e00000">&lt;mpi.h&gt;</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;min-height:13px"><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
main(<span style="color:#c800a3">int</span> argc, <span style="color:#c800a3">char</span> **argv)</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">{</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<span style="white-space:pre-wrap">        </span><span style="color:#c800a3">int</span> node;</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="white-space:pre-wrap">        </span><span style="color:#430084">MPI_Init</span>(&amp;argc,&amp;argv);</div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(126, 70, 35)"><span style="color:#000000"><span style="white-space:pre-wrap">        </span></span><span style="color:#430084">MPI_Comm_rank</span><span style="color:#000000">(</span>MPI_COMM_WORLD<span style="color:#000000">, &amp;node);</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><span style="white-space:pre-wrap">        </span><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(224, 0, 0)">
<span style="color:#000000"><span style="white-space:pre-wrap">        </span></span><span style="color:#430084">printf</span><span style="color:#000000">(</span>"Hello World from Node %d\n"<span style="color:#000000">,node);</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><span style="white-space:pre-wrap">        </span><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(67, 0, 132)">
<span style="color:#000000"><span style="white-space:pre-wrap">        </span></span>MPI_Finalize<span style="color:#000000">();</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">}</div></div>
<div><br></div><div>Here is the shell response:</div><div><br></div><div><div>$ gcc main.c -o hello</div><div>Undefined symbols:</div><div>&nbsp;&nbsp;"_MPI_Comm_rank", referenced from:</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp;_main in ccWLoMyo.o</div><div>&nbsp;&nbsp;"_MPI_Finalize", referenced from:</div><div>&nbsp;&nbsp; &nbsp; &nbsp;_main in ccWLoMyo.o</div><div>&nbsp;&nbsp;"_MPI_Init", referenced from:</div><div>&nbsp;&nbsp; &nbsp; &nbsp;_main in ccWLoMyo.o</div><div>

ld: symbol(s) not found</div><div>collect2: ld returned 1 exit status</div></div><div><br></div><div>I tried searching for "MPI_init" in libmpich.a, thinking it might have to do with the added underscore in " _MPI_Init".</div>

<div>Shell response:</div><div><br></div><div><div>$ nm libmpich.a | grep mpi_init</div><div>nm: can't open file: libmpich.a (No such file or directory)</div></div><div><br></div><div>I've added usr/local/lib to the PATH, but still nothing. Any suggestions?</div>

<div><br></div><div>Thanks,</div><div>Sasha</div></div></div>
_______________________________________________<br>mpich-discuss mailing list<br><a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.gov</a><br><a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
</blockquote></div><br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-size:12px"><div>
<br>---------------------------------------------------------------------------------------</div><div>Si Hammond</div><div><br></div><div>Research Fellow &amp;&nbsp;Knowledge Transfer Associate</div><div>Performance Computing &amp; Visualisation Group</div>
<div>Department of Computer Science</div><div>University of Warwick, CV4 7AL, UK</div><div><a href="http://go.warwick.ac.uk/hpsg" target="_blank">http://go.warwick.ac.uk/hpsg</a></div><div>----------------------------------------------------------------------------------------</div>
<div><span style="font-size:medium"><br></span></div></span></span></div></span></div></span></div></span></div></span></div></span><br></span><br>
</div>
<br></div></div><br>_______________________________________________<br>
mpich-discuss mailing list<br>
<a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
<br></blockquote></div><br></div></div>
_______________________________________________<br>mpich-discuss mailing list<br><a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss<br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="font-size: 12px; "><div><br class="Apple-interchange-newline">---------------------------------------------------------------------------------------</div><div>Si Hammond</div><div><br></div><div>Research Fellow &amp;&nbsp;Knowledge Transfer Associate</div><div>Performance Computing &amp; Visualisation Group</div><div>Department of Computer Science</div><div>University of Warwick, CV4 7AL, UK</div><div><a href="http://go.warwick.ac.uk/hpsg">http://go.warwick.ac.uk/hpsg</a></div><div>----------------------------------------------------------------------------------------</div><div><span class="Apple-style-span" style="font-size: medium; "><br></span></div></span></span></div></span></div></span></div></span></div></span></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>