eth-cscs / stackinator

Home Page:https://eth-cscs.github.io/stackinator/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Note] Building GCC from Spack's develop fails

RMeli opened this issue · comments

Using the latest version of Spack's develop now fails to build GCC 11 with the following error:

  >> 4652    lto-compress.c:(.text+0x173): undefined reference to `ZSTD_compressBound'
  >> 4653    /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: lto-compress.c:(.text+0x194): undefined reference to `ZSTD_maxCLevel'
  >> 4654    /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: lto-compress.c:(.text+0x1b0): undefined reference to `ZSTD_compress'
  >> 4655    /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: lto-compress.c:(.text+0x1bb): undefined reference to `ZSTD_isError'
  >> 4656    /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: lto-compress.c:(.text+0x231): undefined reference to `ZSTD_maxCLevel'
  >> 4657    /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: lto-compress.c:(.text+0x240): undefined reference to `ZSTD_getErrorName'
     4658    /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: lto-compress.o: in function `lto_end_uncompression(lto_compression_stream*, lto_compression)':
  >> 4659    lto-compress.c:(.text+0x4ff): undefined reference to `ZSTD_getFrameContentSize'
  >> 4660    /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: lto-compress.c:(.text+0x532): undefined reference to `ZSTD_decompress'
  >> 4661    /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: lto-compress.c:(.text+0x53d): undefined reference to `ZSTD_isError'
  >> 4662    /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: lto-compress.c:(.text+0x5a0): undefined reference to `ZSTD_getErrorName'
  >> 4663    collect2: error: ld returned 1 exit status
  >> 4664    make[4]: *** [/tmp/rmeli/spack-stage/spack-stage-gcc-11.3.0-6lzw62v4qr6t3mlie3yeqa4l5dsye6lj/spack-src/gcc/cp/Make-lang.in:136: cc1plus] Error 1

This is likely related to the latest version of zstd added in spack/spack#35438.

Note

  • This is observed when building the bootstrap compiler.

This issue seems to be related to the switch from Makefile to CMake in spack/spack#35104. @bcumming confirmed that reverting to spack/spack#35104 and building with @1.5.4 does work (hence the new version is not the issue).

Fixing the MakefileBuilder (see https://github.com/spack/spack/pull/35104/files#r1155738834) and using build_system=makefile does work:

diff --git a/stackinator/templates/compilers.bootstrap.spack.yaml b/stackinator/templates/compilers.bootstrap.spack.yaml
index 88c0b54..63ae106 100644
--- a/stackinator/templates/compilers.bootstrap.spack.yaml
+++ b/stackinator/templates/compilers.bootstrap.spack.yaml
@@ -20,7 +20,8 @@ spack:
     mpfr:
       variants: [libs=static]
     zstd:
-      variants: [libs=static]
+      variants: [libs=static build_system=makefile]
+      version: [1.5.2]
     zlib:
       variants: [~shared]
 
diff --git a/stackinator/templates/compilers.gcc.spack.yaml b/stackinator/templates/compilers.gcc.spack.yaml
index cf186e4..36bda85 100644
--- a/stackinator/templates/compilers.gcc.spack.yaml
+++ b/stackinator/templates/compilers.gcc.spack.yaml
@@ -21,6 +21,7 @@ spack:
     mpfr:
       variants: [libs=static]
     zstd:
-      variants: [libs=static]
+      variants: [libs=static build_system=makefile]
+      version: [1.5.2]
     zlib:
       variants: [~shared]
lines 29-79/79 (END)

spack/spack#36606 fixes the MakefileBuilder and revert the default from CMake to Makefile.

spack/spack#36606 has been merged in Spack.
I have verified that the problem is fixed on develop.

Thanks for checking @bcumming