Skip to content

Clingo fails on Cray #22463

@jjellio

Description

@jjellio

Steps to reproduce the issue

This is after merging PR#22460
#22460

I've left some comments in that PR that are PR specific.

Effectively, the patch requires that GCC have static libraries (which isn't always true).

  1. I swapped to a GCC that does have static libs (but it's provided by a module)
  2. My new GCC (9.2.0) seemed to fail the Spack C++14 flag test - I commented this out in clingo-bootstrap since I know it will succeed (clingo or clingo-bootstrap will now configure and attempt to compile most things)
  3. I discovered my python3.7's static lib appears to depend on OpenSSL (I got missing symbols that belong to libssl when it linked the final clingo binaries)
  4. I got clingo-bootstrap@spack to compile
  5. I cleaned, editted the config and added the concretizer as clingo
  6. spack spec zlib throws an error about Clingo
  7. I pushed through a build of plain clingo@spack (adding openssl)
  8. Regular clingo gives the same problem
    Build ENV is Python3.7 (via a module), GCC 9.2.0 (module), Cmake 3.19.6, build machine is a cray that doesn't have static libs

The verbose version of that list follows (written as I tried things)

Use a GCC with static libs (hurray) - not detected as having C++14 though (boo)

I swapped to a GCC 9.2.0 build (which does have static libraries). This will pass through CMake... but oddly it's failing in the spack package for clingo, because spack thinks self.compiler.cxx14_flag is non existent for this compiler.
C++14 check that fails for GCC 9.2.0

I'm sure Cmake/spack is actually compiling with GCC 9.2.0, because CMake's compiler detection reports GCC 9.2.0.

I commented out the c++14 check in clingo's package, and Cmake configures/compiles (mostly)

Onwards to glory

Cmake gets all the way to to nearly the end and is building bin/gring and it dies in a link error. (missing symbols that look like openssl)

If I edit clingo-bootstrap and add a depends_on(openssl) and tack on spec['openssl'].libs.joined() to the ldflags at line 49 (referenced above). I can get clingo installed.

I'm assuming there's something in my python (or perhaps an undocumented clingo dependence on SSL).

Enable the clingo concretizer

spack load clingo-boostrap

[coe0201@node003 ~]$ clingo --version
clingo version 5.5.0
Address model: 64-bit

libclingo version 5.5.0
Configuration: with Python 3.7.5, without Lua

libclasp version 3.3.5 (libpotassco version 1.1.0)
Configuration: WITH_THREADS=1
Copyright (C) Benjamin Kaufmann

License: The MIT License <https://opensource.org/licenses/MIT>

I then spack config edit config adding

config:
  concretizer: clingo

I found I really need to spack clean -all after this.

Next,

[coe0201@node003 ~]$ spack clean --all
==> Removing all temporary build stages
==> Removing cached downloads
==> Removing install failure marks
==> Removing cached information on repositories
==> Removing python cache files
==> Removing software in "/home/users/coe0201/.spack/bootstrap/store"

[coe0201@node003 ~]$ spack spec zlib
Input spec
--------------------------------
zlib

Concretized
--------------------------------
==> Error: module 'clingo' has no attribute 'Symbol'

try using plain old clingo

make sure spack unload clingo-bootstrap and spack uninstall clingo-bootstrap

  1. spack edit clingo
  2. add depends_on(openssl) and add '-DCMAKE_EXE_LINKER_FLAGS={}'.format(spec[openssl].libs.joined())
  3. could add static gcc/c++ stuff (like in bootstrap) - but didn't to keep it simple
  4. clingo will now build/install
spack -d --verbose install -j60 clingo@spack %[email protected]

[coe0201@node003 ~]$ spack load clingo

[coe0201@node003 ~]$ clingo --version
clingo version 5.5.0
Address model: 64-bit

libclingo version 5.5.0
Configuration: with Python 3.7.5, without Lua

libclasp version 3.3.5 (libpotassco version 1.1.0)
Configuration: WITH_THREADS=1
Copyright (C) Benjamin Kaufmann

License: The MIT License <https://opensource.org/licenses/MIT>

spack clean --all

[coe0201@node003 ~]$ spack spec zlib %[email protected]
Input spec
--------------------------------
zlib%[email protected]

Concretized
--------------------------------
==> Error: module 'clingo' has no attribute 'Symbol'
commands
Input spec
--------------------------------
zlib%[email protected]

Concretized
--------------------------------
==> [2021-03-23-01:40:25.637746, 3585632] Reading config file /home/users/coe0201/src/spack/etc/spack/defaults/config.yaml
==> [2021-03-23-01:40:25.671790, 3585632] Reading config file /home/users/coe0201/.spack/config.yaml
Traceback (most recent call last):
  File "/home/users/coe0201/src/spack/bin/spack", line 76, in <module>
    sys.exit(spack.main.main())
  File "/home/users/coe0201/src/spack/lib/spack/spack/main.py", line 768, in main
    return _invoke_command(command, parser, args, unknown)
  File "/home/users/coe0201/src/spack/lib/spack/spack/main.py", line 496, in _invoke_command
    return_val = command(parser, args)
  File "/home/users/coe0201/src/spack/lib/spack/spack/cmd/spec.py", line 102, in spec
    spec.concretize()
  File "/home/users/coe0201/src/spack/lib/spack/spack/spec.py", line 2552, in concretize
    self._new_concretize(tests)
  File "/home/users/coe0201/src/spack/lib/spack/spack/spec.py", line 2513, in _new_concretize
    import spack.solver.asp
  File "/home/users/coe0201/src/spack/lib/spack/spack/solver/asp.py", line 22, in <module>
    clingo_cffi = hasattr(clingo.Symbol, '_rep')
AttributeError: module 'clingo' has no attribute 'Symbol'

cat  /home/users/coe0201/.spack/config.yaml
config:
  concretizer: clingo

@tgamblin (you are the maintainer listed in the package)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions