summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMikael Simberg <mikael.simberg@iki.fi>2022-05-18 03:10:45 +0200
committerGitHub <noreply@github.com>2022-05-17 18:10:45 -0700
commitf505c50770abdb2527a1696ec01cd3e0ddc86e2d (patch)
tree9949b62aa230da026a8506a28c4f7fb9b62e194e /var
parent2fdc817f03424ea9d59e9aeaa88107db48d1ffbf (diff)
downloadspack-f505c50770abdb2527a1696ec01cd3e0ddc86e2d.tar.gz
spack-f505c50770abdb2527a1696ec01cd3e0ddc86e2d.tar.bz2
spack-f505c50770abdb2527a1696ec01cd3e0ddc86e2d.tar.xz
spack-f505c50770abdb2527a1696ec01cd3e0ddc86e2d.zip
Add tracy (#30588)
Co-authored-by: Mikael Simberg <mikael.simberg@iki.if>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/glfw/package.py4
-rw-r--r--var/spack/repos/builtin/packages/tracy-client/package.py77
-rw-r--r--var/spack/repos/builtin/packages/tracy/package.py46
3 files changed, 127 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/glfw/package.py b/var/spack/repos/builtin/packages/glfw/package.py
index 6e2d7a2780..83dd74ad45 100644
--- a/var/spack/repos/builtin/packages/glfw/package.py
+++ b/var/spack/repos/builtin/packages/glfw/package.py
@@ -27,6 +27,7 @@ class Glfw(CMakePackage):
version('3.0.3', sha256='7a182047ba6b1fdcda778b79aac249bb2328b6d141188cb5df29560715d01693')
variant("doc", default=False, description="Build documentation")
+ variant("shared", default=False, description="Builds a shared version of the library")
# dependencies
depends_on('doxygen', type='build', when="+doc")
@@ -42,3 +43,6 @@ class Glfw(CMakePackage):
depends_on('freetype', when='platform=linux')
depends_on('fontconfig', when='platform=linux')
depends_on('pkgconfig', type='build', when='platform=linux')
+
+ def cmake_args(self):
+ return [self.define_from_variant("BUILD_SHARED_LIBS", "shared")]
diff --git a/var/spack/repos/builtin/packages/tracy-client/package.py b/var/spack/repos/builtin/packages/tracy-client/package.py
new file mode 100644
index 0000000000..c8b84f2fff
--- /dev/null
+++ b/var/spack/repos/builtin/packages/tracy-client/package.py
@@ -0,0 +1,77 @@
+# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class TracyClient(CMakePackage):
+ """A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling
+ profiler for games and other applications. Client library."""
+
+ homepage = "https://github.com/wolfpld/tracy"
+ url = "https://github.com/wolfpld/tracy/archive/v0.0.0.tar.gz"
+ maintainers = ["msimberg"]
+
+ version("master", git="https://github.com/wolfpld/tracy.git", branch="master")
+ version(
+ "0.8.1",
+ sha256="004992012b2dc879a9f6d143cbf94d7ea30e88135db3ef08951605d214892891",
+ )
+
+ variant(
+ "shared",
+ default=True,
+ description="Build the client library as a shared library",
+ )
+
+ variants = {
+ "enable": (True, "Enable profiling"),
+ "on_demand": (False, "On-demand profiling"),
+ "callstack": (False, "Enfore callstack collection for tracy regions"),
+ "no_callstack": (False, "Disable all callstack related functionality"),
+ "no_callstack_inlines": (False, "Disables the inline functions in callstacks"),
+ "only_localhost": (False, "Only listen on the localhost interface"),
+ "no_broadcast": (
+ False,
+ "Disable client discovery by broadcast to local network",
+ ),
+ "only_ipv4": (
+ False,
+ "Tracy will only accept connections on IPv4 addresses (disable IPv6)",
+ ),
+ "no_code_transfer": (False, "Disable collection of source code"),
+ "no_context_switch": (False, "Disable capture of context switches"),
+ "no_exit": (
+ False,
+ "Client executable does not exit until all profile data is sent to server",
+ ),
+ "no_sampling": (False, "Disable call stack sampling"),
+ "no_verify": (False, "Disable zone validation for C API"),
+ "no_vsync_capture": (False, "Disable capture of hardware Vsync events"),
+ "no_frame_image": (False, "Disable the frame image support and its thread"),
+ "no_system_tracing": (False, "Disable systrace sampling"),
+ "delayed_init": (
+ False,
+ "Enable delayed initialization of the library (init on first call)",
+ ),
+ "manual_lifetime": (
+ False,
+ "Enable the manual lifetime management of the profile",
+ ),
+ "fibers": (False, "Enable fibers support"),
+ "no_crash_handler": (False, "Disable crash handling"),
+ "timer_fallback": (False, "Use lower resolution timers"),
+ }
+
+ for k, v in variants.items():
+ variant(k, default=v[0], description=v[1])
+
+ def cmake_args(self):
+ args = [
+ self.define_from_variant("TRACY_%s" + k.upper(), v[0])
+ for k, v in variants.items()
+ ]
+ args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
+ return args
diff --git a/var/spack/repos/builtin/packages/tracy/package.py b/var/spack/repos/builtin/packages/tracy/package.py
new file mode 100644
index 0000000000..51f39b0e5d
--- /dev/null
+++ b/var/spack/repos/builtin/packages/tracy/package.py
@@ -0,0 +1,46 @@
+# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class Tracy(MakefilePackage):
+ """A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling
+ profiler for games and other applications. Server applications."""
+
+ homepage = "https://github.com/wolfpld/tracy"
+ url = "https://github.com/wolfpld/tracy/archive/v0.0.0.tar.gz"
+ maintainers = ["msimberg"]
+
+ version("master", git="https://github.com/wolfpld/tracy.git", branch="master")
+ version(
+ "0.8.1",
+ sha256="004992012b2dc879a9f6d143cbf94d7ea30e88135db3ef08951605d214892891",
+ )
+
+ depends_on("capstone")
+ depends_on("dbus")
+ depends_on("freetype")
+ # Linking fails unless glfw is built as a shared library:
+ # https://github.com/wolfpld/tracy/issues/110
+ depends_on("glfw +shared")
+
+ def build(self, spec, prefix):
+ with working_dir(join_path(self.build_directory, "capture/build/unix")):
+ make()
+
+ with working_dir(join_path(self.build_directory, "profiler/build/unix")):
+ make()
+
+ def install(self, spec, prefix):
+ mkdir(prefix.bin)
+ install(
+ join_path(self.build_directory, "capture/build/unix/capture-release"),
+ prefix.bin,
+ )
+ install(
+ join_path(self.build_directory, "profiler/build/unix/Tracy-release"),
+ prefix.bin,
+ )