From 73d42eed34ebce9eab179299c8b85a9c18fb38d7 Mon Sep 17 00:00:00 2001 From: Justin Kin Jun Hew Date: Fri, 31 Jan 2025 12:35:14 +1100 Subject: [PATCH 1/8] enable building of spack issm installation with wrappers --- packages/issm/package.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/issm/package.py b/packages/issm/package.py index 624330a..69f1ac2 100644 --- a/packages/issm/package.py +++ b/packages/issm/package.py @@ -15,7 +15,9 @@ class Issm(AutotoolsPackage): git = "https://github.com/ISSMteam/ISSM.git" version("develop") - version("4.24", sha256="0487bd025f37be4a39dfd48b047de6a6423e310dfe5281dbd9a52aa35b26151a") + version("4.24", sha256="c71d870e63f0ce3ae938d6a669e80dc2cecef827084db31a4b2cfc3a26a44820") + + variant("with_wrappers", default=False, description="Enable building with wrappers") depends_on("autoconf", type="build") depends_on("automake", type="build") @@ -34,12 +36,13 @@ def autoreconf(self, spec, prefix): def configure_args(self): args = [ - "--with-wrappers=no", - "--enable-debugging", - "--enable-development", - "--enable-shared", - "--without-kriging", + "--enable-debugging", + "--enable-development", + "--enable-shared", + "--without-kriging", ] + + args.append(self.with_or_without("wrappers")) args.append("--with-petsc-dir={0}".format(self.spec["petsc"].prefix)) args.append("--with-metis-dir={0}".format(self.spec["metis"].prefix)) args.append("--with-mumps-dir={0}".format(self.spec["mumps"].prefix)) @@ -54,4 +57,4 @@ def configure_args(self): args.append("FC=" + self.spec["mpi"].mpifc) args.append("F77=" + self.spec["mpi"].mpif77) - return args + return args \ No newline at end of file From 1165414a612d597690f24084973675a838b6c4c2 Mon Sep 17 00:00:00 2001 From: Justin Kin Jun Hew Date: Thu, 13 Feb 2025 15:38:51 +1100 Subject: [PATCH 2/8] now using ACCESS-NRI fork of ISSM instead of upstream repo --- packages/issm/package.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/issm/package.py b/packages/issm/package.py index 69f1ac2..d782aee 100644 --- a/packages/issm/package.py +++ b/packages/issm/package.py @@ -2,6 +2,7 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # Copyright 2023 Angus Gibson +# Modified by Justin Kin Jun Hew, 2025 # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,12 +13,11 @@ class Issm(AutotoolsPackage): """Ice-sheet and Sea-Level System Model""" homepage = "https://issm.jpl.nasa.gov/" - git = "https://github.com/ISSMteam/ISSM.git" + git = "https://github.com/ACCESS-NRI/ISSM.git" - version("develop") version("4.24", sha256="c71d870e63f0ce3ae938d6a669e80dc2cecef827084db31a4b2cfc3a26a44820") - variant("with_wrappers", default=False, description="Enable building with wrappers") + variant("wrappers", default=False, description="Enable building with wrappers") depends_on("autoconf", type="build") depends_on("automake", type="build") @@ -29,7 +29,7 @@ class Issm(AutotoolsPackage): depends_on("m1qn3") def url_for_version(self, version): - return "https://github.com/ISSMteam/ISSM/tarball/v{0}".format(version) + return "https://github.com/ACCESS-NRI/ISSM/tarball/v{0}".format(version) def autoreconf(self, spec, prefix): autoreconf("--install", "--verbose", "--force") @@ -42,7 +42,11 @@ def configure_args(self): "--without-kriging", ] - args.append(self.with_or_without("wrappers")) + if "+wrappers" in self.spec: + args.append("--with-wrappers=yes") + else: + args.append("--with-wrappers=no") + args.append("--with-petsc-dir={0}".format(self.spec["petsc"].prefix)) args.append("--with-metis-dir={0}".format(self.spec["metis"].prefix)) args.append("--with-mumps-dir={0}".format(self.spec["mumps"].prefix)) @@ -57,4 +61,4 @@ def configure_args(self): args.append("FC=" + self.spec["mpi"].mpifc) args.append("F77=" + self.spec["mpi"].mpif77) - return args \ No newline at end of file + return args From f91395920f48a9c4e8ad92d6e5cc2711e69a044c Mon Sep 17 00:00:00 2001 From: Justin Kin Jun Hew Date: Tue, 18 Feb 2025 14:28:03 +1100 Subject: [PATCH 3/8] added access-nri triangle dependency with others required for wrapper config --- packages/issm/package.py | 89 +++++++++++++++++++++++++++++++++------- 1 file changed, 75 insertions(+), 14 deletions(-) diff --git a/packages/issm/package.py b/packages/issm/package.py index d782aee..f86e8d4 100644 --- a/packages/issm/package.py +++ b/packages/issm/package.py @@ -1,5 +1,6 @@ -# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2013-2023 Lawrence Livermore National Security, +# LLC and other Spack Project Developers. See the top-level COPYRIGHT +# file for details. # # Copyright 2023 Angus Gibson # Modified by Justin Kin Jun Hew, 2025 @@ -13,28 +14,54 @@ class Issm(AutotoolsPackage): """Ice-sheet and Sea-Level System Model""" homepage = "https://issm.jpl.nasa.gov/" - git = "https://github.com/ACCESS-NRI/ISSM.git" + git = "https://github.com/ACCESS-NRI/ISSM.git" version("4.24", sha256="c71d870e63f0ce3ae938d6a669e80dc2cecef827084db31a4b2cfc3a26a44820") - variant("wrappers", default=False, description="Enable building with wrappers") + # + # Variants + # + variant("wrappers", default=False, + description="Enable building with MPI wrappers") + # If you want to make external Fortran linking optional or specialized, + # you can create a separate variant for it, but typically you might + # rely on Spack's compiler wrappers for Fortran libraries. + + # + # Build dependencies + # depends_on("autoconf", type="build") depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") + depends_on("libtool", type="build") + depends_on("m4", type="build") + # + # Required libraries + # depends_on("mpi") depends_on("petsc+metis+mumps+scalapack") depends_on("m1qn3") + # + # Optional libraries + # + depends_on('access-triangle-git', when='+wrappers') + depends_on("parmetis", when="+wrappers") + depends_on("python@3.9.0:3.9", when="+wrappers", type=("build", "run")) + depends_on("py-numpy", when="+wrappers", type=("build", "run")) + def url_for_version(self, version): + # Example of how you might form a URL for a particular version: return "https://github.com/ACCESS-NRI/ISSM/tarball/v{0}".format(version) def autoreconf(self, spec, prefix): + # If the repo has an Autotools build system, run autoreconf: autoreconf("--install", "--verbose", "--force") def configure_args(self): + """Populate configure arguments, including optional flags to mimic + your manual `./configure` invocation on Gadi.""" args = [ "--enable-debugging", "--enable-development", @@ -42,23 +69,57 @@ def configure_args(self): "--without-kriging", ] + # + # Wrappers + # if "+wrappers" in self.spec: args.append("--with-wrappers=yes") else: args.append("--with-wrappers=no") - args.append("--with-petsc-dir={0}".format(self.spec["petsc"].prefix)) - args.append("--with-metis-dir={0}".format(self.spec["metis"].prefix)) - args.append("--with-mumps-dir={0}".format(self.spec["mumps"].prefix)) - args.append("--with-m1qn3-dir={0}".format(self.spec["m1qn3"].prefix.lib)) - - # Even though we set the MPI compilers manually, the build system - # wants us to explicitly request an MPI-enabled build by telling - # it the MPI include directory. + # + # MPI: Even if we use Spack's MPI wrappers, the build system may + # want explicit mention of MPI includes and compilers: + # args.append("--with-mpi-include={0}".format(self.spec["mpi"].prefix.include)) args.append("CC=" + self.spec["mpi"].mpicc) args.append("CXX=" + self.spec["mpi"].mpicxx) args.append("FC=" + self.spec["mpi"].mpifc) args.append("F77=" + self.spec["mpi"].mpif77) + # + # PETSc, MUMPS, METIS, SCALAPACK, etc. + # (Spack typically puts these in the compiler/link environment, + # but if the ISSM configure script looks for explicit --with-* + # flags, we pass them.) + # + args.append("--with-petsc-dir={0}".format(self.spec["petsc"].prefix)) + args.append("--with-metis-dir={0}".format(self.spec["metis"].prefix)) + args.append("--with-mumps-dir={0}".format(self.spec["mumps"].prefix)) + # If you rely on sca/lapack from PETSc, these lines might + # not be strictly necessary. If ISSM's configure script + # checks them individually, add them: + args.append("--with-scalapack-dir={0}".format(self.spec["scalapack"].prefix)) + args.append("--with-parmetis-dir={0}".format(self.spec["parmetis"].prefix)) + args.append("--with-triangle-dir={0}".format(self.spec["triangle"].prefix)) + + # + # M1QN3 + # + # Some codes want the actual library subdir for m1qn3, + # e.g. "prefix.lib" or "prefix" depending on the configure logic: + # + args.append("--with-m1qn3-dir={0}".format(self.spec["m1qn3"].prefix.lib)) + + args.append("--with-python-version=3.9") + + args.append("--with-python-dir={0}".format(self.spec["python"].prefix)) + + numpy_prefix = self.spec["py-numpy"].prefix + # Possibly site-packages is in something like: + # numpy_prefix.lib/python3.9/site-packages + # or similar. You can either guess or do something more dynamic. + args.append("--with-python-numpy-dir={0}".format(numpy_prefix)) + + return args From 7016b14feb0b77b8e9fc5066adbf28eab2e3a3ef Mon Sep 17 00:00:00 2001 From: Justin Kin Jun Hew Date: Mon, 24 Feb 2025 11:58:34 +1100 Subject: [PATCH 4/8] spack packaging of triangle follows issm compilation method --- packages/access-triangle-git/package.py | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 packages/access-triangle-git/package.py diff --git a/packages/access-triangle-git/package.py b/packages/access-triangle-git/package.py new file mode 100644 index 0000000..2be6385 --- /dev/null +++ b/packages/access-triangle-git/package.py @@ -0,0 +1,46 @@ +# 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) +# ---------------------------------------------------------------------------- +# +# spack install access-triangle-git +# +# You can edit this file again by typing: +# +# spack edit access-triangle-git +# +# ---------------------------------------------------------------------------- + +from spack.package import * +import glob + + +class AccessTriangleGit(Package): + + homepage = "https://github.com/ACCESS-NRI/issm-triangle.git" + url = "https://github.com/ACCESS-NRI/issm-triangle/archive/refs/heads/main.tar.gz" + + version('1.6', sha256='7adf2d6aa5b51cd6090e40109d48ec4f45aa545d06ce7ccde313b1e086855107') + depends_on("libx11", type="link") + depends_on("gmake", type="build") + + + def edit(self, spec, prefix): + + install('configs/makefile', self.build_directory) + install('configs/linux/configure.make', self.build_directory) + + + def build(self, spec, prefix): + make('shared') + + def install(self, spec, prefix): + mkdirp(prefix.include, prefix.lib) + + for libfile in glob.glob("libtriangle.*"): + install(libfile, prefix.lib) + + install('triangle.h', prefix.include) + + From d8b5f95696fcd794baac898b9b1f4bcc4c36c9c3 Mon Sep 17 00:00:00 2001 From: Justin Kin Jun Hew Date: Mon, 24 Feb 2025 14:20:55 +1100 Subject: [PATCH 5/8] include all build config for triangle required by issm --- packages/access-triangle-git/package.py | 67 ++++++++++++++++++------- 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/packages/access-triangle-git/package.py b/packages/access-triangle-git/package.py index 2be6385..a0f53fa 100644 --- a/packages/access-triangle-git/package.py +++ b/packages/access-triangle-git/package.py @@ -13,34 +13,67 @@ # ---------------------------------------------------------------------------- from spack.package import * -import glob +import glob +import os -class AccessTriangleGit(Package): +class AccessTriangleGit(MakefilePackage): + """Example Spack package for the ISSM Triangle library.""" - homepage = "https://github.com/ACCESS-NRI/issm-triangle.git" - url = "https://github.com/ACCESS-NRI/issm-triangle/archive/refs/heads/main.tar.gz" + homepage = "https://github.com/ACCESS-NRI/issm-triangle" + url = "https://github.com/ACCESS-NRI/issm-triangle/archive/refs/heads/main.tar.gz" version('1.6', sha256='7adf2d6aa5b51cd6090e40109d48ec4f45aa545d06ce7ccde313b1e086855107') - depends_on("libx11", type="link") - depends_on("gmake", type="build") + # If on some systems 'gmake' is truly required, keep it. Otherwise, 'make' + # is often sufficient because Spack sets MAKE appropriately. + depends_on('gmake', type='build') + depends_on('libx11', type='link') - def edit(self, spec, prefix): + # MakefilePackage defaults: + # build_targets = [] (e.g. ['all']) + # install_targets = [] + # + # If your Makefile uses something like `make shared`, we set that: + build_targets = ['shared'] - install('configs/makefile', self.build_directory) + def edit(self, spec, prefix): + """ + This stage is where you typically patch or customize the makefile. + If the package comes with a pre-written Makefile that needs minimal + changes, you can do them here. Below, we just copy in the 'configs' + so that the build can find them in `self.build_directory`. + """ + install('configs/makefile', self.build_directory) install('configs/linux/configure.make', self.build_directory) + def install(self, spec, prefix): + """ + The MakefilePackage base class will run `make` and `make ` + in `build()`. So here in `install()` we only need to copy the resulting + artifacts to the install prefix. + """ + # Ensure the standard directories exist + mkdirp(prefix.include) + mkdirp(prefix.lib) + mkdirp(prefix.bin) + mkdirp(prefix.share) - def build(self, spec, prefix): - make('shared') + # We assume the build puts libs in the build dir or top-level + with working_dir(self.build_directory): + for libfile in glob.glob("libtriangle.*"): + install(libfile, prefix.lib) - def install(self, spec, prefix): - mkdirp(prefix.include, prefix.lib) - - for libfile in glob.glob("libtriangle.*"): - install(libfile, prefix.lib) - - install('triangle.h', prefix.include) + # Install headers if they exist in the build directory + if os.path.exists('triangle.h'): + install('triangle.h', prefix.include) + # If there is a 'bin' subdirectory with executables: + if os.path.isdir('bin'): + for binfile in glob.glob("bin/*"): + install(binfile, prefix.bin) + # If there is a 'share' subdirectory for docs/data: + if os.path.isdir('share'): + for sharefile in glob.glob("share/*"): + install(sharefile, prefix.share) From 579d144ec1f42de2d5e37a705ae2d16225354c56 Mon Sep 17 00:00:00 2001 From: Justin Kin Jun Hew Date: Wed, 26 Feb 2025 14:29:03 +1100 Subject: [PATCH 6/8] created new access triangle spack directory, SPR brings all files into one directory and clears it after compilation --- packages/access-triangle-git/package.py | 79 ----------------------- packages/access-triangle/package.py | 86 +++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 79 deletions(-) delete mode 100644 packages/access-triangle-git/package.py create mode 100644 packages/access-triangle/package.py diff --git a/packages/access-triangle-git/package.py b/packages/access-triangle-git/package.py deleted file mode 100644 index a0f53fa..0000000 --- a/packages/access-triangle-git/package.py +++ /dev/null @@ -1,79 +0,0 @@ -# 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) -# ---------------------------------------------------------------------------- -# -# spack install access-triangle-git -# -# You can edit this file again by typing: -# -# spack edit access-triangle-git -# -# ---------------------------------------------------------------------------- - -from spack.package import * -import glob -import os - - -class AccessTriangleGit(MakefilePackage): - """Example Spack package for the ISSM Triangle library.""" - - homepage = "https://github.com/ACCESS-NRI/issm-triangle" - url = "https://github.com/ACCESS-NRI/issm-triangle/archive/refs/heads/main.tar.gz" - - version('1.6', sha256='7adf2d6aa5b51cd6090e40109d48ec4f45aa545d06ce7ccde313b1e086855107') - - # If on some systems 'gmake' is truly required, keep it. Otherwise, 'make' - # is often sufficient because Spack sets MAKE appropriately. - depends_on('gmake', type='build') - depends_on('libx11', type='link') - - # MakefilePackage defaults: - # build_targets = [] (e.g. ['all']) - # install_targets = [] - # - # If your Makefile uses something like `make shared`, we set that: - build_targets = ['shared'] - - def edit(self, spec, prefix): - """ - This stage is where you typically patch or customize the makefile. - If the package comes with a pre-written Makefile that needs minimal - changes, you can do them here. Below, we just copy in the 'configs' - so that the build can find them in `self.build_directory`. - """ - install('configs/makefile', self.build_directory) - install('configs/linux/configure.make', self.build_directory) - - def install(self, spec, prefix): - """ - The MakefilePackage base class will run `make` and `make ` - in `build()`. So here in `install()` we only need to copy the resulting - artifacts to the install prefix. - """ - # Ensure the standard directories exist - mkdirp(prefix.include) - mkdirp(prefix.lib) - mkdirp(prefix.bin) - mkdirp(prefix.share) - - # We assume the build puts libs in the build dir or top-level - with working_dir(self.build_directory): - for libfile in glob.glob("libtriangle.*"): - install(libfile, prefix.lib) - - # Install headers if they exist in the build directory - if os.path.exists('triangle.h'): - install('triangle.h', prefix.include) - - # If there is a 'bin' subdirectory with executables: - if os.path.isdir('bin'): - for binfile in glob.glob("bin/*"): - install(binfile, prefix.bin) - - # If there is a 'share' subdirectory for docs/data: - if os.path.isdir('share'): - for sharefile in glob.glob("share/*"): - install(sharefile, prefix.share) diff --git a/packages/access-triangle/package.py b/packages/access-triangle/package.py new file mode 100644 index 0000000..b6a118d --- /dev/null +++ b/packages/access-triangle/package.py @@ -0,0 +1,86 @@ +# 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) +# ---------------------------------------------------------------------------- +# +# spack install access-triangle-git +# +# You can edit this file again by typing: +# +# spack edit access-triangle-git +# +# ---------------------------------------------------------------------------- + +from spack.package import * +import glob +import os + + +class AccessTriangle(MakefilePackage): + """Example Spack package for the ISSM Triangle library.""" + + homepage = "https://github.com/ACCESS-NRI/issm-triangle" + git = 'https://github.com/ACCESS-NRI/issm-triangle.git' + + version('main') + + # # If on some systems 'gmake' is truly required, keep it. Otherwise, 'make' + # # is often sufficient because Spack sets MAKE appropriately. + depends_on('gmake', type='build') + depends_on('libx11', type='link') + + def url_for_version(self, version): + return "https://github.com/ACCESS-NRI/issm-triangle/archive/refs/heads/{0}.tar.gz".format(version) + + def edit(self, spec, prefix): + """ + This stage is where you typically patch or customize the makefile. + If the package comes with a pre-written Makefile that needs minimal + changes, you can do them here. Below, we just copy in the 'configs' + so that the build can find them in `self.build_directory`. + """ + src_dir = join_path(self.stage.source_path, "src") + mkdirp(src_dir) + + # Copy necessary files to src directory + install('configs/makefile', src_dir) + install('configs/linux/configure.make', src_dir) + install('triangle.c', src_dir) + install('triangle.h', src_dir) + + def build(self, spec, prefix): + """ + This is where we actually call `make shared`. + Using MakefilePackage, you *could* rely on build_targets, + but we'll be explicit here so you can see it clearly. + """ + with working_dir(join_path(self.stage.source_path, "src")): + make('shared') + + #raise an exception + + def install(self, spec, prefix): + """ + Copy the resulting library and headers into the Spack prefix. + """ + src = join_path(self.stage.source_path, "src") + + # Create prefix directories + mkdirp(prefix.include) + mkdirp(prefix.lib) + + with working_dir(src): + # Make sure we see what's actually there, for debugging: + ls_output = Executable('ls')('-l', '.', output=str, error=str) + print("Files in build directory:\n", ls_output) + + install('triangle.h', prefix.include) + + for libfile in glob.glob("libtriangle.*"): + install(libfile, prefix.lib) + + + + + From 9d7196c82d833bf0aa2cb8e1a6fe4d1b70bccc96 Mon Sep 17 00:00:00 2001 From: Justin Kin Jun Hew Date: Thu, 27 Feb 2025 15:48:22 +1100 Subject: [PATCH 7/8] cleanup docstrings and comments --- packages/access-triangle/package.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/access-triangle/package.py b/packages/access-triangle/package.py index b6a118d..dcfb2cf 100644 --- a/packages/access-triangle/package.py +++ b/packages/access-triangle/package.py @@ -18,7 +18,7 @@ class AccessTriangle(MakefilePackage): - """Example Spack package for the ISSM Triangle library.""" + """Spack package for the ISSM Triangle library.""" homepage = "https://github.com/ACCESS-NRI/issm-triangle" git = 'https://github.com/ACCESS-NRI/issm-triangle.git' @@ -35,9 +35,7 @@ def url_for_version(self, version): def edit(self, spec, prefix): """ - This stage is where you typically patch or customize the makefile. - If the package comes with a pre-written Makefile that needs minimal - changes, you can do them here. Below, we just copy in the 'configs' + Below, we just copy in the 'configs' so that the build can find them in `self.build_directory`. """ src_dir = join_path(self.stage.source_path, "src") From 88ee4a88d5e0ca1dcf04a32f3b06f1c39b37234c Mon Sep 17 00:00:00 2001 From: Justin Kin Jun Hew Date: Fri, 7 Mar 2025 16:19:01 +1100 Subject: [PATCH 8/8] added packaging features for +wrappers installation --- packages/issm/package.py | 44 +++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/packages/issm/package.py b/packages/issm/package.py index f86e8d4..0556e7d 100644 --- a/packages/issm/package.py +++ b/packages/issm/package.py @@ -8,6 +8,8 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * +import os +import subprocess class Issm(AutotoolsPackage): @@ -16,7 +18,10 @@ class Issm(AutotoolsPackage): homepage = "https://issm.jpl.nasa.gov/" git = "https://github.com/ACCESS-NRI/ISSM.git" - version("4.24", sha256="c71d870e63f0ce3ae938d6a669e80dc2cecef827084db31a4b2cfc3a26a44820") + #version("4.24", sha256="c71d870e63f0ce3ae938d6a669e80dc2cecef827084db31a4b2cfc3a26a44820") + + version("main", branch="main", git="https://github.com/ACCESS-NRI/ISSM.git") + version("access-development", branch="access-development", git="https://github.com/ACCESS-NRI/ISSM.git") # # Variants @@ -35,8 +40,7 @@ class Issm(AutotoolsPackage): depends_on("automake", type="build") depends_on("libtool", type="build") depends_on("m4", type="build") - - # + # Required libraries # depends_on("mpi") @@ -46,18 +50,22 @@ class Issm(AutotoolsPackage): # # Optional libraries # - depends_on('access-triangle-git', when='+wrappers') + depends_on('access-triangle', when='+wrappers') depends_on("parmetis", when="+wrappers") - depends_on("python@3.9.0:3.9", when="+wrappers", type=("build", "run")) - depends_on("py-numpy", when="+wrappers", type=("build", "run")) + # depends_on("python@3.9.0:3.9", when="+wrappers", type=("build", "run")) + # depends_on("py-numpy", when="+wrappers", type=("build", "run")) def url_for_version(self, version): # Example of how you might form a URL for a particular version: - return "https://github.com/ACCESS-NRI/ISSM/tarball/v{0}".format(version) + #branch = "access-development" + return "https://github.com/ACCESS-NRI/ISSM/archive/refs/heads/{0}.tar.gz".format(version) def autoreconf(self, spec, prefix): # If the repo has an Autotools build system, run autoreconf: autoreconf("--install", "--verbose", "--force") + + def setup_run_environment(self, env): + env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib) def configure_args(self): """Populate configure arguments, including optional flags to mimic @@ -101,7 +109,7 @@ def configure_args(self): # checks them individually, add them: args.append("--with-scalapack-dir={0}".format(self.spec["scalapack"].prefix)) args.append("--with-parmetis-dir={0}".format(self.spec["parmetis"].prefix)) - args.append("--with-triangle-dir={0}".format(self.spec["triangle"].prefix)) + args.append("--with-triangle-dir={0}".format(self.spec["access-triangle"].prefix)) # # M1QN3 @@ -110,16 +118,20 @@ def configure_args(self): # e.g. "prefix.lib" or "prefix" depending on the configure logic: # args.append("--with-m1qn3-dir={0}".format(self.spec["m1qn3"].prefix.lib)) - args.append("--with-python-version=3.9") + args.append("--with-python-dir=/apps/python3/3.9.2") - args.append("--with-python-dir={0}".format(self.spec["python"].prefix)) - numpy_prefix = self.spec["py-numpy"].prefix - # Possibly site-packages is in something like: - # numpy_prefix.lib/python3.9/site-packages - # or similar. You can either guess or do something more dynamic. - args.append("--with-python-numpy-dir={0}".format(numpy_prefix)) + numpy_site_packages = "/apps/python3/3.9.2/lib/python3.9/site-packages/numpy-1.20.0-py3.9-linux-x86_64.egg/numpy" + numpy_core_dir = "/apps/python3/3.9.2/lib/python3.9/site-packages/numpy-1.20.0-py3.9-linux-x86_64.egg/numpy" + args.append("--with-python-numpy-dir={0}".format(numpy_core_dir)) + + return args + def install(self, spec, prefix): + # Run the normal Autotools install logic + super().install(spec, prefix) + + # Copy the entire source tree into an additional directory + install_tree(self.stage.source_path, prefix.src) - return args