awslabs / palace

3D finite element solver for computational electromagnetics
https://awslabs.github.io/palace/dev
Apache License 2.0
224 stars 50 forks source link

Build failed: libCEED test program - Failed #257

Closed LeSnow-Ye closed 1 month ago

LeSnow-Ye commented 1 month ago

I installed Palace 0.12.0 using Spack weeks ago successfully. But when I try to update it to 0.13.0 by adding version("0.13.0", tag="v0.13.0", commit="a61c8cbe0cacf496cde3c62e93085fae0d6299ac") to spack edit palace, the build process failed.

==> Installing palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc [40/40]
==> No binary for palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc found: installing from source
==> No patches needed for palace
==> palace: Executing phase: 'cmake'
==> palace: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j16'

4 errors found in build log:
     888    -- Found PkgConfig: /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/pkgconf-2.2.0-x44j65ae2lk4ybz5h7om4y2awc7h35j6/bin/pkg-config (found version "2.2.0")
     889    -- Checking for module 'ceed'
     890    --   Found ceed, version 0.12.0
     891    -- Found libCEED: 0.12.0
     892    -- libCEED test program - Failed
     893    -- libCEED test program with static linkage - Failed
  >> 894    CMake Error at CMakeLists.txt:125 (message):
     895      libCEED could not be found, be sure to set LIBCEED_DIR
     896
     897
     898    -- Configuring incomplete, errors occurred!
  >> 899    make[2]: *** [CMakeFiles/palace-install.dir/build.make:93: palace-cmake/src/palace-stamp/palace-configure] Error 1
     900    make[2]: Leaving directory '/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql'
  >> 901    make[1]: *** [CMakeFiles/Makefile2:229: CMakeFiles/palace-install.dir/all] Error 2
     902    make[1]: Leaving directory '/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql'
  >> 903    make: *** [Makefile:94: all] Error 2

See build log for details:
  /tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-out.txt

spack-build-out.txt

uname -a

spack -V

sebastiangrimberg commented 1 month ago

This is an issue we have seen before that has to do with the LIBXSMM dependency for libCEED and its versioning. See the following line from the build log when compiling libCEED:

/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql/extern/libCEED/backends/xsmm/ceed-xsmm-tensor.c: In function 'CeedTensorContractApply_Xsmm':
/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql/extern/libCEED/backends/xsmm/ceed-xsmm-tensor.c:33:41: warning: implicit declaration of function 'libxsmm_dispatch_gemm'; did you mean 'libxsmm_dispatch_gemm_v2'? [-Wimplicit-function-declaration]
   33 |     const libxsmm_gemmfunction kernel = libxsmm_dispatch_gemm(gemm_shape, (libxsmm_bitfield)(flags), (libxsmm_bitfield)LIBXSMM_GEMM_PREFETCH_NONE);
      |                                         ^~~~~~~~~~~~~~~~~~~~~
      |                                         libxsmm_dispatch_gemm_v2
