From d6bbaea298465325e3c555083f9d5fe2db132dea Mon Sep 17 00:00:00 2001 From: Eric Engle Date: Mon, 23 Oct 2023 21:05:35 -0400 Subject: [PATCH] Updating spack for OpenMP. This commit references NOAA-EMC/NCEPLIBS-g2c#453 --- .github/workflows/Spack.yml | 3 ++- spack/package.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Spack.yml b/.github/workflows/Spack.yml index e1b8c566..c4864803 100644 --- a/.github/workflows/Spack.yml +++ b/.github/workflows/Spack.yml @@ -22,7 +22,8 @@ jobs: strategy: matrix: os: ["ubuntu-latest"] - variants: ["libs=shared +png+jasper~openjpeg+pic+pthreads+utils+build_g2c", "libs=static ~png~jasper+openjpeg~pic~pthreads~utils~build_g2c"] + variants: ["libs=shared +png+jasper~openjpeg+pic+pthreads+openmp+utils+build_g2c", + "libs=static ~png~jasper+openjpeg~pic~pthreads~openmp~utils~build_g2c"] runs-on: ${{ matrix.os }} steps: diff --git a/spack/package.py b/spack/package.py index 3daa6bb8..73e1f65c 100644 --- a/spack/package.py +++ b/spack/package.py @@ -34,6 +34,11 @@ class G2c(CMakePackage): description="Build shared libs, static libs or both", when="@1.7:", ) + variant( + "openmp", + default=False, + description="Turn on OpenMP threading", + when="@develop", variant( "pthreads", default=False, @@ -69,6 +74,7 @@ def cmake_args(self): self.define_from_variant("USE_Jasper", "jasper"), self.define_from_variant("USE_OpenJPEG", "openjpeg"), self.define_from_variant("PTHREADS", "pthreads"), + self.define_from_variant("OPENMP", "openmp"), self.define_from_variant("UTILS", "utils"), self.define_from_variant("BUILD_G2C", "build_g2c"), self.define("BUILD_TESTING", self.run_tests),