spack / spack

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

Installation issue: linking error while building `cp2k@2023.2`: `undefined reference to libxsmm_dispatch_gemm_v2` #42971

Open giordano opened 7 months ago

giordano commented 7 months ago

Steps to reproduce the issue

$ spack -e . spec -I cp2k@2023.2
Input spec
--------------------------------
 -   cp2k@2023.2

Concretized
--------------------------------
 -   cp2k@2023.2%gcc@12.3.0~cosma~cuda~elpa~enable_regtests~ipo+libint~libvori+libxc+mpi~mpi_f08+openmp~pexsi~plumed~pytorch~quip~rocm~sirius~spglib~spla build_system=cmake build_type=Release generator=make lmax=5 pat
ches=1d3051b smm=libxsmm arch=linux-rhel7-skylake_avx512
[+]      ^cmake@3.27.7%gcc@12.3.0~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-rhel7-skylake_avx512
[+]          ^curl@8.4.0%gcc@12.3.0~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs=shared,static tls=openssl arch=linux-rhel7-skylake_avx512
[+]              ^nghttp2@1.57.0%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^ncurses@6.4%gcc@12.3.0~symlinks+termlib abi=none build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^zlib-ng@2.1.4%gcc@12.3.0+compat+opt build_system=autotools arch=linux-rhel7-skylake_avx512
[+]      ^dbcsr@2.6.0%gcc@12.3.0+cuda~cuda_arch_35_k20x~examples~ipo+mpi~mpi_f08~opencl+openmp~rocm+shared build_system=cmake build_type=Release cuda_arch=80 generator=ninja patches=d96984f smm=libxsmm arch=linux-rhel
7-skylake_avx512
[+]          ^cuda@12.2.0%gcc@12.3.0~allow-unsupported-compilers~dev build_system=generic arch=linux-rhel7-skylake_avx512
[+]              ^libxml2@2.10.3%gcc@12.3.0+pic~python+shared build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^ninja@1.11.1%gcc@12.3.0+re2c build_system=generic arch=linux-rhel7-skylake_avx512
[+]              ^re2c@2.2%gcc@12.3.0 build_system=generic arch=linux-rhel7-skylake_avx512
[+]      ^fftw@3.3.10%gcc@12.3.0+mpi+openmp~pfft_patches build_system=autotools precision=double,float arch=linux-rhel7-skylake_avx512
[+]      ^gmake@4.4.1%gcc@12.3.0~guile build_system=generic arch=linux-rhel7-skylake_avx512
[+]      ^libint@2.6.0%gcc@12.3.0~debug~fma+fortran build_system=autotools tune=cp2k-lmax-5 arch=linux-rhel7-skylake_avx512
[+]          ^autoconf@2.69%gcc@12.3.0 build_system=autotools patches=35c4492,7793209,a49dd5b arch=linux-rhel7-skylake_avx512
[+]              ^m4@1.4.19%gcc@12.3.0+sigsegv build_system=autotools patches=9dc5fbd,bfdffa7 arch=linux-rhel7-skylake_avx512
[+]                  ^libsigsegv@2.14%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^automake@1.16.5%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^boost@1.83.0%gcc@12.3.0+atomic+chrono~clanglibcpp~container~context~contract~coroutine+date_time~debug+exception~fiber+filesystem+graph~graph_parallel~icu+iostreams~json+locale+log+math~mpi+multithreaded
~nowide~numpy~pic+program_options~python+random+regex+serialization+shared+signals~singlethreaded~stacktrace+system~taggedlayout+test+thread+timer~type_erasure~versionedlayout+wave build_system=generic cxxstd=98 patch
es=a440f96 visibility=hidden arch=linux-rhel7-skylake_avx512
[+]              ^zstd@1.5.5%gcc@12.3.0+programs build_system=makefile compression=none libs=shared,static arch=linux-rhel7-skylake_avx512
[+]          ^gmp@6.2.1%gcc@12.3.0+cxx build_system=autotools libs=shared,static patches=69ad2e2 arch=linux-rhel7-skylake_avx512
[+]          ^libtool@2.4.7%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]      ^libxc@6.2.2%gcc@12.3.0~cuda~kxc~lxc+shared build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^perl@5.38.0%gcc@12.3.0+cpanm+opcode+open+shared+threads build_system=generic patches=714e4d1 arch=linux-rhel7-skylake_avx512
[+]              ^berkeley-db@18.1.40%gcc@12.3.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-rhel7-skylake_avx512
[+]      ^libxsmm@main%gcc@12.3.0~debug~generator~header-only~large_jit_buffer~shared blas=default build_system=makefile arch=linux-rhel7-skylake_avx512
[+]          ^python@3.11.6%gcc@13.1.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-rhel7-skylake_avx512
[+]              ^bzip2@1.0.8%gcc@13.1.0~debug~pic+shared build_system=generic arch=linux-rhel7-skylake_avx512
[+]                  ^diffutils@3.9%gcc@13.1.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^expat@2.5.0%gcc@13.1.0+libbsd build_system=autotools arch=linux-rhel7-skylake_avx512
[+]                  ^gmake@4.4.1%gcc@13.1.0~guile build_system=generic arch=linux-rhel7-skylake_avx512
[+]                  ^libbsd@0.11.7%gcc@13.1.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]                      ^libmd@1.0.4%gcc@13.1.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^gdbm@1.23%gcc@13.1.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^gettext@0.22.3%gcc@13.1.0+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=linux-rhel7-skylake_avx512
[+]                  ^libiconv@1.17%gcc@13.1.0 build_system=autotools libs=shared,static arch=linux-rhel7-skylake_avx512
[+]                  ^libxml2@2.10.3%gcc@13.1.0+pic~python+shared build_system=autotools arch=linux-rhel7-skylake_avx512
[+]                  ^tar@1.34%gcc@13.1.0 build_system=autotools zip=pigz arch=linux-rhel7-skylake_avx512
[+]                      ^pigz@2.7%gcc@13.1.0 build_system=makefile arch=linux-rhel7-skylake_avx512
[+]                      ^zstd@1.5.5%gcc@13.1.0+programs build_system=makefile compression=none libs=shared,static arch=linux-rhel7-skylake_avx512
[+]              ^libffi@3.4.4%gcc@13.1.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^libxcrypt@4.4.35%gcc@13.1.0~obsolete_api build_system=autotools patches=4885da3 arch=linux-rhel7-skylake_avx512
[+]              ^ncurses@6.4%gcc@13.1.0~symlinks+termlib abi=none build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^openssl@3.1.3%gcc@13.1.0~docs+shared build_system=generic certs=mozilla arch=linux-rhel7-skylake_avx512
[+]                  ^ca-certificates-mozilla@2023-05-30%gcc@13.1.0 build_system=generic arch=linux-rhel7-skylake_avx512
[+]              ^pkgconf@1.9.5%gcc@13.1.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^readline@8.2%gcc@13.1.0 build_system=autotools patches=bbf97f1 arch=linux-rhel7-skylake_avx512
[+]              ^sqlite@3.43.2%gcc@13.1.0+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^util-linux-uuid@2.38.1%gcc@13.1.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^xz@5.4.1%gcc@13.1.0~pic build_system=autotools libs=shared,static arch=linux-rhel7-skylake_avx512
[+]              ^zlib-ng@2.1.4%gcc@13.1.0+compat+opt build_system=autotools arch=linux-rhel7-skylake_avx512
[+]      ^netlib-scalapack@2.2.0%gcc@12.3.0~ipo~pic+shared build_system=cmake build_type=Release generator=make patches=072b006,1c9ce5f,244a9aa arch=linux-rhel7-skylake_avx512
[+]      ^openblas@0.3.24%gcc@12.3.0~bignuma~consistent_fpcsr+fortran~ilp64+locking+pic+shared build_system=makefile symbol_suffix=none threads=openmp arch=linux-rhel7-skylake_avx512
[+]          ^perl@5.38.0%gcc@13.1.0+cpanm+opcode+open+shared+threads build_system=generic patches=714e4d1 arch=linux-rhel7-skylake_avx512
[+]              ^berkeley-db@18.1.40%gcc@13.1.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-rhel7-skylake_avx512
[+]      ^openmpi@4.1.6%gcc@12.3.0~atomics~cuda~cxx~cxx_exceptions~gpfs~internal-hwloc~internal-pmix~java~legacylaunchers~lustre~memchecker~openshmem~orterunprefix+romio+rsh~singularity+static+vt+wrapper-rpath build_s
ystem=autotools fabrics=none schedulers=none arch=linux-rhel7-skylake_avx512
[+]          ^hwloc@2.9.1%gcc@12.3.0~cairo~cuda~gl~libudev+libxml2~netloc~nvml~oneapi-level-zero~opencl+pci~rocm build_system=autotools libs=shared,static arch=linux-rhel7-skylake_avx512
[+]              ^libpciaccess@0.17%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]                  ^util-macros@1.19.3%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^numactl@2.0.14%gcc@12.3.0 build_system=autotools patches=4e1d78c,62fc8a8,ff37630 arch=linux-rhel7-skylake_avx512
[+]          ^openssh@9.5p1%gcc@12.3.0+gssapi build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^krb5@1.20.1%gcc@12.3.0+shared build_system=autotools arch=linux-rhel7-skylake_avx512
[+]                  ^bison@3.8.2%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]                  ^findutils@4.9.0%gcc@12.3.0 build_system=autotools patches=440b954 arch=linux-rhel7-skylake_avx512
[+]              ^libedit@3.1-20210216%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^pmix@5.0.1%gcc@12.3.0~docs+pmi_backwards_compatibility~python~restful build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^libevent@2.1.12%gcc@12.3.0+openssl build_system=autotools arch=linux-rhel7-skylake_avx512
[+]      ^pkgconf@1.9.5%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]      ^py-fypp@3.1%gcc@12.3.0 build_system=python_pip arch=linux-rhel7-skylake_avx512
[+]          ^py-pip@23.1.2%gcc@12.3.0 build_system=generic arch=linux-rhel7-skylake_avx512
[+]          ^py-setuptools@68.0.0%gcc@12.3.0 build_system=generic arch=linux-rhel7-skylake_avx512
[+]          ^py-wheel@0.41.2%gcc@12.3.0 build_system=generic arch=linux-rhel7-skylake_avx512
[+]      ^python@3.11.6%gcc@12.3.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,f2f
d060 arch=linux-rhel7-skylake_avx512
[+]          ^bzip2@1.0.8%gcc@12.3.0~debug~pic+shared build_system=generic arch=linux-rhel7-skylake_avx512
[+]              ^diffutils@3.9%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^expat@2.5.0%gcc@12.3.0+libbsd build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^libbsd@0.11.7%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]                  ^libmd@1.0.4%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^gdbm@1.23%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^gettext@0.22.3%gcc@12.3.0+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=linux-rhel7-skylake_avx512
[+]              ^libiconv@1.17%gcc@12.3.0 build_system=autotools libs=shared,static arch=linux-rhel7-skylake_avx512
[+]              ^tar@1.34%gcc@12.3.0 build_system=autotools zip=pigz arch=linux-rhel7-skylake_avx512
[+]                  ^pigz@2.7%gcc@12.3.0 build_system=makefile arch=linux-rhel7-skylake_avx512
[+]          ^libffi@3.4.4%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^libxcrypt@4.4.35%gcc@12.3.0~obsolete_api build_system=autotools patches=4885da3 arch=linux-rhel7-skylake_avx512
[+]          ^openssl@3.1.3%gcc@12.3.0~docs+shared build_system=generic certs=mozilla arch=linux-rhel7-skylake_avx512
[+]              ^ca-certificates-mozilla@2023-05-30%gcc@12.3.0 build_system=generic arch=linux-rhel7-skylake_avx512
[+]          ^readline@8.2%gcc@12.3.0 build_system=autotools patches=bbf97f1 arch=linux-rhel7-skylake_avx512
[+]          ^sqlite@3.43.2%gcc@12.3.0+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^util-linux-uuid@2.38.1%gcc@12.3.0 build_system=autotools arch=linux-rhel7-skylake_avx512
[+]          ^xz@5.4.1%gcc@12.3.0~pic build_system=autotools libs=shared,static arch=linux-rhel7-skylake_avx512

