spack / spack/spack

Can't figure out how variant dependency works with virtual packages

Open
#49,720 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug error-messages not-a-bug
Dominant language
Python
Stars
5.1k
Forks
2.5k
Avg merge
3d 4h
Merged PRs (30d)
82

Description

Steps to reproduce

I am trying to write a PR to allow Scalapack build with 8-byte integers as described at https://github.com/Reference-ScaLAPACK/scalapack/blob/master/README#L141-L149 and as discussed yesterday at the concall with @scheibelp and others.

For now I wrote just some boilerplate as follows

$ git diff var/
diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
index 245dcfaf0c..13c2e9fd95 100644
--- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py
+++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
@@ -15,12 +15,14 @@ class ScalapackBase(CMakePackage):

     variant("shared", default=True, description="Build the shared library version")
     variant("pic", default=False, description="Build position independent code")
+    variant("int8", default=False, description="Build with 8-byte (long) integers rather than the regular 4-byte ones")

     provides("scalapack")

     depends_on("mpi")
     depends_on("lapack")
-    depends_on("blas")
+    depends_on("blas", when="~int8")
+    depends_on("blas+int8", when="+int8")
     depends_on("cmake", when="@2.0.0:", type="build")

     # See: https://github.com/Reference-ScaLAPACK/scalapack/issues/9
diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py
index 2785f3a06d..71c1affee7 100644
--- a/var/spack/repos/builtin/packages/openblas/package.py
+++ b/var/spack/repos/builtin/packages/openblas/package.py
@@ -69,6 +69,7 @@ class Openblas(CMakePackage, MakefilePackage):
         description="w/o a Fortran compiler, OpenBLAS will build an f2c-converted LAPACK",
     )

+    variant("int8", default=False, description="Build with 8-byte (long) integers rather than the regular 4-byte ones")
     variant("ilp64", default=False, description="Force 64-bit Fortran native integers")
     variant("pic", default=True, description="Build position independent code")
     variant("shared", default=True, description="Build shared libraries")
Error message

and unfortunately fails as follows

$ spack spec scalapack+int8
==> Error: Spack concretizer internal error. Please submit a bug report and include the command, environment if applicable and the following error message.
    scalapack+int8 is unsatisfiable

Am I doing something wrong?

Information on your system
  • Spack: 0.23.1 (2bfcc69fa870d3c6919be87593f22647981b648a)
  • Python: 3.6.8
  • Platform: linux-rhel8-icelake
General information
  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with spack spec scalapack+int8 using the versions and platform reported. Read var/spack/repos/builtin/packages/netlib-scalapack/package.py and var/spack/repos/builtin/packages/openblas/package.py, then trace how variant-qualified virtual dependencies are handled by the concretizer. Done means the intended Scalapack specification no longer reports an unsatisfiable concretizer error, with coverage for this dependency combination.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.