Bug 291589 - [NEW PORT] devel/libcircle: Distributed work queue library for MPI clusters
Summary: [NEW PORT] devel/libcircle: Distributed work queue library for MPI clusters
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Vladimir Druzenko
URL: https://github.com/hpc/libcircle
Keywords:
Depends on:
Blocks: 291679
  Show dependency treegraph
 
Reported: 2025-12-11 22:26 UTC by Generic Rikka
Modified: 2026-04-15 13:41 UTC (History)
2 users (show)

See Also:


Attachments
new port devel/libcircle (v0.3) (3.54 KB, patch)
2025-12-11 22:26 UTC, Generic Rikka
no flags Details | Diff
v1 (2.68 KB, patch)
2026-04-09 02:38 UTC, Vladimir Druzenko
no flags Details | Diff
v2 (3.36 KB, patch)
2026-04-11 22:58 UTC, Generic Rikka
no flags Details | Diff
v3 (3.23 KB, patch)
2026-04-12 21:35 UTC, Generic Rikka
no flags Details | Diff
v4 (3.25 KB, patch)
2026-04-12 22:32 UTC, Generic Rikka
no flags Details | Diff
v5: [NEW PORT] devel/libcircle: API to distribute parallel workloads across MPI ranks (3.64 KB, patch)
2026-04-15 05:04 UTC, Generic Rikka
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Generic Rikka 2025-12-11 22:26:28 UTC
Created attachment 266112 [details]
new port devel/libcircle (v0.3)

Hi,

I’d like to add a new port devel/libcircle, a distributed work queue library for MPI clusters. libcircle provides an API for distributing embarrassingly parallel workloads across MPI ranks using a distributed work queue. Applications register callbacks to create and process work items, while the library handles load balancing, termination detection, and optional global reductions.

libcircle is commonly used on large HPC filesystems to traverse directory trees and perform file operations in parallel, and it is one of the dependencies for sysutils/mpifileutils, which I’m working on porting to FreeBSD.

Port details
- Upstream: hpc / GitHub (tag v0.3)
- Uses USES=mpi:mpich and the MPI compiler wrapper (MPICC)
- Builds and installs the shared library, header, and pkg-config file
- Optional DOCS (installs README.md into ${DOCSDIR})

QA
- make stage-qa [ok]
- make check-plist [ok]
- portfmt -D Makefile [ok]
- portlint -AC [ok]
- portclippy Makefile [ok]
- poudriere testport [ok]

Maintainer: rikka.goering@outlook.de

Patch attached as a git-format patch.
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2026-04-08 21:43:23 UTC
Use tarball from upstream instead of USE_GITHUB=yes:
https://github.com/hpc/libcircle/releases/download/v0.3/libcircle-0.3.0.tar.gz

MASTER_SITES=https://github.com/hpc/${PORTNAME}/releases/download/v${DISTVERSION:R}/

Maybe USES+=autoreconf is unnecessary.
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2026-04-09 02:38:21 UTC
Created attachment 269528 [details]
v1

Please check my patch.
Comment 3 Generic Rikka 2026-04-11 19:48:01 UTC
Thanks for the feedback and the corrected v1 patch! 
I reviewed and tested the patch locally with poudriere testport and all checks passed.
I also ran portlint -AC on it and noticed that: since the port installs shared libraries under lib/, USE_LDCONFIG=yes should be added back.