Error message

The relevant bit of the error is

Error message
     259     /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/lib/spack/env/gcc/gcc -O3 -g -funroll-loops -Wall -Wl,-rpath,/lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/m
             g-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placehold
             er__/__spack_p/linux-rhel7-skylake_avx512/gcc-11.2.1/gcc-12.3.0-5f6vk4xpghfjmvrafcw6iue7u43373fe/lib/gcc/x86_64-pc-linux-gnu/12.3.0 -Wl,-rpath,/lustre/scratch/scratch/cceamgi/repo/hpc-spack
             -0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pl
             aceholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-11.2.1/gcc-12.3.0-5f6vk4xpghfjmvrafcw6iue7u43373fe/lib64 -Wl,-rpath -Wl,/lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-s
             tack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spac
             k_p/linux-rhel7-skylake_avx512/gcc-12.3.0/openmpi-4.1.6-w725nyrwejjoi3rdkio7wshsakupbj4x/lib -Wl,-rpath -Wl,/lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/sp
             ack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-s
             kylake_avx512/gcc-12.3.0/hwloc-2.9.1-y6res4ryexaeamphx54xr4omx2aazp6d/lib -Wl,-rpath -Wl,/lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_pl
             aceholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-1
             2.3.0/libevent-2.1.12-uqs2s75yexukb7fys4kistp6roxi2vhq/lib -Wl,-rpath -Wl,/lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__s
             pack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/pmix-5.0.
             1-bmqn5mmbtvamajso63dy7m64evmaizfn/lib -L/lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p
             ath_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/hwloc-2.9.1-y6res4ryexaeamphx54xr4omx2aazp
             6d/lib -L/lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_p
             laceholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/libevent-2.1.12-uqs2s75yexukb7fys4kistp6roxi2vhq/lib -L/lustre/scratch/scr
             atch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pl
             aceholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/pmix-5.0.1-bmqn5mmbtvamajso63dy7m64evmaizfn/lib -pthread CMakeFiles/dbm_miniapp.dir/dbm/dbm_miniapp.c.
             o CMakeFiles/dbm_miniapp.dir/dbm/dbm_distribution.c.o CMakeFiles/dbm_miniapp.dir/dbm/dbm_library.c.o CMakeFiles/dbm_miniapp.dir/dbm/dbm_matrix.c.o CMakeFiles/dbm_miniapp.dir/dbm/dbm_mempool
             .c.o CMakeFiles/dbm_miniapp.dir/dbm/dbm_mpi.c.o CMakeFiles/dbm_miniapp.dir/dbm/dbm_multiply.c.o CMakeFiles/dbm_miniapp.dir/dbm/dbm_multiply_comm.c.o CMakeFiles/dbm_miniapp.dir/dbm/dbm_multi
             ply_cpu.c.o CMakeFiles/dbm_miniapp.dir/dbm/dbm_shard.c.o CMakeFiles/dbm_miniapp.dir/dbm/dbm_multiply_gpu.c.o CMakeFiles/dbm_miniapp.dir/dbm/dbm_multiply_gpu_kernel.cu.o CMakeFiles/dbm_minia
             pp.dir/offload/offload_buffer.c.o CMakeFiles/dbm_miniapp.dir/offload/offload_library.c.o -o ../bin/dbm_miniapp.psmp   -L/lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/
             spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/l
             inux-rhel7-skylake_avx512/gcc-12.3.0/cuda-12.2.0-32qg3bjqv2bm3z23bv7f4eej65h4obax/targets/x86_64-linux/lib  -Wl,-rpath,/lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/s
             pack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/li
             nux-rhel7-skylake_avx512/gcc-12.3.0/openblas-0.3.24-o4nzdaacrq4emmpvauqo4fcwrodd3s66/lib:/lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_pl
             aceholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-1
             2.3.0/cuda-12.2.0-32qg3bjqv2bm3z23bv7f4eej65h4obax/lib64:/lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeho
             lder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/openmpi-4.1.6-w725nyrwejjo
             i3rdkio7wshsakupbj4x/lib:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
             :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
             [...many more colons...]
             :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -lm -l:libxsmmf.a -l:libxsmmext.
             a -l:libxsmm.a -lpthread /usr/lib64/librt.so /usr/lib64/libdl.so /usr/lib64/libm.so -lc /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_pla
             ceholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12
             .3.0/openblas-0.3.24-o4nzdaacrq4emmpvauqo4fcwrodd3s66/lib/libopenblas.so /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__sp
             ack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/cuda-12.2.
             0-32qg3bjqv2bm3z23bv7f4eej65h4obax/lib64/libcufftw.so /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholde
             r__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/cuda-12.2.0-32qg3bjqv2bm3z23b
             v7f4eej65h4obax/lib64/libcufft.so /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pla
             ceholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/cuda-12.2.0-32qg3bjqv2bm3z23bv7f4eej65h4obax/lib6
             4/libcublas.so /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_
             path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/cuda-12.2.0-32qg3bjqv2bm3z23bv7f4eej65h4obax/lib64/libcublasLt.so /l
             ustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder_
             _/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/cuda-12.2.0-32qg3bjqv2bm3z23bv7f4eej65h4obax/lib64/libculibos.a /lustre/scratch/scrat
             ch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_plac
             eholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/cuda-12.2.0-32qg3bjqv2bm3z23bv7f4eej65h4obax/lib64/libcudart.so /lustre/scratch/scratch/cceamgi/repo/hpc
             -spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p
             ath_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/cuda-12.2.0-32qg3bjqv2bm3z23bv7f4eej65h4obax/lib64/stubs/libcuda.so /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-
             initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder
             __/__spack_p/linux-rhel7-skylake_avx512/gcc-12.3.0/openmpi-4.1.6-w725nyrwejjoi3rdkio7wshsakupbj4x/lib/libmpi_usempif08.so /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stac
             k/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p
             /linux-rhel7-skylake_avx512/gcc-12.3.0/openmpi-4.1.6-w725nyrwejjoi3rdkio7wshsakupbj4x/lib/libmpi_usempi_ignore_tkr.so /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/sp
             ack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/lin
             ux-rhel7-skylake_avx512/gcc-12.3.0/openmpi-4.1.6-w725nyrwejjoi3rdkio7wshsakupbj4x/lib/libmpi_mpifh.so /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__
             spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake
             _avx512/gcc-12.3.0/openmpi-4.1.6-w725nyrwejjoi3rdkio7wshsakupbj4x/lib/libmpi.so /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder
             __/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-11.2.1/gcc
             -12.3.0-5f6vk4xpghfjmvrafcw6iue7u43373fe/lib64/libgomp.so -lpthread -lcudadevrt -lcudart_static -lrt -lpthread -ldl -lstdc++ -lm
     260     /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholde
             r__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_p/linux-rhel7-skylake_avx512/gcc-11.2.1/binutils-2.41-afccpcicqonvqgxk7vsdzl4367cevdxu/bin/ld: CMakeFiles/dbm_miniapp.dir/d
             bm/dbm_multiply_cpu.c.o: in function `dbm_multiply_cpu_process_batch':
  >> 261     /lustre/scratch/scratch/cceamgi/repo/hpc-spack-0.21/mg-initial-stack/build_stage/spack-stage-cp2k-2023.2-jua62lw6sr5jzp7cfaplksmd6ojbhb2v/spack-src/src/dbm/dbm_multiply_cpu.c:128:(.text+0x5
             8e): undefined reference to `libxsmm_dispatch_gemm_v2'
  >> 262     collect2: error: ld returned 1 exit status
  >> 263     make[3]: *** [src/CMakeFiles/dbm_miniapp.dir/build.make:328: bin/dbm_miniapp.psmp] Error 1

