Page MenuHomeFreeBSD

D54230.diff
No OneTemporary

D54230.diff

diff --git a/sysutils/mpifileutils/Makefile b/sysutils/mpifileutils/Makefile
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/Makefile
@@ -0,0 +1,27 @@
+PORTNAME= mpifileutils
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.12
+CATEGORIES= sysutils parallel
+
+MAINTAINER= rikka.goering@outlook.de
+COMMENT= MPI-based parallel file utilities (dcp, dcmp, ddup, dtar, etc.)
+WWW= https://hpc.github.io/mpifileutils/
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+LIB_DEPENDS= libcircle.so:devel/libcircle \
+ libdtcmp.so:devel/dtcmp
+
+USES= cmake localbase:ldflags mpi pkgconfig ssl
+USE_GITHUB= yes
+GH_ACCOUNT= hpc
+
+USE_LDCONFIG= yes
+
+CMAKE_ARGS+= -DCMAKE_C_COMPILER=${MPICC} \
+ -DCMAKE_CXX_COMPILER=${MPICXX}
+CMAKE_ON= BUILD_SHARED_LIBS
+CMAKE_OFF= ENABLE_GPFS ENABLE_LUSTRE ENABLE_XATTRS
+
+.include <bsd.port.mk>
diff --git a/sysutils/mpifileutils/distinfo b/sysutils/mpifileutils/distinfo
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1768082583
+SHA256 (hpc-mpifileutils-v0.12_GH0.tar.gz) = adfcfd2c15ad5ef827bb19def2dd094bff4e2aab7ba47e1efc5d1b0b7ba1bf2f
+SIZE (hpc-mpifileutils-v0.12_GH0.tar.gz) = 848048
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__bz2.h b/sysutils/mpifileutils/files/patch-src_common_mfu__bz2.h
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__bz2.h
@@ -0,0 +1,10 @@
+--- src/common/mfu_bz2.h.orig 2025-12-15 01:37:35 UTC
++++ src/common/mfu_bz2.h
+@@ -1,6 +1,7 @@
+ #ifndef MFU_BZ2_H
+ #define MFU_BZ2_H
+
++int mfu_compress_bz2_static(const char* src_name, const char* dst_name, int b_size);
+ int mfu_compress_bz2(const char* src_name, const char* dst_name, int b_size);
+ int mfu_decompress_bz2(const char* src_name, const char* dst_name);
+
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__bz2.c b/sysutils/mpifileutils/files/patch-src_common_mfu__bz2.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__bz2.c
@@ -0,0 +1,15 @@
+--- src/common/mfu_bz2.c.orig 2025-02-19 22:20:52 UTC
++++ src/common/mfu_bz2.c
+@@ -6,7 +6,12 @@
+ #include <errno.h>
+
+ /* for statfs */
++#if defined(__linux__)
+ #include <sys/vfs.h>
++#elif defined(__FreeBSD__)
++#include <sys/param.h>
++#include <sys/mount.h>
++#endif
+
+ /* for LL_SUPER_MAGIC */
+ #if LUSTRE_SUPPORT
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__bz2__static.c b/sysutils/mpifileutils/files/patch-src_common_mfu__bz2__static.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__bz2__static.c
@@ -0,0 +1,24 @@
+--- src/common/mfu_bz2_static.c.orig 2026-02-03 01:03:25 UTC
++++ src/common/mfu_bz2_static.c
+@@ -5,7 +5,9 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#if defined(__linux__)
+ #include <sys/sysinfo.h>
++#endif
+ #include <string.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+@@ -22,6 +24,11 @@
+ #include "libcircle.h"
+ #include "mfu.h"
+ #include "mfu_bz2.h"
++
++/* FreeBSD does not define O_LARGEFILE; large file support is implicit. */
++#ifndef O_LARGEFILE
++#define O_LARGEFILE 0
++#endif
+
+ #define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
+
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__compress__bz2__libcircle.c b/sysutils/mpifileutils/files/patch-src_common_mfu__compress__bz2__libcircle.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__compress__bz2__libcircle.c
@@ -0,0 +1,28 @@
+--- src/common/mfu_compress_bz2_libcircle.c.orig 2026-01-10 22:23:16 UTC
++++ src/common/mfu_compress_bz2_libcircle.c
+@@ -1,3 +1,20 @@
++#if !defined(__linux__)
++/*
++ * Non-Linux fallback:
++ * The libcircle-based implementation relies on sysinfo(2) / <sys/sysinfo.h>.
++ * FreeBSD doesn't provide that API, so fall back to the portable static path.
++ */
++#include "mfu.h"
++#include "mfu_bz2.h"
++
++int mfu_compress_bz2_libcircle(const char* src, const char* dst, int b_size, ssize_t opts_memory)
++{
++ (void) opts_memory;
++ return mfu_compress_bz2_static(src, dst, b_size);
++}
++
++#else /* __linux__ */
++
+ #ifndef _GNU_SOURCE
+ #define _GNU_SOURCE
+ #endif
+@@ -531,3 +548,4 @@ int mfu_compress_bz2_libcircle(const char* src, const
+
+ return rc;
+ }
++#endif /* __linux__ */
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__decompress__bz2__libcircle.c b/sysutils/mpifileutils/files/patch-src_common_mfu__decompress__bz2__libcircle.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__decompress__bz2__libcircle.c
@@ -0,0 +1,12 @@
+--- src/common/mfu_decompress_bz2_libcircle.c.orig 2025-12-14 21:18:33 UTC
++++ src/common/mfu_decompress_bz2_libcircle.c
+@@ -5,7 +5,9 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#if defined(__linux__)
+ #include <sys/sysinfo.h>
++#endif
+ #include <string.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__flist.h b/sysutils/mpifileutils/files/patch-src_common_mfu__flist.h
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__flist.h
@@ -0,0 +1,11 @@
+--- src/common/mfu_flist.h.orig 2025-12-07 17:14:40 UTC
++++ src/common/mfu_flist.h
+@@ -44,7 +44,7 @@ extern "C" {
+ #include <stdbool.h>
+ #include "mpi.h"
+
+-#if DCOPY_USE_XATTRS
++#if defined(__linux__) && DCOPY_USE_XATTRS
+ #include <sys/xattr.h>
+ /*
+ * Newer versions of attr deprecated attr/xattr.h which defines ENOATTR as a
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__flist.c b/sysutils/mpifileutils/files/patch-src_common_mfu__flist.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__flist.c
@@ -0,0 +1,53 @@
+--- src/common/mfu_flist.c.orig 2025-02-19 22:20:52 UTC
++++ src/common/mfu_flist.c
+@@ -35,8 +35,13 @@
+ #include <sys/ioctl.h>
+ #include <sys/param.h>
+
++/* Linux-specific file flag ioctls live in <linux/fs.h>;
++ * not available (and not used) on FreeBSD.
++ */
++#ifdef __linux__
+ #include <linux/fs.h>
+ #include <linux/fiemap.h>
++#endif
+
+ #include <libgen.h> /* dirname */
+ #include "libcircle.h"
+@@ -845,7 +850,7 @@ uint64_t mfu_flist_file_get_perm(mfu_flist bflist, uin
+ return mode & (S_IRWXU | S_IRWXG | S_IRWXO);
+ }
+
+-#if DCOPY_USE_XATTRS
++#if defined(__linux__) && DCOPY_USE_XATTRS
+ void *mfu_flist_file_get_acl(mfu_flist bflist, uint64_t idx, ssize_t *acl_size, char *type)
+ {
+ flist_t* flist = (flist_t*) bflist;
+@@ -870,7 +875,7 @@ void *mfu_flist_file_get_acl(mfu_flist bflist, uint64_
+ /* this is a real error */
+ MFU_LOG(MFU_LOG_ERR, "Failed to get value for name=%s on `%s' lgetxattr() (errno=%d %s)",
+ type, filename, errno, strerror(errno)
+- );
++ );
+ break;
+ }
+ } else {
+@@ -886,7 +891,18 @@ void *mfu_flist_file_get_acl(mfu_flist bflist, uint64_
+
+ return val;
+ }
++#else
++void *mfu_flist_file_get_acl(mfu_flist bflist, uint64_t idx, ssize_t *acl_size, char *type)
++{
++ (void)bflist;
++ (void)idx;
++ (void)type;
++ if (acl_size != NULL)
++ *acl_size = 0;
++ return NULL;
++}
+ #endif
++
+
+ uint64_t mfu_flist_file_get_uid(mfu_flist bflist, uint64_t idx)
+ {
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__flist__archive.c b/sysutils/mpifileutils/files/patch-src_common_mfu__flist__archive.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__flist__archive.c
@@ -0,0 +1,34 @@
+--- src/common/mfu_flist_archive.c.orig 2025-02-19 22:20:52 UTC
++++ src/common/mfu_flist_archive.c
+@@ -27,6 +27,10 @@
+ #include <string.h>
+ #include <getopt.h>
+
++#ifndef O_LARGEFILE
++#define O_LARGEFILE 0
++#endif
++
+ /* gettimeofday */
+ #include <sys/time.h>
+
+@@ -5255,14 +5259,19 @@ static int extract_xattrs(
+ r = archive_entry_xattr_next(entry, &xname, &xval, &xsize);
+ if (r == ARCHIVE_OK) {
+ /* successfully extracted xattr, now try to set it */
++#if defined(__linux__)
+ int set_rc = setxattr(path, xname, xval, xsize, 0);
+ if (set_rc == -1) {
+ MFU_LOG(MFU_LOG_ERR, "failed to setxattr '%s' on '%s' errno=%d %s",
+- xname, path, errno, strerror(errno)
++ xname, path, errno, strerror(errno)
+ );
+ rc = MFU_FAILURE;
+ /* don't break in case other xattrs work */
+ }
++#else
++ /* FreeBSD: implement Linux setxattr() equivalent using extattr(2) */
++ (void)path; (void)xname; (void)xval; (void)xsize;
++#endif
+ } else {
+ /* failed to read xattr */
+ MFU_LOG(MFU_LOG_ERR, "failed to extract xattr for '%s' of entry %llu at offset %llu",
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__flist__copy.c b/sysutils/mpifileutils/files/patch-src_common_mfu__flist__copy.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__flist__copy.c
@@ -0,0 +1,56 @@
+--- src/common/mfu_flist_copy.c.orig 2026-01-10 22:30:42 UTC
++++ src/common/mfu_flist_copy.c
+@@ -39,8 +39,10 @@
+ #include <sys/ioctl.h>
+ #include <sys/param.h>
+
++#ifdef __linux__
+ #include <linux/fs.h>
+ #include <linux/fiemap.h>
++#endif
+
+ /* define PRI64 */
+ #include <inttypes.h>
+@@ -69,8 +71,10 @@
+ #endif
+
+ #ifdef HPSS_SUPPORT
++#ifdef __linux__
+ #include <linux/hpssfs.h>
+ #endif
++#endif
+
+ /****************************************
+ * Define types
+@@ -1864,6 +1868,7 @@ static int mfu_copy_file_normal(
+ return 0;
+ }
+
++#ifdef __linux__
+ static int mfu_copy_file_fiemap(
+ const char* src,
+ const char* dest,
+@@ -2053,6 +2058,7 @@ fail_normal_copy:
+ fail_normal_copy:
+ return -1;
+ }
++#endif
+
+ static int mfu_copy_file(
+ const char* src,
+@@ -2084,6 +2090,7 @@ static int mfu_copy_file(
+ return -1;
+ }
+
++#ifdef __linux__
+ if (copy_opts->sparse) {
+ bool normal_copy_required;
+ ret = mfu_copy_file_fiemap(src, dest, offset, length, file_size,
+@@ -2093,6 +2100,7 @@ static int mfu_copy_file(
+ return ret;
+ }
+ }
++#endif
+
+ ret = mfu_copy_file_normal(src, dest, offset, length, file_size,
+ copy_opts, mfu_src_file, mfu_dst_file);
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__flist__walk.c b/sysutils/mpifileutils/files/patch-src_common_mfu__flist__walk.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__flist__walk.c
@@ -0,0 +1,41 @@
+--- src/common/mfu_flist_walk.c.orig 2026-01-10 23:00:45 UTC
++++ src/common/mfu_flist_walk.c
+@@ -186,8 +186,10 @@ static void walk_getdents_process_dir(const char* dir,
+ int flags = O_RDONLY | O_DIRECTORY;
+ char buf[BUF_SIZE];
+
++#ifdef __linux__
+ if (NO_ATIME)
+ flags |= O_NOATIME;
++#endif
+
+ /* TODO: may need to try these functions multiple times */
+ mfu_file_t* mfu_file = *CURRENT_PFILE;
+@@ -205,7 +207,17 @@ static void walk_getdents_process_dir(const char* dir,
+ /* Read all directory entries */
+ while (1) {
+ /* execute system call to get block of directory entries */
+- int nread = syscall(SYS_getdents, mfu_file->fd, buf, (int) BUF_SIZE);
++ int nread;
++#ifdef __linux__
++ /* On Linux, call the raw getdents syscall as before */
++ nread = syscall(SYS_getdents, mfu_file->fd, buf, (int) BUF_SIZE);
++#else
++ /*
++ * On FreeBSD and other non-Linux systems, use the getdents(2)
++ * libc wrapper instead of the Linux-specific SYS_getdents.
++ */
++ nread = getdents(mfu_file->fd, (char *)buf, (size_t)BUF_SIZE);
++#endif
+ if (nread == -1) {
+ MFU_LOG(MFU_LOG_ERR, "syscall to getdents failed when reading `%s' (errno=%d %s)", dir, errno, strerror(errno));
+ WALK_RESULT = -1;
+@@ -767,7 +779,7 @@ void mfu_flist_stat(
+ /* check whether we should skip this item */
+ if (skip_fn != NULL && skip_fn(name, skip_args)) {
+ /* skip this file, don't include it in new list */
+- MFU_LOG(MFU_LOG_INFO, "skip %s");
++ MFU_LOG(MFU_LOG_INFO, "skip %s", name);
+ continue;
+ }
+
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__io.h b/sysutils/mpifileutils/files/patch-src_common_mfu__io.h
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__io.h
@@ -0,0 +1,20 @@
+--- src/common/mfu_io.h.orig 2025-02-19 22:20:52 UTC
++++ src/common/mfu_io.h
+@@ -42,12 +42,15 @@ extern "C" {
+
+ #include "mfu_param_path.h"
+
++#ifdef __FreeBSD__
++#define stat64 stat
++#define lstat64 lstat
++#endif
++
+ /* Intent is to wrap all POSIX I/O routines used by mfu tools. May
+ * abort on fatal conditions to avoid checking condition at every call.
+ * May also automatically retry on things like EINTR. */
+
+-/* TODO: fix this */
+-/* do this to avoid warning about undefined stat64 struct */
+ struct stat64;
+
+ /*****************************
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__io.c b/sysutils/mpifileutils/files/patch-src_common_mfu__io.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__io.c
@@ -0,0 +1,15 @@
+--- src/common/mfu_io.c.orig 2025-02-19 22:20:52 UTC
++++ src/common/mfu_io.c
+@@ -21,6 +21,12 @@
+ #include "mfu.h"
+ #include "mfu_errors.h"
+
++/* FreeBSD does not provide lstat64, only lstat. Map it accordingly. */
++#ifdef __FreeBSD__
++#undef lstat64
++#define lstat64(path, buf) lstat((path), (struct stat *)(buf))
++#endif
++
+ #define MFU_IO_TRIES (5)
+ #define MFU_IO_USLEEP (100)
+
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__param__path.c b/sysutils/mpifileutils/files/patch-src_common_mfu__param__path.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__param__path.c
@@ -0,0 +1,40 @@
+--- src/common/mfu_param_path.c.orig 2025-02-19 22:20:52 UTC
++++ src/common/mfu_param_path.c
+@@ -1,5 +1,23 @@
+ #define _GNU_SOURCE
+
++/* Ensure POSIX faccessat(2) AT_* constants are visible on FreeBSD */
++#ifndef _POSIX_C_SOURCE
++#define _POSIX_C_SOURCE 200809L
++#endif
++
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
++#include <unistd.h>
++
++/* Fallbacks (in case headers hide these behind visibility macros) */
++#ifndef AT_FDCWD
++#define AT_FDCWD (-100)
++#endif
++#ifndef AT_SYMLINK_NOFOLLOW
++#define AT_SYMLINK_NOFOLLOW 0
++#endif
++
+ #include "mfu.h"
+ #include "mpi.h"
+
+@@ -8,6 +26,13 @@
+ #include <string.h>
+ #include <stdarg.h>
+ #include <errno.h>
++
++#include <sys/types.h>
++#include <sys/stat.h>
++
++#ifndef S_ISLNK
++#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
++#endif
+
+ #include <fcntl.h>
+ #include <unistd.h>
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__util.h b/sysutils/mpifileutils/files/patch-src_common_mfu__util.h
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__util.h
@@ -0,0 +1,13 @@
+--- src/common/mfu_util.h.orig 2026-01-10 23:35:04 UTC
++++ src/common/mfu_util.h
+@@ -9,6 +9,10 @@ extern "C" {
+ #ifndef MFU_UTIL_H
+ #define MFU_UTIL_H
+
++#ifndef O_NOATIME
++#define O_NOATIME 0
++#endif
++
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <stdint.h>
diff --git a/sysutils/mpifileutils/files/patch-src_common_mfu__util.c b/sysutils/mpifileutils/files/patch-src_common_mfu__util.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_common_mfu__util.c
@@ -0,0 +1,46 @@
+--- src/common/mfu_util.c.orig 2025-02-19 22:20:52 UTC
++++ src/common/mfu_util.c
+@@ -1,6 +1,11 @@
+ /* to get nsec fields in stat structure */
+ #define _GNU_SOURCE
+
++#if defined(__FreeBSD__)
++#include <sys/types.h>
++#include <sys/param.h>
++#endif
++
+ #include "mfu.h"
+ #include "mpi.h"
+ #include "dtcmp.h"
+@@ -14,12 +19,21 @@
+ #include <errno.h>
+ #include <limits.h>
+
+-#include <sys/types.h>
+ #include <sys/stat.h>
++#include <fcntl.h>
+ #include <unistd.h>
+
++#if defined(__linux__)
+ #include <sys/vfs.h>
++#elif defined(__FreeBSD__)
++#include <sys/param.h>
++#include <sys/mount.h>
++#endif
+
++#ifndef S_ISLNK
++#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
++#endif
++
+ #ifndef ULLONG_MAX
+ #define ULLONG_MAX (__LONG_LONG_MAX__ * 2UL + 1UL)
+ #endif
+@@ -939,7 +953,7 @@ int mfu_compare_contents(
+ /* check for write error */
+ if (bytes_written < 0) {
+ MFU_LOG(MFU_LOG_ERR, "Failed to write `%s' at offset %llx (errno=%d %s)",
+- dst_name, (unsigned long long)off + n, strerror(errno));
++ dst_name, (unsigned long long)off + n, errno, strerror(errno));
+ rc = -1;
+ break;
+ }
diff --git a/sysutils/mpifileutils/files/patch-src_dbcast_dbcast.c b/sysutils/mpifileutils/files/patch-src_dbcast_dbcast.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_dbcast_dbcast.c
@@ -0,0 +1,73 @@
+--- src/dbcast/dbcast.c.orig 2025-02-19 22:20:52 UTC
++++ src/dbcast/dbcast.c
+@@ -16,7 +16,12 @@
+ #include <string.h>
+ #include <getopt.h>
+
++#ifdef __linux__
+ #include <sys/vfs.h>
++#elif defined(__FreeBSD__)
++#include <sys/param.h>
++#include <sys/mount.h>
++#endif
+
+ // mmap and friends for shared memory
+ #include <sys/mman.h>
+@@ -32,6 +37,14 @@
+ * and send data to each other. The writer flow controls these worker
+ * processes with messages. */
+
++#ifndef HOST_NAME_MAX
++# ifdef MAXHOSTNAMELEN
++# define HOST_NAME_MAX MAXHOSTNAMELEN
++# else
++# define HOST_NAME_MAX 256
++# endif
++#endif
++
+ #define GCS_SUCCESS (0)
+
+ static int gcs_shm_file_key = MPI_KEYVAL_INVALID;
+@@ -803,7 +816,7 @@ int main (int argc, char *argv[])
+ /* check whether we have space to write the file */
+ if (file_size > free_size) {
+ /* not enough space for file */
+- MFU_LOG(MFU_LOG_ERR, "Insufficient space for file `%s` filesize=%llu free=%llu", out_file_path, file_size, free_size);
++ MFU_LOG(MFU_LOG_ERR, "Insufficient space for file `%s` filesize=%llu free=%llu", out_file_path, (unsigned long long)file_size, (unsigned long long)free_size);
+ write_error = 1;
+ }
+ }
+@@ -1118,14 +1131,14 @@ if (node_rank == 0) {
+ * a file by the same name but of different size than a previous copy */
+ errno = 0;
+ if (mfu_truncate(out_file_path, (off_t) file_size) != 0) {
+- MFU_LOG(MFU_LOG_ERR, "Failed to truncate file `%s`", out_file_path, strerror(errno));
++ MFU_LOG(MFU_LOG_ERR, "Failed to truncate file `%s`: %s", out_file_path, strerror(errno));
+ write_error = 1;
+ }
+
+ /* have every writer update file mode */
+ errno = 0;
+ if (mfu_chmod(out_file_path, (mode_t) mode) != 0) {
+- MFU_LOG(MFU_LOG_ERR, "Failed to chmod file `%s`", out_file_path, strerror(errno));
++ MFU_LOG(MFU_LOG_ERR, "Failed to chmod file `%s`: %s", out_file_path, strerror(errno));
+ write_error = 1;
+ }
+
+@@ -1133,14 +1146,14 @@ if (node_rank == 0) {
+ if (write_error) {
+ errno = 0;
+ if (mfu_unlink(out_file_path) != 0) {
+- MFU_LOG(MFU_LOG_ERR, "Failed to unlink file `%s`", out_file_path, strerror(errno));
++ MFU_LOG(MFU_LOG_ERR, "Failed to unlink file `%s`: %s", out_file_path, strerror(errno));
+ }
+ }
+ } else {
+ /* readers close input file */
+ errno = 0;
+ if (mfu_close(in_file_path, in_file) != 0) {
+- MFU_LOG(MFU_LOG_ERR, "Failed to close file `%s`", in_file_path, strerror(errno));
++ MFU_LOG(MFU_LOG_ERR, "Failed to close file `%s`: %s", in_file_path, strerror(errno));
+ }
+ }
+
diff --git a/sysutils/mpifileutils/files/patch-src_dbz2_dbz2.c b/sysutils/mpifileutils/files/patch-src_dbz2_dbz2.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_dbz2_dbz2.c
@@ -0,0 +1,12 @@
+--- src/dbz2/dbz2.c.orig 2025-02-19 22:20:52 UTC
++++ src/dbz2/dbz2.c
+@@ -1,7 +1,9 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#if defined(__linux__)
+ #include <sys/sysinfo.h>
++#endif
+ #include <string.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
diff --git a/sysutils/mpifileutils/files/patch-src_dcmp_dcmp.c b/sysutils/mpifileutils/files/patch-src_dcmp_dcmp.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_dcmp_dcmp.c
@@ -0,0 +1,15 @@
+--- src/dcmp/dcmp.c.orig 2025-02-19 22:20:52 UTC
++++ src/dcmp/dcmp.c
+@@ -4,7 +4,12 @@
+ #include <stdlib.h>
+ #include <mpi.h>
+ #include <libcircle.h>
++#ifdef __linux__
+ #include <linux/limits.h>
++#elif defined(__FreeBSD__)
++#include <limits.h>
++#include <sys/param.h>
++#endif
+ #include <libgen.h>
+ #include <errno.h>
+ #include <dtcmp.h>
diff --git a/sysutils/mpifileutils/files/patch-src_dcp1_cleanup.c b/sysutils/mpifileutils/files/patch-src_dcp1_cleanup.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_dcp1_cleanup.c
@@ -0,0 +1,13 @@
+--- src/dcp1/cleanup.c.orig 2025-12-11 05:20:58 UTC
++++ src/dcp1/cleanup.c
+@@ -51,8 +51,8 @@ static void DCOPY_truncate_file(DCOPY_operation_t* op,
+ * Try the recursive file before file-to-file. The cast below requires us
+ * to have a maximum file_size of 2^63, not 2^64.
+ */
+- if(truncate64(dest_path_recursive, op->file_size) < 0) {
+- if(truncate64(dest_path_file_to_file, op->file_size) < 0) {
++ if(mfu_truncate(dest_path_recursive, op->file_size) < 0) {
++ if(mfu_truncate(dest_path_file_to_file, op->file_size) < 0) {
+ MFU_LOG(MFU_LOG_ERR, "Failed to truncate destination file: %s (errno=%d %s)",
+ dest_path_recursive, errno, strerror(errno));
+
diff --git a/sysutils/mpifileutils/files/patch-src_dcp1_common.h b/sysutils/mpifileutils/files/patch-src_dcp1_common.h
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_dcp1_common.h
@@ -0,0 +1,11 @@
+--- src/dcp1/common.h.orig 2025-02-19 22:20:52 UTC
++++ src/dcp1/common.h
+@@ -44,7 +44,7 @@
+ #include <unistd.h>
+ #include <utime.h>
+
+-#if DCOPY_USE_XATTRS
++#if defined(__linux__) && DCOPY_USE_XATTRS
+ #include <sys/xattr.h>
+ /*
+ * Newer versions of attr deprecated attr/xattr.h which defines ENOATTR as a
diff --git a/sysutils/mpifileutils/files/patch-src_dsync_dsync.c b/sysutils/mpifileutils/files/patch-src_dsync_dsync.c
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/files/patch-src_dsync_dsync.c
@@ -0,0 +1,22 @@
+--- src/dsync/dsync.c.orig 2025-12-15 01:38:57 UTC
++++ src/dsync/dsync.c
+@@ -24,7 +24,7 @@
+ #include <stdlib.h>
+ #include <mpi.h>
+ #include <libcircle.h>
+-#include <linux/limits.h>
++#include <limits.h>
+ #include <libgen.h>
+ #include <errno.h>
+ #include <dtcmp.h>
+@@ -32,6 +32,10 @@
+ #define _XOPEN_SOURCE 600
+ #include <fcntl.h>
+ #include <string.h>
++
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
+
+ /* for bool type, true/false macros */
+ #include <stdbool.h>
diff --git a/sysutils/mpifileutils/pkg-descr b/sysutils/mpifileutils/pkg-descr
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/pkg-descr
@@ -0,0 +1,4 @@
+mpiFileUtils provides a library (libmfu) and a suite of MPI-parallel file
+utilities such as dcp (parallel copy), dcmp (compare), ddup (duplicate finder),
+dfind, dtar/dbz2, dchmod, and more. Designed for high scalability on large
+filesystems.
diff --git a/sysutils/mpifileutils/pkg-plist b/sysutils/mpifileutils/pkg-plist
new file mode 100644
--- /dev/null
+++ b/sysutils/mpifileutils/pkg-plist
@@ -0,0 +1,44 @@
+bin/dbcast
+bin/dbz2
+bin/dchmod
+bin/dcmp
+bin/dcp
+bin/dcp1
+bin/ddup
+bin/dfilemaker
+bin/dfind
+bin/dreln
+bin/drm
+bin/dstripe
+bin/dsync
+bin/dtar
+bin/dwalk
+include/mfu.h
+include/mfu_bz2.h
+include/mfu_errors.h
+include/mfu_flist.h
+include/mfu_flist_internal.h
+include/mfu_io.h
+include/mfu_param_path.h
+include/mfu_path.h
+include/mfu_pred.h
+include/mfu_proc.h
+include/mfu_progress.h
+include/mfu_util.h
+lib/libmfu.a
+lib/libmfu.so
+lib/libmfu.so.4.0.0
+share/man/man1/dbcast.1.gz
+share/man/man1/dbz2.1.gz
+share/man/man1/dchmod.1.gz
+share/man/man1/dcmp.1.gz
+share/man/man1/dcp.1.gz
+share/man/man1/ddup.1.gz
+share/man/man1/dfilemaker.1.gz
+share/man/man1/dfind.1.gz
+share/man/man1/dreln.1.gz
+share/man/man1/drm.1.gz
+share/man/man1/dstripe.1.gz
+share/man/man1/dsync.1.gz
+share/man/man1/dtar.1.gz
+share/man/man1/dwalk.1.gz

File Metadata

Mime Type
text/plain
Expires
Sun, Feb 15, 11:42 AM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28739466
Default Alt Text
D54230.diff (24 KB)

Event Timeline