spack / spack

A flexible package manager that supports multiple versions, configurations, platforms, and compilers.
https://spack.io
Other
4.42k stars 2.29k forks source link

Cannot build clingo on RISC-V #45724

Open abiolasams opened 3 months ago

abiolasams commented 3 months ago

Steps to reproduce

I ran spack -b find -p clingo-bootstrap to install clingo

Error message

==> Error: No package matches the query: clingo-bootstrap

@alalazo Could you take a look at this issue? Thank you.

Information on your system

root@riscv:/opt/spack# spack config get packages
packages:
  all:
    compiler: [gcc, clang, oneapi, xl, nag, fj, aocc]
    providers:
      awk: [gawk]
      armci: [armcimpi]
      blas: [openblas, amdblis]
      cxx: [gcc]
      D: [ldc]
      daal: [intel-oneapi-daal]
      elf: [elfutils]
      fftw-api: [fftw, amdfftw]
      flame: [libflame, amdlibflame]
      fortran-rt: [gcc-runtime, intel-oneapi-runtime]
      fuse: [libfuse]
      gl: [glx, osmesa]
      glu: [mesa-glu, openglu]
      golang: [go, gcc]
      go-or-gccgo-bootstrap: [go-bootstrap, gcc]
      iconv: [libiconv]
      ipp: [intel-oneapi-ipp]
      java: [openjdk, jdk, ibm-java]
      jpeg: [libjpeg-turbo, libjpeg]
      lapack: [openblas, amdlibflame]
      libc: [glibc, musl]
      libgfortran: [gcc-runtime]
      libglx: [mesa+glx]
      libifcore: [intel-oneapi-runtime]
      libllvm: [llvm]
      lua-lang: [lua, lua-luajit-openresty, lua-luajit]
      luajit: [lua-luajit-openresty, lua-luajit]
      mariadb-client: [mariadb-c-client, mariadb]
      mkl: [intel-oneapi-mkl]
      mpe: [mpe2]
      mpi: [openmpi, mpich]
      mysql-client: [mysql, mariadb-c-client]
      opencl: [pocl]
      onedal: [intel-oneapi-dal]
      pbs: [openpbs, torque]
      pil: [py-pillow]
      pkgconfig: [pkgconf, pkg-config]
      qmake: [qt-base, qt]
      rpc: [libtirpc]
      scalapack: [netlib-scalapack, amdscalapack]
      sycl: [hipsycl]
      szip: [libaec, libszip]
      tbb: [intel-tbb]
      unwind: [libunwind]
      uuid: [util-linux-uuid, libuuid]
      wasi-sdk: [wasi-sdk-prebuilt]
      xxd: [xxd-standalone, vim]
      yacc: [bison, byacc]
      ziglang: [zig]
      zlib-api: [zlib-ng+compat, zlib]
    permissions:
      read: world
      write: user

General information

alalazo commented 3 months ago

@abiolasams Can you post:

$ spack clean -ab
$ spack -d bootstrap now

? I'll try that myself as soon as I have access to a RISC-V machine (hopefully soon).

abiolasams commented 3 months ago

@alalazo thank you

$ spack -d bootstrap now

$ ==> [2024-08-14-04:26:40.485553] Reading config from file /opt/spack/etc/spack/defaults/config.yaml
Traceback (most recent call last):
  File "/opt/spack/bin/spack", line 52, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/spack/lib/spack/spack_installable/main.py", line 42, in main
    sys.exit(spack.main.main(argv))
             ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/spack/lib/spack/spack/main.py", line 1070, in main
    return _main(argv)
           ^^^^^^^^^^^
  File "/opt/spack/lib/spack/spack/main.py", line 1023, in _main
    return finish_parse_and_run(parser, cmd_name, args, env_format_error)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/spack/lib/spack/spack/main.py", line 1053, in finish_parse_and_run
    return _invoke_command(command, parser, args, unknown)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/spack/lib/spack/spack/main.py", line 650, in _invoke_command
    return_val = command(parser, args)
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/spack/lib/spack/spack/cmd/bootstrap.py", line 463, in bootstrap
    callbacks[args.subcommand](args)
  File "/opt/spack/lib/spack/spack/cmd/bootstrap.py", line 445, in _now
    spack.bootstrap.ensure_core_dependencies()
  File "/opt/spack/lib/spack/spack/bootstrap/core.py", line 578, in ensure_core_dependencies
    ensure_clingo_importable_or_raise()
  File "/opt/spack/lib/spack/spack/bootstrap/core.py", line 478, in ensure_clingo_importable_or_raise
    ensure_module_importable_or_raise(module="clingo", abstract_spec=clingo_root_spec())
  File "/opt/spack/lib/spack/spack/bootstrap/core.py", line 382, in ensure_module_importable_or_raise
    raise ImportError(msg)
ImportError: cannot bootstrap the "clingo" Python module from spec "clingo-bootstrap@spack+python %gcc platform=linux target=riscv64" due to the following failures:
spack-install raised InstallError: Terminating after first install failure: ProcessError: Command exited with status 1:
    '/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/cmake-3.30.2-umlb6uk6upjy2ej6h47s5wcjs3eutivd/bin/cmake' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:STRING=/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/clingo-bootstrap-spack-ukqfy2xrtq4lj5w574gku22ge64nulfx' '-DCMAKE_BUILD_TYPE:STRING=Release' '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF' '-DCMAKE_POLICY_DEFAULT_CMP0090:STRING=NEW' '-DCMAKE_FIND_USE_PACKAGE_REGISTRY:BOOL=OFF' '-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON' '-DPYTHON_EXECUTABLE:STRING=/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/python-venv-1.0-p3ujkc64xoilrbvmz3cfifksikj2s4wa/bin/python3' '-DPython_EXECUTABLE:STRING=/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/python-venv-1.0-p3ujkc64xoilrbvmz3cfifksikj2s4wa/bin/python3' '-DPython3_EXECUTABLE:STRING=/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/python-venv-1.0-p3ujkc64xoilrbvmz3cfifksikj2s4wa/bin/python3' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON' '-DCMAKE_INSTALL_RPATH:STRING=/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/clingo-bootstrap-spack-ukqfy2xrtq4lj5w574gku22ge64nulfx/lib;/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/clingo-bootstrap-spack-ukqfy2xrtq4lj5w574gku22ge64nulfx/lib64' '-DCMAKE_PREFIX_PATH:STRING=/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/re2c-3.0-u27qh2jonpltaha6pgoq4tiy2qljstpo;/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/python-venv-1.0-p3ujkc64xoilrbvmz3cfifksikj2s4wa;/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/cmake-3.30.2-umlb6uk6upjy2ej6h47s5wcjs3eutivd;/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/bison-3.8.2-zury44zhxpebxymet24zaakhyo6w2d2z;/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/gmake-4.4.1-z4o5ihe57hwywvvpzhmuljwvd4bxpzet' '-DCLINGO_BUILD_WITH_LUA:BOOL=OFF' '-DCLINGO_REQUIRE_PYTHON:BOOL=ON' '-DCLINGO_BUILD_WITH_PYTHON:BOOL=ON' '-DPYCLINGO_USER_INSTALL:BOOL=OFF' '-DPYCLINGO_USE_INSTALL_PREFIX:BOOL=ON' '-DPYCLINGO_INSTALL_DIR:STRING=/root/.spack/bootstrap/store/linux-debian12-riscv64/gcc-13.2.0/clingo-bootstrap-spack-ukqfy2xrtq4lj5w574gku22ge64nulfx/lib/python3.11/site-packages' '-DPYCLINGO_SUFFIX:STRING=.cpython-311-riscv64-linux-gnu.so' '-DCLINGO_BUILD_PY_SHARED:STRING=OFF' '-DCLINGO_BUILD_APPS:BOOL=OFF' '/tmp/root/spack-stage/spack-stage-clingo-bootstrap-spack-ukqfy2xrtq4lj5w574gku22ge64nulfx/spack-src'
  File "/opt/spack/lib/spack/spack/bootstrap/core.py", line 367, in ensure_module_importable_or_raise
    if current_bootstrapper.try_import(module, abstract_spec):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/spack/lib/spack/spack/bootstrap/core.py", line 287, in try_import
    concrete_spec.package.do_install(fail_fast=True)
  File "/opt/spack/lib/spack/spack/package_base.py", line 1900, in do_install
    PackageInstaller([self], kwargs).install()
  File "/opt/spack/lib/spack/spack/installer.py", line 2167, in install
    raise InstallError(f"{fail_fast_err}: {str(exc)}", pkg=pkg)
abiolasams commented 2 months ago

got clingo to install with this code


export PYTHON_LIBRARY=/usr/lib/riscv64-linux-gnu/libpython3.11.so
sudo apt install python3-pip
pip3 install --upgrade pip setuptools wheel
spack install clingo +python ^python@3.11