The undefined reference is to the symbol libxsmm_dispatch_gemm_v2, but libxsmm is linked with -l:libxsmmf.a -l:libxsmmext.a, however

$ nm $(spack -e . location -i libxsmm)/lib/libxsmm{,ext}.a|grep libxsmm_dispatch_gemm_v2

doesn't find anything. Note that the version of libxsmm that spack chose to use in this environment is libxsmm@main, which sounds a bit fishy, as it is an in-development version of a package, which is a moving target. Is the missing libxsmm_dispatch_gemm_v2 symbol a problem with this symbol being removed in libxsmm@main? If so, presumably this should be fixed by asking explicitly for the latest stable version of the dependency? I'm surprised Spack is choosing by default an @main version though, I thought it'd favour stable versions?

Information on your system

Additional information

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

CC: @dev-zero @mtaillefumier (for cp2k); @hfp (for libxsmm)

General information

giordano commented 7 months ago

I can confirm cp2k@2023.2 ... ^libxsmm@1.17 is built correctly, but I'm still confused: shouldn't spack already pick up the latest stable version automatically? Or we have to set the preferred attribute to the 1.17 version of libxsmm to achieve that?

haampie commented 7 months ago

Was libxsmm@main installed earlier and reused? Do you still get that version with --fresh?

giordano commented 7 months ago

So, I ran into this within a much larger environment, it's possible libxsmm@main was maybe required by some other packages and then reused. I confirm that with spack spec --fresh cp2k@2023.2 I do get ^libxsmm@1.17 as expected.

But I still think cp2k shouldn't allow you to use ^libxsmm@main since that combination seems to be broken? It's quite frustrating to discover these incompatibilities after several hours of building other packages.

mtaillefumier commented 7 months ago

I will add the exclusion it is the easiest.