diff --git a/lib/spack/spack/build_systems/msbuild.py b/lib/spack/spack/build_systems/msbuild.py
index 2081e688a6d..a35aeec1a10 100644
--- a/lib/spack/spack/build_systems/msbuild.py
+++ b/lib/spack/spack/build_systems/msbuild.py
@@ -24,6 +24,10 @@ class MSBuildPackage(spack.package_base.PackageBase):
build_system("msbuild")
conflicts("platform=linux", when="build_system=msbuild")
conflicts("platform=darwin", when="build_system=msbuild")
+ conflicts("platform=freebsd", when="build_system=msbuild")
+
+ def define(self, msbuild_arg, value):
+ return define(msbuild_arg, value)
@spack.builder.builder("msbuild")
@@ -87,7 +91,7 @@ def define_targets(self, *targets):
return "/target:" + ";".join(targets) if targets else ""
def define(self, msbuild_arg, value):
- return "/p:{}={}".format(msbuild_arg, value)
+ return define(msbuild_arg, value)
def msbuild_args(self):
"""Define build arguments to MSbuild. This is an empty list by default.
@@ -121,3 +125,7 @@ def install(
pkg.module.msbuild(
*self.msbuild_install_args(), self.define_targets(*self.install_targets)
)
+
+
+def define(msbuild_arg, value):
+ return "/p:{}={}".format(msbuild_arg, value)
diff --git a/var/spack/repos/spack_repo/builtin/packages/msmpi/burn_cbt.patch b/var/spack/repos/spack_repo/builtin/packages/msmpi/burn_cbt.patch
new file mode 100644
index 00000000000..a532e9db186
--- /dev/null
+++ b/var/spack/repos/spack_repo/builtin/packages/msmpi/burn_cbt.patch
@@ -0,0 +1,84 @@
+diff --git a/Directory.Build.props b/Directory.Build.props
+index 3177de8..6b5ec9c 100644
+--- a/Directory.Build.props
++++ b/Directory.Build.props
+@@ -56,7 +56,6 @@
+ properties before or after it depending on what you're injecting. The "global" build.props will also import
+ files located in the $(CBTLocalPath) folder at certain points.
+ -->
+-
+
+
+-
++
+
+
++
++
+ Unicode
+ $(OutputPath)
+ false
+@@ -97,11 +97,12 @@
+
+
+
+- Level3
++
+ true
+ true
+ ProgramDatabase
+ 26439
++ 5205
+
+
+ ;%(AdditionalDependencies)
+diff --git a/dirs.proj b/dirs.proj
+index 5a19bbf..e6c815c 100644
+--- a/dirs.proj
++++ b/dirs.proj
+@@ -4,5 +4,5 @@
+
+
+
+-
++
+
+\ No newline at end of file
diff --git a/var/spack/repos/spack_repo/builtin/packages/networkdirect/package.py b/var/spack/repos/spack_repo/builtin/packages/networkdirect/package.py
new file mode 100644
index 00000000000..fd009622fbe
--- /dev/null
+++ b/var/spack/repos/spack_repo/builtin/packages/networkdirect/package.py
@@ -0,0 +1,72 @@
+# Copyright Spack Project Developers. See COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+import glob
+import os
+
+import spack.build_systems.msbuild as msbuild
+from spack.package import *
+
+
+class Networkdirect(MSBuildPackage):
+ """NetworkDirect is a user-mode programming interface specification
+ for Remote Direct Memory Access (RDMA)"""
+
+ homepage = "https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/hh997033(v=ws.11)"
+ url = "https://github.com/microsoft/NetworkDirect/archive/refs/tags/v2.0.zip"
+
+ maintainers("johnwparent")
+
+ license("MIT", checked_by="johnwparent")
+
+ version("2.0", sha256="ba05a9be32ff39e08766c5a726ee63d47ee3eb9cab53b2b4b656de2d9158460c")
+
+ requires("platform=windows")
+
+ depends_on("cxx")
+ requires("%msvc")
+
+ depends_on("win-sdk")
+ depends_on("win-wdk")
+
+ # Networkdirect uses a build system called CBT that is built on top of MSBuild
+ # CBT is entirely deprecated, and fully incompatible with modern dotnet versions
+ # so we disable the CBT system and drive the underlying MSBuild system directly
+ patch("no_cbt.patch")
+
+
+class MSBuildBuilder(msbuild.MSBuildBuilder):
+
+ build_targets = ["ndutil"]
+
+ # Networkdirect is a unique package where providing
+ # typically required information actually
+ # breaks expected behavior, override the defaults
+ @property
+ def std_msbuild_args(self):
+ return []
+
+ def msbuild_args(self):
+ args = ["-noLogo"]
+ args.append(
+ self.define("WindowsTargetPlatformVersion", str(self.pkg["win-sdk"].version) + ".0")
+ )
+ # one of the headers we need isn't generated during release builds
+ args.append(self.define("Configuration", "Debug"))
+ args.append("src\\netdirect.sln")
+ return args
+
+ def install(self, pkg, spec, prefix):
+ base_build = pkg.stage.source_path
+ out = os.path.join(base_build, "out")
+ build_configuration = glob.glob(os.path.join(out, "*"))[0]
+ for x in glob.glob(os.path.join(build_configuration, "**", "*.lib")):
+ install_path = x.replace(build_configuration, prefix)
+ mkdirp(os.path.dirname(install_path))
+ install(x, install_path)
+ include_dir = os.path.join(build_configuration, "include")
+ install_tree(include_dir, prefix.include)
+ # for whatever reason this header is not moved to the "out" prefix
+ # with the rest of the headers, ensure its there
+ install(os.path.join(base_build, "src", "ndutil", "ndsupport.h"), prefix.include)