/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql/extern/libCEED/backends/xsmm/ceed-xsmm-tensor.c:33:41: warning: initialization of 'libxsmm_gemmfunction' {aka 'void (* const)(const libxsmm_gemm_param *)'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql/extern/libCEED/backends/xsmm/ceed-xsmm-tensor.c:53:41: warning: initialization of 'libxsmm_gemmfunction' {aka 'void (* const)(const libxsmm_gemm_param *)'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
   53 |     const libxsmm_gemmfunction kernel = libxsmm_dispatch_gemm(gemm_shape, (libxsmm_bitfield)(flags), (libxsmm_bitfield)LIBXSMM_GEMM_PREFETCH_NONE);
      |                                         ^~~~~~~~~~~~~~~~~~~~~

Essentially libCEED requires a newer version of LIBXSMM, but LIBXSMM has not tagged a new release yet. This can be fixed by adding ^libxsmm@=main to your spack spec (as done here). Hopefully this should resolve your problem, and this should all be fixed once LIBXSMM tags v2.0 which has been in the works for some time now. I will fix this soon by making it a default when updating the Palace recipe in the main spack package registry.

LeSnow-Ye commented 1 month ago

This is an issue we have seen before that has to do with the LIBXSMM dependency for libCEED and its versioning. See the following line from the build log when compiling libCEED:

/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql/extern/libCEED/backends/xsmm/ceed-xsmm-tensor.c: In function 'CeedTensorContractApply_Xsmm':
/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql/extern/libCEED/backends/xsmm/ceed-xsmm-tensor.c:33:41: warning: implicit declaration of function 'libxsmm_dispatch_gemm'; did you mean 'libxsmm_dispatch_gemm_v2'? [-Wimplicit-function-declaration]
   33 |     const libxsmm_gemmfunction kernel = libxsmm_dispatch_gemm(gemm_shape, (libxsmm_bitfield)(flags), (libxsmm_bitfield)LIBXSMM_GEMM_PREFETCH_NONE);
      |                                         ^~~~~~~~~~~~~~~~~~~~~
      |                                         libxsmm_dispatch_gemm_v2
/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql/extern/libCEED/backends/xsmm/ceed-xsmm-tensor.c:33:41: warning: initialization of 'libxsmm_gemmfunction' {aka 'void (* const)(const libxsmm_gemm_param *)'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql/extern/libCEED/backends/xsmm/ceed-xsmm-tensor.c:53:41: warning: initialization of 'libxsmm_gemmfunction' {aka 'void (* const)(const libxsmm_gemm_param *)'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
   53 |     const libxsmm_gemmfunction kernel = libxsmm_dispatch_gemm(gemm_shape, (libxsmm_bitfield)(flags), (libxsmm_bitfield)LIBXSMM_GEMM_PREFETCH_NONE);
      |                                         ^~~~~~~~~~~~~~~~~~~~~

Essentially libCEED requires a newer version of LIBXSMM, but LIBXSMM has not tagged a new release yet. This can be fixed by adding ^libxsmm@=main to your spack spec (as done here). Hopefully this should resolve your problem, and this should all be fixed once LIBXSMM tags v2.0 which has been in the works for some time now. I will fix this soon by making it a default when updating the Palace recipe in the main spack package registry.

Thanks @sebastiangrimberg. But libxsmm@=main is already in my spack spec:

 with when("+libxsmm"):
        depends_on("libxsmm@main")
        depends_on("libxsmm+shared", when="+shared")
        depends_on("libxsmm~shared", when="~shared")

But the build still failed. And the log shows: [+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/libxsmm-main-2023-11-5xxeu6lcukmal7pffbfejr3gn5lhrzdx The full log is here:

root@LeSnow:~/spack# spack install palace@0.13.0
[+] /usr (external glibc-2.35-a6gbmc46yvlto6k25enqs2uvod2wzn4p)
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/gcc-runtime-11.4.0-7pmsvsmkytfu6wygzaa63d3kx4ctethx
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/metis-5.1.0-rzenp5ykfydxe57267iboefcjuiyra7w
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/xz-5.4.6-vhuojrm5zr762qtq62iziautlcom7c5t
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/eigen-3.4.0-j2tbinywaqluab2cmugnubrtnh4mg2by
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/zlib-ng-2.1.6-bjkgkdeave35anjbjg5umqf2siqo3pb7
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/bzip2-1.0.8-6a524bobtgy7ellrl4ldiqwiius4y5y6
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/numactl-2.0.14-jk7jle7pj4r6fmkblqmbcchbjg5sbyr2
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/gmake-4.4.1-kzsslwdxxhqxcdczbkj2dqrnzsozvko7
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/openssl-3.3.0-zqbpr2omupttanmkr36qcnu2dblk6oer
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/nlohmann-json-3.11.2-coiylggoaghtd7baterypjl4jh5gk33l
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/zstd-1.5.6-5oorsexlrcawi2rlwb47o6a7gfethdfz
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/fmt-10.2.1-sxvkvwodjt2bedg7coxlk34tqepcm2lf
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/libxsmm-main-2023-11-5xxeu6lcukmal7pffbfejr3gn5lhrzdx
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/ncurses-6.5-vtc3xovd3nu2tbbkf2fgbqgbxieatyg2
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/libxml2-2.10.3-hdmmlzg5fr43hvbqsg566x7keqoyila6
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/pigz-2.8-svawaftdbkpf2pxh5t3dpsv6j6ybv5vc
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/pkgconf-2.2.0-x44j65ae2lk4ybz5h7om4y2awc7h35j6
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/openblas-0.3.26-j23jwr5x72wsljzdf7jqvutvxnixijq2
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/libxcrypt-4.4.35-u3he4lvpxy3ut7sfm424mqtrzhyqjsf2
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/libevent-2.1.12-hcmhpe2qfhfflgbgfnplngp3walkqvjk
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/tar-1.34-2edmqormzb3f6xshbvcnelmew6ap6qj4
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/libpciaccess-0.17-4awzu5hbpcxuwiey4pzngbd5ekytcqxg
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/nghttp2-1.57.0-4ziu4yfdwstwbjswdypdcjurfwihcqe5
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/libedit-3.1-20230828-424bb55bcmutrsgjsmsbn7grmpq2lmrc
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/gettext-0.22.5-7rkpuaxed45qq6paz3r2bosnximv72jk
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/hwloc-2.9.1-sinhqepslwyxw3ob447kxeiuvmsi5sgp
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/curl-8.7.1-twwjemejh5gsjwr2y6fq4mdcaz3y7c4k
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/krb5-1.21.2-3asfdjbrfrqvwzgfadpn27252xsnzy2o
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/pmix-5.0.1-3stcx7fmbxka3lvbczcbihf4m5hf6uds
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/cmake-3.27.9-vmkxz74pnvwi5ibw4mn7al67niuryfpl
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/openssh-9.7p1-ok6ccqvj2kzwonblw4cqkeq6jdznc5hq
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/openmpi-5.0.3-zcz5xw7logzv2r4lgjwd64jnaz2p4htw
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/parmetis-4.0.3-7xx3e6e4qm3qy2vxzgab3dljvrggee6j
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/hdf5-1.14.3-my7c4cdecdwm74r76nn44uws6x7aazvf
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/hypre-2.31.0-w33sgxaoquzdrwqrmvz7tci2xmggs6b3
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/superlu-dist-8.2.1-nco42h2vpmlbygwkbovoiunjr6yact43
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/petsc-3.21.1-h646hdskevn5ezshgamrbiqmmdrbiinq
[+] /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/slepc-3.21.0-s2htyhnpzv4qtaauw7f2hy6lupyykt2s
==> Installing palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc [40/40]
==> No binary for palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc found: installing from source
==> Using cached archive: /root/spack/var/spack/cache/_source-cache/git//awslabs/palace.git/a61c8cbe0cacf496cde3c62e93085fae0d6299ac.tar.gz
==> Warning: Fetching from mirror without a checksum!
  This package is normally checked out from a version control system, but it has been archived on a spack mirror.  This means we cannot know a checksum for the tarball in advance. Be sure that your connection to this mirror is secure!
==> No patches needed for palace
==> palace: Executing phase: 'cmake'
==> palace: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j16'

4 errors found in build log:
     888    -- Found PkgConfig: /root/spack/opt/spack/linux-ubuntu22.04-broadwell/gcc-11.4.0/pkgconf-2.2.0-x44j65ae2lk4ybz5h7om4y2awc7h35j6/bin/pkg-
            config (found version "2.2.0")
     889    -- Checking for module 'ceed'
     890    --   Found ceed, version 0.12.0
     891    -- Found libCEED: 0.12.0
     892    -- libCEED test program - Failed
     893    -- libCEED test program with static linkage - Failed
  >> 894    CMake Error at CMakeLists.txt:125 (message):
     895      libCEED could not be found, be sure to set LIBCEED_DIR
     896
     897
     898    -- Configuring incomplete, errors occurred!
  >> 899    make[2]: *** [CMakeFiles/palace-install.dir/build.make:93: palace-cmake/src/palace-stamp/palace-configure] Error 1
     900    make[2]: Leaving directory '/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql'
  >> 901    make[1]: *** [CMakeFiles/Makefile2:229: CMakeFiles/palace-install.dir/all] Error 2
     902    make[1]: Leaving directory '/tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-oeqscql'
  >> 903    make: *** [Makefile:94: all] Error 2

See build log for details:
  /tmp/root/spack-stage/spack-stage-palace-0.13.0-oeqscqlllwxtxa236vpltaxzqunyykjc/spack-build-out.txt
sebastiangrimberg commented 1 month ago

It looks like you have libxsmm@main, which is different than my suggestion of libxsmm@=main. There is an old release tag in LIBXSMM which will be preferred over the head of main when neglecting the equals sign.

LeSnow-Ye commented 1 month ago

My bad, I missed that. Now it works. Thanks a lot!