<div dir="ltr">Hi, Aleks,<div><br><div>First, I have tried to set F77 = "mpif77" and IFMPI = "false". And the example works fine.</div><div><br></div><div>The result is: </div><div>------------------------------------------------------</div><div>...</div><div>...</div><div>
<p class=""><span class="">#############################################################</span></p>
<p class=""><span class=""># Compilation successful! #</span></p>
<p class=""><span class="">#############################################################</span></p>
<p class=""><span class="">__TEXT<span class=""> </span>__DATA<span class=""> </span>__OBJC<span class=""> </span>others<span class=""> </span>dec<span class=""> </span>hex</span></p>
<p class=""><span class="">2633728<span class=""> </span>78450688<span class=""> </span>0<span class=""> </span>4295122944<span class=""> </span>4376207360<span class=""> </span>104d7a000</span></p><p class=""><span class="">---------------------------------------------------------</span></p></div><div><br></div><div>Then I set:</div><div><br></div><div>--------------------------------</div><div><div>#!/bin/bash</div><div># Nek5000 build config file</div><div># (c) 2008,2009,2010 UCHICAGO ARGONNE, LLC</div><div><br></div><div># source path </div><div>SOURCE_ROOT="/Users/wenhaowu/Documents/testcases/nek5/trunk/nek" </div><div><br></div><div># Fortran compiler</div><div>F77="mpif77"</div><div><br></div><div># C compiler</div><div>CC="mpicc"</div></div><div><br></div><div>...</div><div><br></div><div><div># OPTIONAL SETTINGS</div><div># -----------------</div><div><br></div><div># enable MPI (default true)</div><div>#IFMPI="false"</div></div><div><br></div><div>...</div><div>----------------------------------</div><div><br></div><div>When I try to run "makenek", it still turns out several errors like this:</div><div><br></div><div>-----------------------------------</div><div><div>mpicc -c -O2 -DPTRSIZE8 -DMPI -DLONGINT8 -DUNDERSCORE -DGLOBAL_LONG_LONG -DPREFIX=jl_ /Users/wenhaowu/Documents/testcases/nek5/trunk/nek/nek_comm.c -o obj/nek_comm.o</div><div><br></div><div>mpif77 -c -O2 -fdefault-real-8 -fdefault-double-8 -x f77-cpp-input -DPTRSIZE8 -DMPI -DLONGINT8 -DUNDERSCORE -DGLOBAL_LONG_LONG -I/Users/wenhaowu/Documents/testcases/nek5/examples/eddy -I/Users/wenhaowu/Documents/testcases/nek5/trunk/nek -I./ /Users/wenhaowu/Documents/testcases/nek5/trunk/nek/init_plugin.f -o obj/init_plugin.o</div><div><br></div><div>In file included from /Users/wenhaowu/Documents/testcases/nek5/trunk/nek/nek_comm.c:17:</div><div>/opt/local/include/mpich-mp/mpi.h:116:56: error: expected identifier</div><div>static const MPI_Datatype mpich_mpi_char MPICH_ATTR_TYPE_TAG(char) = MPI_CHAR;</div><div> ^</div><div>/opt/local/include/mpich-mp/mpi.h:24:106: note: expanded from macro 'MPICH_ATTR_TYPE_TAG'</div><div># define MPICH_ATTR_TYPE_TAG(type) __attribute__((type_tag_for_datatype(MPI,type)))</div><div> ^</div><div><command line>:2:13: note: expanded from here</div><div>#define MPI 1</div><div> ^</div></div><div>...</div><div>------------------------</div><div><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div>Sincerely,</div><div>Wenhao Wu</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 7, 2015 at 5:28 PM, <span dir="ltr"><<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:12pt">Hi Nicolai,<br>
<br>
Try C compiler cc and <br>
<br>
IFMPI="false"<br>
<br>
first.<br>
<br>
(Otherwise you need to be consistent and use mpif77 installed for gfortran)<br>
<br>
Aleks<br>
<br>
<br>
<br>
<br>
<br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" size="2" color="#000000"><b>From:</b> <a href="mailto:nek5000-users-bounces@lists.mcs.anl.gov" target="_blank">nek5000-users-bounces@lists.mcs.anl.gov</a> [<a href="mailto:nek5000-users-bounces@lists.mcs.anl.gov" target="_blank">nek5000-users-bounces@lists.mcs.anl.gov</a>] on behalf of <a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a> [<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a>]<br>
<b>Sent:</b> Thursday, May 07, 2015 4:03 PM<br>
<b>To:</b> <a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a><br>
<b>Subject:</b> [Nek5000-users] Compiling nek5000 with MPI on Mac.<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>
<div dir="ltr">
<div>Hi, </div>
I'm trying to use nek5000 with MPI on a Mac. OS is Yosemite.
<div><br>
Fortran compiler = gfortran:</div>
<div><br>
nikolai:eddy wenhaowu$ gfortran --version<br>
GNU Fortran (GCC) 5.1.0<br>
Copyright (C) 2014 Free Software Foundation, Inc.<br>
<br>
</div>
<div>C compiler = mpicc from mpich:<br>
<br>
</div>
<div>nikolai:eddy wenhaowu$ mpicc --version<br>
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)<br>
Target: x86_64-apple-darwin14.3.0<br>
Thread model: posix<br>
<br>
<br>
And I followed the instruction 'QuickStart':</div>
<div><br>
Here is the beginning of my 'makenek':<br>
-----------------------------------------------------------------<br>
#!/bin/bash <br>
<br>
# Nek5000 build config file <br>
<br>
# (c) 2008,2009,2010 UCHICAGO ARGONNE, LLC <br>
<br>
<br>
# source path <br>
<br>
SOURCE_ROOT="/Users/wenhaowu/Documents/testcases/nek5/trunk/nek"<br>
<br>
<br>
# Fortran compiler <br>
<br>
F77="gfortran"<br>
<br>
<br>
# C compiler <br>
<br>
CC="mpicc"<br>
<br>
<br>
# pre-processor symbol list <br>
<br>
# (set PPLIST=? to get a list of available symbols) <br>
<br>
#PPLIST="?" <br>
<br>
<br>
# plug-in list <br>
<br>
PLUGIN_LIST=""<br>
<br>
<br>
<br>
# OPTIONAL SETTINGS <br>
<br>
# ----------------- <br>
<br>
<br>
# enable MPI (default true) <br>
<br>
#IFMPI="false"<br>
<br>
...<br>
-----------------------------------------------------------------<br>
<br>
Here is my command:<br>
./makenek eddy_uv<br>
<br>
Here is an example what goes wrong:<br>
<div>-------------------------------------------------------------------------<br>
mpicc -c -O2 -DPTRSIZE8 -DMPI -DLONGINT8 -DUNDERSCORE -DGLOBAL_LONG_LONG -DPRE<br>
<br>
FIX=jl_ /Users/wenhaowu/Documents/testcases/nek5/trunk/nek/nek_comm.c -o obj/nek<br>
<br>
_comm.o<br>
<br>
In file included from /Users/wenhaowu/Documents/testcases/nek5/trunk/nek/nek_com<br>
<br>
m.c:17:<br>
<br>
/opt/local/include/mpich-mp/mpi.h:116:56: error: expected identifier<br>
<br>
static const MPI_Datatype mpich_mpi_char MPICH_ATTR_TYPE_TAG(char)<br>
<br>
= MPI_CHAR;<br>
<br>
^<br>
<br>
/opt/local/include/mpich-mp/mpi.h:24:106: note: expanded from macro 'MPICH_ATTR_TYPE_TAG'<br>
<br>
# define MPICH_ATTR_TYPE_TAG(type) __attribute__((type_tag_for_datatype(MPI,type)))<br>
<br>
^<br>
<br>
<command line>:2:13: note: expanded from here<br>
<br>
#define MPI 1<br>
-------------------------------------------------------------------------</div>
<div><br>
<div>The problem is nek5000 has #defined MPI to be 1, but the mpich header file<br>
'mpi.h' uses the symbol 'MPI' (for a completely different reason).<br>
<br>
</div>
<div>How do other people use nek5000 with mpi on a Mac?<br>
<br>
Thanks.<br>
<br>
Sincerely,<br>
<br>
Wenhao Wu<br>
</div>
</div>
</div>
</div>
</div>
</div></div></div>
</div>
</div>
<br>_______________________________________________<br>
Nek5000-users mailing list<br>
<a href="mailto:Nek5000-users@lists.mcs.anl.gov">Nek5000-users@lists.mcs.anl.gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users</a><br>
<br></blockquote></div><br></div>