From ce900346ccf91b3fa972292c3ab2e8b72a8cc86e Mon Sep 17 00:00:00 2001 From: Tony Weaver <55799947+aweaver1fandm@users.noreply.github.com> Date: Mon, 20 May 2024 15:39:23 -0400 Subject: heimdall: Astronomy software package (#38328) * heimdall: Astronomy software package. Requires dedisp and psrdada (included as part of this commit) * Updated packages to align with Spack's style Minor updates based on wdconinc's comments regarding Spack's style guide * [@spackbot] updating style on behalf of aweaver1fandm * Minor edits to fix copyright year and dedisp install Fixed copyright year to be 2024 instead of 2023 Removed the overridden version of install and created a preinstall function to create the missing lib and inc directories, therefore allowing the default install to run Here is output from the spack install of heimdall showing successful build with cuda. If necessary I do a spack clean and freshly install it ./spack install heimdall +cuda cuda_arch=86 [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/libiconv-1.17-enpmbhsi3kztebwmpclpub2afhlbr3gy [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/xz-5.4.1-pte76kujkezxb3laqse3o4sctlbygsaw [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/zlib-1.2.13-utlfo5ltxz5v5bckirn5v3amtbxjdvwh [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/bzip2-1.0.8-x6navz7ucgfnb5xq7aelqmgd4zxsz5bs [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/libmd-1.0.4-ncomhrodpdul4dm64o6b7426fhmc2u64 [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/ncurses-6.4-c77h34rooycbzapxjvc27sg5td5jiwyb [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/zstd-1.5.5-eporpybumydxveg5rwtfzysrsu4eqzcv [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/libffi-3.4.4-vskntokaojclfqxjfzkbyirkeogddbpx [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/libxcrypt-4.4.33-gtpn32p6mxztul3c3dxzqj7gvcyh555j [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/util-linux-uuid-2.38.1-g322a5peqjaad6gl5q64cdu4qo7kvw6o [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/libxml2-2.10.3-pza3kz2mtbncbbeim6rejfqkgftnf4rz [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/openssl-1.1.1t-adbquvgg4qpc3vq6jynf44qzq3gfwrv5 [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/pigz-2.7-e7mxj4ya2u4a6zb4hu64g7docujmkxeb [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/libbsd-0.11.7-wh4xleivbe7wndiqt5nsehzlfrccnjcg [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/readline-8.2-hhb647bwmbcj7iwpmtetbylninfm5rxf [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/cuda-11.7.1-osue2sx5rv7dgzhsmaemydpwhyribxng [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/tar-1.34-35f5gki2ycxmy5zd7zs5tsvp3xoszxum [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/expat-2.5.0-4gizyhhqklciuyrbyinq2tdggt73gds4 [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/gdbm-1.23-w3uzihtubj2iwv6es55fis6nt2q5zwlr [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/sqlite-3.40.1-m4ntzvuupsnbtkdfbz7oqpbjdlaffp2a [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/dedisp-1.0-pq6r3jnyxq6jzoygz3fp2e6jc2ojpvap [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/gettext-0.21.1-hglzdeadmgkzjb76bmemt6dnulfkrpha [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/python-3.10.10-khu36qq4p2te7jf475ewr2h7egidekfl [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/psrdada-master-by4w6mrpcfnoihlhos2jcfo2roiyagaz [+] /home/htony/spack/opt/spack/linux-ubuntu22.04-zen3/gcc-11.3.0/heimdall-1.0-ohtdnltuhhejysshcert25h6nmuvluqp * [@spackbot] updating style on behalf of aweaver1fandm --- var/spack/repos/builtin/packages/dedisp/package.py | 42 +++++++++++++++++++ .../repos/builtin/packages/heimdall/package.py | 47 ++++++++++++++++++++++ .../repos/builtin/packages/psrdada/package.py | 30 ++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 var/spack/repos/builtin/packages/dedisp/package.py create mode 100644 var/spack/repos/builtin/packages/heimdall/package.py create mode 100644 var/spack/repos/builtin/packages/psrdada/package.py diff --git a/var/spack/repos/builtin/packages/dedisp/package.py b/var/spack/repos/builtin/packages/dedisp/package.py new file mode 100644 index 0000000000..5d617dff9a --- /dev/null +++ b/var/spack/repos/builtin/packages/dedisp/package.py @@ -0,0 +1,42 @@ +# Copyright 2013-2024 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.package import * + + +class Dedisp(MakefilePackage, CudaPackage): + """GPU-based dedispersion package.""" + + homepage = "https://github.com/ajameson/dedisp" + git = "https://github.com/ajameson/dedisp.git" + + maintainers("aweaver1fandm") + + version("master", branch="master", preferred=True) + + conflicts("~cuda", msg="You must specify +cuda") + conflicts("cuda@11.8") + conflicts("cuda_arch=none", msg="You must specify the CUDA architecture") + + depends_on("cuda", type="build") + + def edit(self, spec, prefix): + # Build process required some edits to Makefile.inc instead of using command-line flags + makefile = FileFilter("Makefile.inc") + + makefile.filter(r"^\s*CUDA_PATH\s*\?=.*", "CUDA_PATH ?= " + spec["cuda"].prefix) + makefile.filter( + r"^\s*GPU_ARCH\s*\?=.*", "GPU_ARCH ?= sm_" + spec.variants["cuda_arch"].value[0] + ) + makefile.filter(r"^\s*INSTALL_DIR\s*\?=.*", "INSTALL_DIR ?= " + prefix) + + @run_before("install") + def preinstall(self, spec, prefix): + # The $PREFIX/dedisp/include and $PREFIX/dedisp/lib directories don't seem + # to be created automatically by the software's Makefile so manually create them + libdir = join_path(prefix, "lib") + incdir = join_path(prefix, "include") + mkdirp(libdir) + mkdirp(incdir) diff --git a/var/spack/repos/builtin/packages/heimdall/package.py b/var/spack/repos/builtin/packages/heimdall/package.py new file mode 100644 index 0000000000..948b1b084b --- /dev/null +++ b/var/spack/repos/builtin/packages/heimdall/package.py @@ -0,0 +1,47 @@ +# Copyright 2013-2024 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.package import * + + +class Heimdall(AutotoolsPackage, CudaPackage): + """GPU accelerated transient detection pipeline""" + + homepage = "https://sourceforge.net/projects/heimdall-astro/" + git = "https://git.code.sf.net/p/heimdall-astro/code" + + maintainers("aweaver1fandm") + + version("master", branch="master", preferred=True) + + conflicts("~cuda", msg="You must specify +cuda") + conflicts("cuda@11.8") + conflicts("cuda_arch=none", msg="You must specify the CUDA architecture") + + depends_on("autoconf", type="build") + depends_on("automake", type="build") + depends_on("libtool", type="build") + depends_on("cuda") + + # Pass the cuda architecture to DEDISP and PSRDADA for building + for arch in CudaPackage.cuda_arch_values: + depends_on(f"dedisp cuda_arch={arch}", when=f"cuda_arch={arch}") + + depends_on(f"psrdada cuda_arch={arch}", when=f"cuda_arch={arch}") + + def setup_run_environment(self, env): + env.prepend_path("PATH", self.spec["psrdada"].prefix.bin) + env.prepend_path("PATH", self.prefix.bin) + env.prepend_path("LD_LIBRARY_PATH", self.spec["dedisp"].prefix.lib) + env.prepend_path("LD_LIBRARY_PATH", self.spec["cuda"].prefix.lib) + + def configure_args(self): + # Required flags for configure + args = [ + f"--with-psrdada-dir={self.spec['psrdada'].prefix}", + f"--with-dedisp-dir={self.spec['dedisp'].prefix}", + f"--with-cuda-dir={self.spec['cuda'].prefix}", + ] + return args diff --git a/var/spack/repos/builtin/packages/psrdada/package.py b/var/spack/repos/builtin/packages/psrdada/package.py new file mode 100644 index 0000000000..d06e2760dd --- /dev/null +++ b/var/spack/repos/builtin/packages/psrdada/package.py @@ -0,0 +1,30 @@ +# Copyright 2013-2024 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.package import * + + +class Psrdada(AutotoolsPackage, CudaPackage): + """Open source software to process some types of astronomy data.""" + + homepage = "https://psrdada.sourceforge.net/" + git = "https://git.code.sf.net/p/psrdada/code" + + maintainers("aweaver1fandm") + + version("master", branch="master", preferred=True) + + conflicts("~cuda", msg="You must specify +cuda") + conflicts("cuda@11.8") + conflicts("cuda_arch=none", msg="You must specify the CUDA architecture") + + depends_on("autoconf", type="build") + depends_on("automake", type="build") + depends_on("libtool", type="build") + depends_on("nasm", type="build") + depends_on("pkgconf", type="build") + depends_on("fftw@3.3:", type="build") + depends_on("python") + depends_on("cuda", type="build") -- cgit v1.2.3-70-g09d2