Apart from that, the changes look good to me.
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2026-04-11 20:45:37 UTC
(In reply to Generic Rikka from comment #3)
USE_LDCONFIG=yes was deleted by accident.
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2026-04-11 21:39:44 UTC
Why --disable-static?
Comment 6 Generic Rikka 2026-04-11 22:58:04 UTC
Created attachment 269646 [details]
v2

(In reply to Vladimir Druzenko from comment #5)

--disable-static was a leftover from the initial debugging and is not needed.

Without it, lib/libcircle.a is installed as well. I added it to pkg-plist, and the port packages successfully.

Including libcircle.a may be desirable for broader use cases.
Comment 7 Daniel Engberg freebsd_committer freebsd_triage 2026-04-12 07:18:53 UTC
There's no need to install a static library if nothing in tree uses it

DOCS and MANPAGES should be combined into DOXYGEN
https://cgit.freebsd.org/ports/tree/Mk/bsd.options.desc.mk#n80

I'm not too fond of the idea of adding seemingly rather at least dormat project, no consumers and not packaged by many at all.
https://repology.org/project/libcircle/versions

I'm not fond of forks in general but this seems to carry quite a bit of improvements fwiw, https://github.com/dmikushin/circle
Comment 8 Generic Rikka 2026-04-12 21:35:20 UTC
Created attachment 269686 [details]
v3

(In reply to Daniel Engberg from comment #7)
Thanks for the feedback.
I upgraded the patch based on your feedback:
 - combined MANPAGES and DOCS into a shared DOCS option handled with doxygen
 - disabled static library installation

The main reason for adding libcircle is that it is an upstream dependency of sysutils/mpifileutils, which I am working on as part of improving HPC tooling availability on FreeBSD.

I also checked the fork that was mentioned. At first glance it appears more heavily modified, so I am not yet sure whether it can be treated as a drop-in replacement for mpifileutils. I can review that further.

The revised port still builds, packages, and passes checks locally.
Comment 9 Generic Rikka 2026-04-12 22:32:07 UTC
Created attachment 269688 [details]
v4

Updated used MPI implementation to openmpi, to depend on the same MPI implementation as the other dependencies of mpifileutils.
Comment 10 Vladimir Druzenko freebsd_committer freebsd_triage 2026-04-13 01:49:46 UTC
(In reply to Daniel Engberg from comment #7)
With DOXYGEN instead of DOCS "PORTDOCS=*" doesn't work.
Comment 11 Vladimir Druzenko freebsd_committer freebsd_triage 2026-04-13 01:51:46 UTC
(In reply to Generic Rikka from comment #9)
PORTNAME=       libcircle
DISTVERSION=    0.3.0
CATEGORIES=     devel parallel
MASTER_SITES=   https://github.com/hpc/${PORTNAME}/releases/download/v${DISTVERSION:R}/

MAINTAINER=     rikka.goering@outlook.de
COMMENT=        Efficient distributed work queue library for MPI clusters
WWW=            https://hpc.github.io/libcircle/

LICENSE=        BSD3CLAUSE
LICENSE_FILE=   ${WRKSRC}/COPYING

USES=           libtool localbase mpi:openmpi pathfix pkgconfig
USE_LDCONFIG=   yes

GNU_CONFIGURE=  yes
CONFIGURE_ENV=  CC=${MPICC} \
                MPICC=${MPICC}
INSTALL_TARGET= install-strip
TEST_TARGET=    check

PORTDOCS=       *

OPTIONS_DEFINE=         DOCS
OPTIONS_DEFAULT=        SHARED
OPTIONS_MULTI=          LIBS
OPTIONS_MULTI_LIBS=     SHARED STATIC
OPTIONS_SUB=            yes

SHARED_DESC=            Build shared libraries
STATIC_DESC=            Build static libraries

DOCS_BUILD_DEPENDS=     doxygen:devel/doxygen
DOCS_CONFIGURE_ENABLE=  doxygen

SHARED_CONFIGURE_ENABLE=        shared
STATIC_CONFIGURE_ENABLE=        static

do-install-DOCS-on:
        (cd ${WRKSRC}/doc && ${COPYTREE_SHARE} "html latex" ${STAGEDIR}${DOCSDIR})
        ${INSTALL_MAN} ${WRKSRC}/doc/man/man3/*.3 ${STAGEDIR}${PREFIX}/share/man/man3

.include <bsd.port.mk>

include/libcircle.h
%%STATIC%%lib/libcircle.a
%%SHARED%%lib/libcircle.so
%%SHARED%%lib/libcircle.so.2
%%SHARED%%lib/libcircle.so.2.1.1
libdata/pkgconfig/libcircle.pc
%%PORTDOCS%%share/man/man3/CIRCLE_handle.3.gz
%%PORTDOCS%%share/man/man3/lib.c.3.gz
%%PORTDOCS%%share/man/man3/queue.c.3.gz
%%PORTDOCS%%share/man/man3/token.c.3.gz
%%PORTDOCS%%share/man/man3/worker.c.3.gz
Comment 12 Vladimir Druzenko freebsd_committer freebsd_triage 2026-04-13 02:07:26 UTC
Workaround DOCS <=> DOXYGEN:
PORTNAME=       libcircle
DISTVERSION=    0.3.0
CATEGORIES=     devel parallel
MASTER_SITES=   https://github.com/hpc/${PORTNAME}/releases/download/v${DISTVERSION:R}/

MAINTAINER=     rikka.goering@outlook.de
COMMENT=        Efficient distributed work queue library for MPI clusters
WWW=            https://hpc.github.io/libcircle/

LICENSE=        BSD3CLAUSE
LICENSE_FILE=   ${WRKSRC}/COPYING

USES=           libtool localbase mpi:openmpi pathfix pkgconfig
USE_LDCONFIG=   yes

GNU_CONFIGURE=  yes
CONFIGURE_ENV=  CC=${MPICC} \
                MPICC=${MPICC}
INSTALL_TARGET= install-strip
TEST_TARGET=    check

PORTDOCS=       *

OPTIONS_DEFINE=         DOCS DOXYGEN
OPTIONS_DEFAULT=        SHARED
OPTIONS_MULTI=          LIBS
OPTIONS_MULTI_LIBS=     SHARED STATIC
OPTIONS_SUB=            yes

SHARED_DESC=            Build shared libraries
STATIC_DESC=            Build static libraries

DOXYGEN_IMPLIES=                DOCS
DOXYGEN_BUILD_DEPENDS=          doxygen:devel/doxygen
DOXYGEN_CONFIGURE_ENABLE=       doxygen

SHARED_CONFIGURE_ENABLE=        shared
STATIC_CONFIGURE_ENABLE=        static

do-install-DOCS-on:
        @${MKDIR} ${STAGEDIR}${DOCSDIR}
        ${INSTALL_DATA} ${WRKSRC}/AUTHORS ${STAGEDIR}${DOCSDIR}

do-install-DOXYGEN-on:
        (cd ${WRKSRC}/doc && ${COPYTREE_SHARE} "html latex" ${STAGEDIR}${DOCSDIR})
        ${INSTALL_MAN} ${WRKSRC}/doc/man/man3/*.3 ${STAGEDIR}${PREFIX}/share/man/man3

.include <bsd.port.mk>


include/libcircle.h
%%STATIC%%lib/libcircle.a
%%SHARED%%lib/libcircle.so
%%SHARED%%lib/libcircle.so.2
%%SHARED%%lib/libcircle.so.2.1.1
libdata/pkgconfig/libcircle.pc
%%DOXYGEN%%share/man/man3/CIRCLE_handle.3.gz
%%DOXYGEN%%share/man/man3/lib.c.3.gz
%%DOXYGEN%%share/man/man3/queue.c.3.gz
%%DOXYGEN%%share/man/man3/token.c.3.gz
%%DOXYGEN%%share/man/man3/worker.c.3.gz
Comment 13 Generic Rikka 2026-04-15 05:04:39 UTC
Created attachment 269791 [details]
v5: [NEW PORT] devel/libcircle: API to distribute parallel workloads across MPI ranks

Updated patch to review feedback:
 - adjusted doxygen/docs handling
 - created new options for static and shared libraries

Thanks a lot for the review feedback!
Comment 14 commit-hook freebsd_committer freebsd_triage 2026-04-15 13:39:06 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=14736c6ee94658022c9172e0594e3125a400f068

commit 14736c6ee94658022c9172e0594e3125a400f068
Author:     Generic Rikka <rikka.goering@outlook.de>
AuthorDate: 2026-04-15 12:29:07 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-04-15 13:37:44 +0000

    devel/libcircle: New port: API to distribute parallel workloads across MPI ranks

    libcircle provides an API for distributing embarrassingly parallel
    workloads across MPI ranks using a distributed work queue.

    Applications register callbacks to create and process work items, while
    the library handles load balancing, termination detection, and optional
    global reductions. It is commonly used on large HPC filesystems to
    traverse directory trees and perform file operations in parallel on
    hundreds or thousands of processes.

    https://github.com/hpc/libcircle

    It is one of the dependencies for sysutils/mpifileutils.

    PR:             291589
    Sponsored by:   UNIS Labs
    Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>

 devel/Makefile                  |  1 +
 devel/libcircle/Makefile (new)  | 48 +++++++++++++++++++++++++++++++++++++++++
 devel/libcircle/distinfo (new)  |  3 +++
 devel/libcircle/pkg-descr (new) |  8 +++++++
 devel/libcircle/pkg-plist (new) | 11 ++++++++++
 5 files changed, 71 insertions(+)
Comment 15 Vladimir Druzenko freebsd_committer freebsd_triage 2026-04-15 13:41:07 UTC
Thanks.