[Nek5000-users] Compiling nek5000 with MPI on Mac.

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Wed May 13 14:02:45 CDT 2015


Hi, Aleks,

First, I have tried to set F77 = "mpif77" and IFMPI = "false". And the
example works fine.

The result is:
------------------------------------------------------
...
...

#############################################################

#                  Compilation successful!                  #

#############################################################

__TEXT __DATA __OBJC others dec hex

2633728 78450688 0 4295122944 4376207360 104d7a000

---------------------------------------------------------

Then I set:

--------------------------------
#!/bin/bash
# Nek5000 build config file
# (c) 2008,2009,2010 UCHICAGO ARGONNE, LLC

# source path
SOURCE_ROOT="/Users/wenhaowu/Documents/testcases/nek5/trunk/nek"

# Fortran compiler
F77="mpif77"

# C compiler
CC="mpicc"

...

# OPTIONAL SETTINGS
# -----------------

# enable MPI (default true)
#IFMPI="false"

...
----------------------------------

When I try to run "makenek", it still turns out several errors like this:

-----------------------------------
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

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

In file included from
/Users/wenhaowu/Documents/testcases/nek5/trunk/nek/nek_comm.c:17:
/opt/local/include/mpich-mp/mpi.h:116:56: error: expected identifier
static const MPI_Datatype mpich_mpi_char
MPICH_ATTR_TYPE_TAG(char)               = MPI_CHAR;
                                                       ^
/opt/local/include/mpich-mp/mpi.h:24:106: note: expanded from macro
'MPICH_ATTR_TYPE_TAG'
#    define MPICH_ATTR_TYPE_TAG(type)
__attribute__((type_tag_for_datatype(MPI,type)))

                             ^
<command line>:2:13: note: expanded from here
#define MPI 1
            ^
...
------------------------


Sincerely,
Wenhao Wu


On Thu, May 7, 2015 at 5:28 PM, <nek5000-users at lists.mcs.anl.gov> wrote:

>  Hi Nicolai,
>
> Try C compiler cc and
>
> IFMPI="false"
>
> first.
>
> (Otherwise you need to be consistent and use mpif77 installed for gfortran)
>
> Aleks
>
>
>
>
>
>  ------------------------------
> *From:* nek5000-users-bounces at lists.mcs.anl.gov [
> nek5000-users-bounces at lists.mcs.anl.gov] on behalf of
> nek5000-users at lists.mcs.anl.gov [nek5000-users at lists.mcs.anl.gov]
> *Sent:* Thursday, May 07, 2015 4:03 PM
> *To:* nek5000-users at lists.mcs.anl.gov
> *Subject:* [Nek5000-users] Compiling nek5000 with MPI on Mac.
>
>   Hi,
> I'm trying to use nek5000 with MPI on a Mac.  OS is Yosemite.
>
> Fortran compiler = gfortran:
>
> nikolai:eddy wenhaowu$ gfortran --version
> GNU Fortran (GCC) 5.1.0
> Copyright (C) 2014 Free Software Foundation, Inc.
>
>  C compiler = mpicc from mpich:
>
>  nikolai:eddy wenhaowu$ mpicc --version
> Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
> Target: x86_64-apple-darwin14.3.0
> Thread model: posix
>
>
> And I followed the instruction 'QuickStart':
>
> Here is the beginning of my 'makenek':
> -----------------------------------------------------------------
> #!/bin/bash
>
>
> # Nek5000 build config file
>
>
> # (c) 2008,2009,2010 UCHICAGO ARGONNE, LLC
>
>
>
> # source path
>
>
> SOURCE_ROOT="/Users/wenhaowu/Documents/testcases/nek5/trunk/nek"
>
>
> # Fortran compiler
>
>
> F77="gfortran"
>
>
> # C compiler
>
>
> CC="mpicc"
>
>
> # pre-processor symbol list
>
>
> # (set PPLIST=? to get a list of available symbols)
>
>
> #PPLIST="?"
>
>
>
> # plug-in list
>
>
> PLUGIN_LIST=""
>
>
>
> # OPTIONAL SETTINGS
>
>
> # -----------------
>
>
>
> # enable MPI (default true)
>
>
> #IFMPI="false"
>
> ...
> -----------------------------------------------------------------
>
> Here is my command:
> ./makenek eddy_uv
>
> Here is an example what goes wrong:
> -------------------------------------------------------------------------
> mpicc -c  -O2 -DPTRSIZE8 -DMPI -DLONGINT8 -DUNDERSCORE -DGLOBAL_LONG_LONG
>  -DPRE
>
> FIX=jl_ /Users/wenhaowu/Documents/testcases/nek5/trunk/nek/nek_comm.c -o
> obj/nek
>
> _comm.o
>
> In file included from
> /Users/wenhaowu/Documents/testcases/nek5/trunk/nek/nek_com
>
> m.c:17:
>
> /opt/local/include/mpich-mp/mpi.h:116:56: error: expected identifier
>
> static const MPI_Datatype mpich_mpi_char
> MPICH_ATTR_TYPE_TAG(char)
>
>                = MPI_CHAR;
>
>                                                        ^
>
> /opt/local/include/mpich-mp/mpi.h:24:106: note: expanded from macro
> 'MPICH_ATTR_TYPE_TAG'
>
> #    define MPICH_ATTR_TYPE_TAG(type)
> __attribute__((type_tag_for_datatype(MPI,type)))
>
>
>                                ^
>
> <command line>:2:13: note: expanded from here
>
> #define MPI 1
> -------------------------------------------------------------------------
>
> The problem is nek5000 has #defined MPI to be 1, but the mpich header file
> 'mpi.h' uses the symbol 'MPI' (for a completely different reason).
>
>  How do other people use nek5000 with mpi on a Mac?
>
> Thanks.
>
> Sincerely,
>
> Wenhao Wu
>
> _______________________________________________
> Nek5000-users mailing list
> Nek5000-users at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20150513/073db1a1/attachment.html>


More information about the Nek5000-users mailing list