Issue compiling PNetcdf 1.6.1 with Intel MPI 4.1.3.049, SEEK_SET already defined

Craig Tierney - NOAA Affiliate craig.tierney at noaa.gov
Wed Jun 10 15:36:05 CDT 2015


On Wed, Jun 10, 2015 at 1:49 PM, Rob Latham <robl at mcs.anl.gov> wrote:

>
>
> On 06/10/2015 02:40 PM, Craig Tierney - NOAA Affiliate wrote:
>
>
>> Compiler Output:
>>
>> make[2]: Entering directory
>> `/misc/whome/Craig.Tierney/software/parallel-netcdf-1.6.1/src/libcxx'
>> /home/Craig.Tierney/apps/impi/4.1.3.049/intel64/bin/mpiicpc
>> <http://4.1.3.049/intel64/bin/mpiicpc> -c -g -O2 -I. -I. -I../lib
>> -DHAVE_CONFIG_H  ncmpiType.cpp
>> In file included from
>> /home/Craig.Tierney/apps/impi/4.1.3.049/intel64/include/mpi.h(1279)
>> <http://4.1.3.049/intel64/include/mpi.h(1279)>,
>>                   from ../lib/pnetcdf.h(10),
>>                   from ncmpiType.h(2),
>>                   from ncmpiType.cpp(2):
>> /home/Craig.Tierney/apps/impi/4.1.3.049/intel64/include/mpicxx.h(95)
>> <http://4.1.3.049/intel64/include/mpicxx.h(95)>: error: #error
>> directive: "SEEK_SET is #defined but must not be for the C++ binding of
>> MPI. Include mpi.h before stdio.h"
>>
>
> Hi Craig.  Yep, folks have seen this kind of problem before.  Not sure if
> anyone in pnetcdf land has reported it, but the workaround is to tell MPICH
> (or MPICH derivatives like intel-mpi) to not define SEEK_SET:
>
>
> https://software.intel.com/en-us/articles/intel-cluster-toolkit-for-linux-error-when-compiling-c-aps-using-intel-mpi-library-compilation-driver-mpiicpc
>
> or
>
>
> https://wiki.mpich.org/mpich/index.php/Frequently_Asked_Questions#Q:_I_get_compile_errors_saying_.22SEEK_SET_is_.23defined_but_must_not_be_for_the_C.2B.2B_binding_of_MPI.22
> .
>
> ==rob
>
>     #error "SEEK_SET is #defined but must not be for the C++ binding of
>> MPI. Include mpi.h before stdio.h"
>>     ^
>>
>> In file included from
>> /home/Craig.Tierney/apps/impi/4.1.3.049/intel64/include/mpi.h(1279)
>> <http://4.1.3.049/intel64/include/mpi.h(1279)>,
>>                   from ../lib/pnetcdf.h(10),
>>                   from ncmpiType.h(2),
>>                   from ncmpiType.cpp(2):
>> /home/Craig.Tierney/apps/impi/4.1.3.049/intel64/include/mpicxx.h(99)
>> <http://4.1.3.049/intel64/include/mpicxx.h(99)>: error: #error
>> directive: "SEEK_CUR is #defined but must not be for the C++ binding of
>> MPI. Include mpi.h before stdio.h"
>>    #error "SEEK_CUR is #defined but must not be for the C++ binding of
>> MPI. Include mpi.h before stdio.h"
>>     ^
>>
>> In file included from
>> /home/Craig.Tierney/apps/impi/4.1.3.049/intel64/include/mpi.h(1279)
>> <http://4.1.3.049/intel64/include/mpi.h(1279)>,
>>                   from ../lib/pnetcdf.h(10),
>>                   from ncmpiType.h(2),
>>                   from ncmpiType.cpp(2):
>> /home/Craig.Tierney/apps/impi/4.1.3.049/intel64/include/mpicxx.h(104)
>> <http://4.1.3.049/intel64/include/mpicxx.h(104)>: error: #error
>> directive: "SEEK_END is #defined but must not be for the C++ binding of
>> MPI. Include mpi.h before stdio.h"
>>    #error "SEEK_END is #defined but must not be for the C++ binding of
>> MPI. Include mpi.h before stdio.h"
>>     ^
>>
>> compilation aborted for ncmpiType.cpp (code 2)
>> make[2]: *** [ncmpiType.o] Error 2
>>
>
> --
> Rob Latham
> Mathematics and Computer Science Division
> Argonne National Lab, IL USA
>

Rob,

Thanks for your very quick reply.  I had seen similar posts to this, but
not one that was so explicit that said "do this".

The link to the mpich FAQ page that you provided is broken.  Here is a
working link:

https://wiki.mpich.org/mpich/index.php/Frequently_Asked_Questions#Q:_I_get_compile_errors_saying_.22SEEK_SET_is_.23defined_but_must_not_be_for_the_C.2B.2B_binding_of_MPI.22
.

However, I could still not build the code by adding
CXXFLAGS=-DMPICH_IGNORE_CXX_SEEK.  I got another error about not being able
to find printf when compiling ncmpi_notyet.cpp.  I am not sure what the
inclusion of the define would have removed.  I fixed it with the following
patch:

--- src/libcxx/ncmpi_notyet.cpp.orig 2015-06-10 20:02:25.308564000 +0000
+++ src/libcxx/ncmpi_notyet.cpp 2015-06-10 19:59:21.840706000 +0000
@@ -1,4 +1,9 @@
 #include <mpi.h>
+
+#ifdef MPICH_IGNORE_CXX_SEEK
+#include<stdio.h>
+#endif
+
 #include <pnetcdf.h>
 #include "ncmpi_notyet.h"

Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/parallel-netcdf/attachments/20150610/bcd07be7/attachment.html>


More information about the parallel-netcdf mailing list