[mpich-devel] romio build failure on OpenBSD >= 5.7
Gilles Gouaillardet
gilles at rist.or.jp
Sun May 15 20:38:35 CDT 2016
Folks,
currently, mpich (master and previous releases) cannot be built on
OpenBSD 5.7 and later.
the root cause is 'struct statfs' has no f_type field.
here is attached a patch that fixes that, and add some extra #ifdef
protections
this issue was initially reported at
https://www.open-mpi.org/community/lists/devel/2015/05/17449.php and
more recently at https://github.com/open-mpi/ompi/issues/1635
Cheers,
Gilles
-------------- next part --------------
diff --git a/src/mpi/romio/adio/common/ad_fstype.c b/src/mpi/romio/adio/common/ad_fstype.c
index c89b560..4024f56 100644
--- a/src/mpi/romio/adio/common/ad_fstype.c
+++ b/src/mpi/romio/adio/common/ad_fstype.c
@@ -346,6 +346,8 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
# endif
+# ifdef ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE
+
#ifdef ROMIO_GPFS
if (fsbuf.f_type == GPFS_SUPER_MAGIC) {
*fstype = ADIO_GPFS;
@@ -413,6 +415,8 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
}
# endif
+# endif /*ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE */
+
# ifdef ROMIO_UFS
/* if UFS support is enabled, default to that */
*fstype = ADIO_UFS;
diff --git a/src/mpi/romio/configure.ac b/src/mpi/romio/configure.ac
index 68801ad..fde6868 100644
--- a/src/mpi/romio/configure.ac
+++ b/src/mpi/romio/configure.ac
@@ -1298,11 +1298,53 @@ if test "$pac_cv_have_statfs" = yes ; then
AC_DEFINE(HAVE_STRUCT_STATFS,1,[Define if struct statfs can be compiled])
fi
+AC_MSG_CHECKING([for f_type member of statfs structure])
+AC_TRY_COMPILE([
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+ ],[
+ struct statfs f;
+ memset(&f, 0, sizeof(f));
+ f.f_type = 0;
+ ],
+ pac_cv_have_statfs_f_type=yes,
+ pac_cv_have_statfs_f_type=no
+)
+AC_MSG_RESULT($pac_cv_have_statfs_f_type)
+if test $pac_cv_have_statfs_f_type = yes ; then
+ AC_DEFINE(ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE, 1,[Define if statfs has f_type])
+fi
+
AC_MSG_CHECKING([for f_fstypename member of statfs structure])
AC_TRY_COMPILE([
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
+#endif
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
],[
struct statfs f;
memset(&f, 0, sizeof(f));
More information about the devel
mailing list