Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnetcdf and mingw (msys2) #74

Open
3rav opened this issue Oct 14, 2021 · 3 comments
Open

pnetcdf and mingw (msys2) #74

3rav opened this issue Oct 14, 2021 · 3 comments

Comments

@3rav
Copy link

3rav commented Oct 14, 2021

I was able to compile pnetcdf in the mingw environment using msmpi, but there were such errors:

libtool: compile:  /mingw64/bin/mpicc -DHAVE_CONFIG_H -I. -I../../../../pnetcdf-1.12.2/src/drivers/common -I../../../src/include -I../../../../pnetcdf-1.12.2/src/include -I../../../../pnetcdf-1.12.2/src/drivers/include -I../../../src/drivers/include -march=x86-64 -mtune=generic -O2 -pipe -MT error_mpi2nc.lo -MD -MP -MF .deps/error_mpi2nc.Tpo -c ../../../../pnetcdf-1.12.2/src/drivers/common/error_mpi2nc.c  -DDLL_EXPORT -DPIC -o .libs/error_mpi2nc.o
../../../../pnetcdf-1.12.2/src/drivers/common/error_posix2nc.c: In function 'ncmpii_error_posix2nc':
../../../../pnetcdf-1.12.2/src/drivers/common/error_posix2nc.c:34:14: error: 'EDQUOT' undeclared (first use in this function)
   34 |         case EDQUOT:

reapir by add to error_posix2nc.c:

 #include <errno.h>
+#include <_wsa_errnos.h>
 
 /*----< ncmpii_error_posix2nc() ------------------------------------------------*/
 /* translate posix io error codes to PnetCDF/netCDF error codes */
@@ -31,7 +32,7 @@
         case ENOTDIR :
         case EISDIR:
             return NC_EBAD_FILE;
-        case EDQUOT:
+        case WSAEDQUOT:
             return NC_EQUOTA;
         case ENOENT:
             return NC_ENOENT;

and:

make[2]: Entering directory '/usr/local/pkg_pnetcdf/src/build-x86_64-w64-mingw32/src/libs'
  GEN      libpnetcdf.la
libtool: warning: undefined symbols not allowed in x86_64-w64-mingw32 shared libraries; building static only
libtool: link: (cd .libs/libpnetcdf.lax/libdispatchers.a && ar x "/usr/local/pkg_pnetcdf/src/build-x86_64-w64-mingw32/src/libs/../dispatchers/.libs/libdispatchers.a")
@wkliao
Copy link
Member

wkliao commented Oct 15, 2021

Thanks for reporting the problem and a fix.
However, mingw environment is not officially supported.
This is simply because we do not have the resource for
development and test.

@3rav
Copy link
Author

3rav commented Oct 18, 2021

I was able to compile pnetcdf using msmpi for the mingw64 version but for the version mingw32 it has this error (https://github.com/3rav/MINGW-packages/runs/3893876517?check_suite_focus=true):

  checking for _FILE_OFFSET_BITS value needed for large files... 64
  checking for MPI_Comm_rank... no
  configure: error: 
  checking for library containing MPI_Comm_rank... no
     -----------------------------------------------------------------------
       Invalid MPI compiler specified or detected: "/mingw32/bin/mpicc"
       A working MPI C compiler is required. Please specify the location
       of one either in the MPICC environment variable (not CC variable) or
       through --with-mpi configure flag. Abort.
     -----------------------------------------------------------------------
  ==> ERROR: A failure occurred in build().

This failure is to be expected, because 32-bit symbols exported by msmpi.dll are mangled while 64-bit ones are not.
How can I just skip this test completely?

@wkliao
Copy link
Member

wkliao commented Dec 13, 2023

I wonder if this issue has been resolved in your build.
The error message indicates the problem of your MPI compiler that failed
to compile a simple program that calls MPI_Comm_rank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants