Unverified Commit a61d9f47 authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

libsupermesh: init at 2025.3.0 (#403098)

parents e8734749 7a508024
Loading
Loading
Loading
Loading
+77 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  validatePkgConfig,
  gfortran,
  mpi,
  cmake,
  ninja,
  libspatialindex,
  mpiCheckPhaseHook,
  testers,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "libsupermesh";
  version = "2025.3.0";

  src = fetchFromGitHub {
    owner = "firedrakeproject";
    repo = "libsupermesh";
    tag = "v${finalAttrs.version}";
    hash = "sha256-RKBi89bUhkbRATaSB8629D+/NeYE3YNDIMEGzSK8z04=";
  };

  strictDeps = true;

  outputs = [
    "out"
    "dev"
  ];

  nativeBuildInputs = [
    mpi
    gfortran
    cmake
    ninja
    validatePkgConfig
  ];

  cmakeFlags = [
    (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
  ];

  buildInputs = [
    libspatialindex
    gfortran.cc.lib
  ];

  __darwinAllowLocalNetworking = true;

  nativeCheckInputs = [ mpiCheckPhaseHook ];

  # On aarch64-darwin platform, the test program segfault at the line
  # https://github.com/firedrakeproject/libsupermesh/blob/09af7c9a3beefc715fbdc23e46fdc96da8169ff6/src/tests/test_parallel_p1_inner_product_2d.F90#L164
  # in defining the lambda subroutine pack_data_b with variable field_b.
  # This error is test source and compiler related and does not indicate broken functionality of libsupermesh.
  doCheck = !(stdenv.hostPlatform.system == "aarch64-darwin");

  passthru = {
    tests = {
      pkg-config = testers.hasPkgConfigModules {
        package = finalAttrs.finalPackage;
      };
    };
  };

  meta = {
    homepage = "https://github.com/firedrakeproject/libsupermesh";
    description = "Parallel supermeshing library";
    changelog = "https://github.com/firedrakeproject/libsupermesh/releases/tag/v${finalAttrs.version}";
    license = lib.licenses.lgpl2Plus;
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [ qbisi ];
    pkgConfigModules = [ "libsupermesh" ];
  };
})
+48 −0
Original line number Diff line number Diff line
{
  lib,
  pkgs,
  buildPythonPackage,
  fetchFromGitHub,
  scikit-build-core,
  gfortran,
  cmake,
  ninja,
  mpi,
  libspatialindex,
  rtree,
}:

buildPythonPackage rec {
  inherit (pkgs.libsupermesh)
    pname
    version
    src
    meta
    ;
  pyproject = true;

  build-system = [
    scikit-build-core
  ];

  nativeBuildInputs = [
    gfortran
    cmake
    ninja
    mpi
  ];

  dontUseCmakeConfigure = true;

  buildInputs = [
    libspatialindex
    gfortran.cc.lib
  ];

  dependencies = [
    rtree
  ];

  # Only build tests if not built by scikit-build-core
  doCheck = false;
}
+2 −0
Original line number Diff line number Diff line
@@ -7950,6 +7950,8 @@ self: super: with self; {
  libsoundtouch = callPackage ../development/python-modules/libsoundtouch { };
  libsupermesh = callPackage ../development/python-modules/libsupermesh { };
  libthumbor = callPackage ../development/python-modules/libthumbor { };
  libtmux = callPackage ../development/python-modules/libtmux { };