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

Rob Latham robl at mcs.anl.gov
Wed Jun 10 14:49:13 CDT 2015



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


More information about the parallel-netcdf mailing list