Skip to content

cannot concretize a spec with flags defined in the package spec AND in the compiler specification #34206

@lukebroskop

Description

@lukebroskop

Steps to reproduce

simple concretize the following spec:

spack:
  config:
    concretizer: clingo
  concretizer:
    reuse: false
    unify: false
  specs:
  - bzip2%[email protected] ldflags="-L/opt/amdgpu/lib64/"

  compilers:
  - compiler:
      spec: [email protected]
      paths:
        cc: cc
        cxx: CC
        f77: ftn
        fc: ftn
      flags:
        ldlibs: -ldl
      operating_system: rhel8
      target: x86_64
      modules:
      - PrgEnv-cray
      - cce/15.0.0
      environment:
        append_path:
          LD_LIBRARY_PATH: /opt/cray/pe/cce/15.0.0/cce/x86_64/lib
      extra_rpaths: []

Error message

~/testEnv> spack concretize -f
==> Starting concretization
==> Error: {'-L/opt/amdgpu/lib64/'} does not equal set()

Information on your system

  • Spack: 0.20.0.dev0 (ef06b9d)
  • Python: 3.9.7
  • Platform: darwin-monterey-cannonlake
  • Concretizer: clingo

spack -d concretize -f

==> [2022-11-29-23:03:50.998257] build(bzip2)
==> [2022-11-29-23:03:50.998371] build(diffutils)
==> [2022-11-29-23:03:50.998402] build(libiconv)
Traceback (most recent call last):
  File "/Users/lroskop/spack/bin/spack", line 54, in <module>
    sys.exit(main())
  File "/Users/lroskop/spack/lib/spack/spack_installable/main.py", line 36, in main
    sys.exit(spack.main.main(argv))
  File "/Users/lroskop/spack/lib/spack/spack/main.py", line 1000, in main
    return _main(argv)
  File "/Users/lroskop/spack/lib/spack/spack/main.py", line 955, in _main
    return finish_parse_and_run(parser, cmd_name, env_format_error)
  File "/Users/lroskop/spack/lib/spack/spack/main.py", line 983, in finish_parse_and_run
    return _invoke_command(command, parser, args, unknown)
  File "/Users/lroskop/spack/lib/spack/spack/main.py", line 632, in _invoke_command
    return_val = command(parser, args)
  File "/Users/lroskop/spack/lib/spack/spack/cmd/concretize.py", line 45, in concretize
    concretized_specs = env.concretize(force=args.force, tests=tests)
  File "/Users/lroskop/spack/lib/spack/spack/environment/environment.py", line 1276, in concretize
    return self._concretize_separately(tests=tests)
  File "/Users/lroskop/spack/lib/spack/spack/environment/environment.py", line 1400, in _concretize_separately
    concretized_root_specs = spack.util.parallel.parallel_map(
  File "/Users/lroskop/spack/lib/spack/spack/util/parallel.py", line 135, in parallel_map
    raise_if_errors(*results, debug=debug)
  File "/Users/lroskop/spack/lib/spack/spack/util/parallel.py", line 83, in raise_if_errors
    raise RuntimeError(error_fmt.format(msg))
RuntimeError: [PID=22437] Traceback (most recent call last):
  File "/Users/lroskop/spack/lib/spack/spack/util/parallel.py", line 55, in __call__
    value = self.func(*args, **kwargs)
  File "/Users/lroskop/spack/lib/spack/spack/environment/environment.py", line 2268, in _concretize_task
    return _concretize_from_constraints(spec_constraints, tests)
  File "/Users/lroskop/spack/lib/spack/spack/environment/environment.py", line 2244, in _concretize_from_constraints
    return s.concretized(tests=tests)
  File "/Users/lroskop/spack/lib/spack/spack/spec.py", line 3062, in concretized
    clone.concretize(tests=tests)
  File "/Users/lroskop/spack/lib/spack/spack/spec.py", line 2978, in concretize
    self._new_concretize(tests)
  File "/Users/lroskop/spack/lib/spack/spack/spec.py", line 2953, in _new_concretize
    result = solver.solve([self], tests=tests)
  File "/Users/lroskop/spack/lib/spack/spack/solver/asp.py", line 2435, in solve
    result, _, _ = self.driver.solve(setup, specs, reuse=reusable_specs, output=output)
  File "/Users/lroskop/spack/lib/spack/spack/solver/asp.py", line 705, in solve
    answers = builder.build_specs(tuples)
  File "/Users/lroskop/spack/lib/spack/spack/solver/asp.py", line 2293, in build_specs
    self.reorder_flags()
  File "/Users/lroskop/spack/lib/spack/spack/solver/asp.py", line 2188, in reorder_flags
    assert spec_compiler_flags_set == compiler_flags_set, "%s does not equal %s" % (
AssertionError: {'-L/opt/amdgpu/lib64/'} does not equal set()

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageThe issue needs to be prioritized

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions