spack / spack

A flexible package manager that supports multiple versions, configurations, platforms, and compilers.

Home Page:https://spack.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation issue: can't install llvm @main due to GCC_INSTALL_PREFIX error

jeffhammond opened this issue · comments

Steps to reproduce the issue

~/SPACK/spack$ spack spec -I  llvm @main z3=true flang=true
Input spec
--------------------------------
 -   llvm@main+flang+z3

Concretized
--------------------------------
 -   llvm@main%gcc@13.2.0+clang~cuda+flang+gold~ipo+libomptarget~libomptarget_debug~link_llvm_dylib+lld+lldb+llvm_dylib+lua~mlir+polly~python~split_dwarf+z3~zstd build_system=cmake build_type=Release compiler-rt=runtime generator=ninja libcxx=runtime libunwind=runtime openmp=runtime shlib_symbol_version=none targets=all version_suffix=none arch=linux-ubuntu22.04-zen4
[+]      ^binutils@2.42%gcc@13.2.0~gas+gold~gprofng+headers~interwork+ld~libiberty~lto~nls~pgo+plugins build_system=autotools compress_debug_sections=zlib libs=shared,static arch=linux-ubuntu22.04-zen4
[+]          ^diffutils@3.10%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]          ^gmake@4.4.1%gcc@13.2.0~guile build_system=generic arch=linux-ubuntu22.04-zen4
[+]          ^zstd@1.5.6%gcc@13.2.0+programs build_system=makefile compression=none libs=shared,static arch=linux-ubuntu22.04-zen4
[+]      ^cmake@3.27.9%gcc@13.2.0~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-ubuntu22.04-zen4
[+]          ^curl@8.6.0%gcc@13.2.0~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs=shared,static tls=openssl arch=linux-ubuntu22.04-zen4
[+]              ^nghttp2@1.57.0%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]      ^gcc-runtime@13.2.0%gcc@13.2.0 build_system=generic arch=linux-ubuntu22.04-zen4
[e]      ^glibc@2.35%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]      ^hwloc@2.9.1%gcc@13.2.0~cairo~cuda~gl~libudev+libxml2~netloc~nvml~oneapi-level-zero~opencl+pci~rocm build_system=autotools libs=shared,static arch=linux-ubuntu22.04-zen4
[+]          ^libpciaccess@0.17%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]              ^libtool@2.4.7%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]                  ^findutils@4.9.0%gcc@13.2.0 build_system=autotools patches=440b954 arch=linux-ubuntu22.04-zen4
[+]                  ^m4@1.4.19%gcc@13.2.0+sigsegv build_system=autotools patches=9dc5fbd,bfdffa7 arch=linux-ubuntu22.04-zen4
[+]                      ^libsigsegv@2.14%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]              ^util-macros@1.19.3%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]      ^libedit@3.1-20230828%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]      ^libffi@3.4.6%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]      ^libxml2@2.10.3%gcc@13.2.0+pic~python+shared build_system=autotools arch=linux-ubuntu22.04-zen4
[+]          ^libiconv@1.17%gcc@13.2.0 build_system=autotools libs=shared,static arch=linux-ubuntu22.04-zen4
[+]      ^lua@5.3.6%gcc@13.2.0~pcfile+shared build_system=makefile fetcher=curl arch=linux-ubuntu22.04-zen4
[+]          ^readline@8.2%gcc@13.2.0 build_system=autotools patches=bbf97f1 arch=linux-ubuntu22.04-zen4
[+]          ^unzip@6.0%gcc@13.2.0 build_system=makefile patches=f6f6236 arch=linux-ubuntu22.04-zen4
[+]      ^ncurses@6.4%gcc@13.2.0~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=linux-ubuntu22.04-zen4
[+]      ^ninja@1.11.1%gcc@13.2.0+re2c build_system=generic arch=linux-ubuntu22.04-zen4
[+]          ^re2c@2.2%gcc@13.2.0 build_system=generic arch=linux-ubuntu22.04-zen4
[+]      ^perl-data-dumper@2.173%gcc@13.2.0 build_system=perl arch=linux-ubuntu22.04-zen4
[+]          ^perl@5.38.0%gcc@13.2.0+cpanm+opcode+open+shared+threads build_system=generic patches=714e4d1 arch=linux-ubuntu22.04-zen4
[+]              ^berkeley-db@18.1.40%gcc@13.2.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-ubuntu22.04-zen4
[+]      ^pkgconf@1.9.5%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]      ^python@3.11.7%gcc@13.2.0+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=13fa8bf,b0615b2,ebdca64,f2fd060 arch=linux-ubuntu22.04-zen4
[+]          ^bzip2@1.0.8%gcc@13.2.0~debug~pic+shared build_system=generic arch=linux-ubuntu22.04-zen4
[+]          ^expat@2.6.2%gcc@13.2.0+libbsd build_system=autotools arch=linux-ubuntu22.04-zen4
[+]              ^libbsd@0.12.1%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]                  ^libmd@1.0.4%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]          ^gdbm@1.23%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]          ^gettext@0.22.4%gcc@13.2.0+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=linux-ubuntu22.04-zen4
[+]              ^tar@1.34%gcc@13.2.0 build_system=autotools zip=pigz arch=linux-ubuntu22.04-zen4
[+]                  ^pigz@2.8%gcc@13.2.0 build_system=makefile arch=linux-ubuntu22.04-zen4
[+]          ^libxcrypt@4.4.35%gcc@13.2.0~obsolete_api build_system=autotools patches=4885da3 arch=linux-ubuntu22.04-zen4
[+]          ^openssl@3.2.1%gcc@13.2.0~docs+shared build_system=generic certs=mozilla arch=linux-ubuntu22.04-zen4
[+]              ^ca-certificates-mozilla@2023-05-30%gcc@13.2.0 build_system=generic arch=linux-ubuntu22.04-zen4
[+]          ^sqlite@3.43.2%gcc@13.2.0+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=linux-ubuntu22.04-zen4
[+]          ^util-linux-uuid@2.38.1%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]      ^swig@4.1.1%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-zen4
[+]          ^pcre2@10.42%gcc@13.2.0~jit+multibyte build_system=autotools arch=linux-ubuntu22.04-zen4
[+]      ^xz@5.4.6%gcc@13.2.0~pic build_system=autotools libs=shared,static arch=linux-ubuntu22.04-zen4
[+]      ^z3@4.12.4%gcc@13.2.0~gmp~ipo~python build_system=cmake build_type=Release generator=make arch=linux-ubuntu22.04-zen4
[+]      ^zlib-ng@2.1.6%gcc@13.2.0+compat+new_strategies+opt+pic+shared build_system=autotools arch=linux-ubuntu22.04-zen4

Tagging maintainers: @haampie @skosukhin @trws

Error message

Error message
1 error found in build log:
     369    -- Looking for sys/resource.h
     370    -- Looking for sys/resource.h - found
     371    -- Looking for dlfcn.h
     372    -- Looking for dlfcn.h - found
     373    -- Looking for dladdr
     374    -- Looking for dladdr - found
  >> 375    CMake Error at /tmp/jehammond/spack-stage/spack-stage-llvm-main-tpzw7iqecnii3oeyvhph6qv7u5ritsga/spack-src/
            clang/CMakeLists.txt:206 (message):
     376      GCC_INSTALL_PREFIX is deprecated and will be removed.  Use configuration
     377      files (https://clang.llvm.org/docs/UsersManual.html#configuration-files)to
     378      specify the default --gcc-install-dir= or --gcc-triple=.  --gcc-toolchain=
     379      is discouraged.  See https://github.com/llvm/llvm-project/pull/77537 for
     380      detail.
     381

Information on your system

~/SPACK/spack$ spack debug report
* **Spack:** 0.22.0.dev0 (d210425eef832c10a6c74365068a3262d20b576b)
* **Python:** 3.10.12
* **Platform:** linux-ubuntu22.04-zen4
* **Concretizer:** clingo

Additional information

spack-build-out.txt
spack-build-env.txt

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have run spack maintainers <name-of-the-package> and @mentioned any maintainers
  • I have uploaded the build log and environment files
  • I have searched the issues of this repo and believe this is not a duplicate

Thanks for the heads up, but main is a moving target. Will fix for LLVM 19.

Thanks. For what it's worth, I don't see the error when I switch my spack config to use Clang instead of the GCC default (spack config add "packages:all:compiler:[clang@19.0.0git]", i.e. using my own build of the compiler that I'm trying to get Spack to generate).

yeah, if you install llvm+clang %gcc@x, then we configure clang to use gcc@x for the underlying gcc runtime libs / headers. For any other compiler we don't, and clang will do a system scan for some gcc it can use at runtime (which can be wrong)

#43795 should improve things for clang 16 and above. Have to still test flang though, is it any good now?

flang-new is getting there but it's not perfect. the motivation for me using Spack is to see what breaks and then file all the compiler bug reports...