LLNL / serac

Serac is a high order nonlinear thermomechanical simulation code
BSD 3-Clause "New" or "Revised" License
173 stars 30 forks source link

TPL build failure with +profiling enabled #1140

Open samuelpmishLLNL opened 1 month ago

samuelpmishLLNL commented 1 month ago

When trying to enable +profiling to use caliper, the build is failing with the following error message:

==> Installing elfutils-0.190-ma4dvml6te6cozatcyn2o6ilrvkv6mlf [30/44]
==> No binary for elfutils-0.190-ma4dvml6te6cozatcyn2o6ilrvkv6mlf found: installing from source
==> Using cached archive: /home/sam/code/serac_libs_june_12_2024/spack/var/spack/cache/_source-cache/archive/8e/8e00a3a9b5f04bc1dc273ae86281d2d26ed412020b391ffcc23198f10231d692.tar.bz2
==> Ran patch() for elfutils
==> elfutils: Executing phase: 'autoreconf'
==> elfutils: Executing phase: 'configure'
==> Error: ProcessError: Command exited with status 1:
    '/tmp/sam/spack-stage/spack-stage-elfutils-0.190-ma4dvml6te6cozatcyn2o6ilrvkv6mlf/spack-src/configure' '--prefix=/home/sam/code/serac_libs_june_12_2024/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-12.3.0/elfutils-0.190-ma4dvml6te6cozatcyn2o6ilrvkv6mlf' '--with-bzlib=/usr' '--with-lzma=/usr' '--with-zlib=/home/sam/code/serac_libs_june_12_2024/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-12.3.0/zlib-ng-2.1.6-lzstgsbitxrugm2veu3hsvu6knjqkuwd' '--program-prefix='"'"'eu-'"'"'' '--with-zstd=/home/sam/code/serac_libs_june_12_2024/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-12.3.0/zstd-1.5.5-jiggs47kv34yet3p33zdbd7yxlxijwc5' '--with-libiconv-prefix=/home/sam/code/serac_libs_june_12_2024/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-12.3.0/libiconv-1.17-j2ar7x74wbojtkhkopiyqvfbzp2dzp6q' '--without-libintl-prefix' '--disable-debuginfod' '--disable-libdebuginfod'

1 error found in build log:
     60    checking for special C compiler options needed for large files... no
     61    checking for _FILE_OFFSET_BITS value needed for large files... no
     62    checking whether fts.h is bad when included (with LFS)... no
     63    checking whether to add -D_FORTIFY_SOURCE=2 or =3 to CFLAGS... yes -D_FORTIFY_SOURCE=3
     64    checking for library containing gzdirect... -lz
     65    checking for library containing BZ2_bzdopen... no
  >> 66    configure: error: missing -lbz2 for --with-bzlib

edit: TPLs were built with python3 scripts/uberenv/uberenv.py --spec=+profiling --prefix=../serac_libs_june_12_2024

chapman39 commented 1 month ago

You may be missing something like this in your spack.yaml, under packages:

    bzip2:
      buildable: false
      externals:
      - spec: bzip2@1.0.6
        prefix: /usr

Or, maybe the prefix is incorrect?

samuelpmishLLNL commented 1 month ago

My current spack.yaml has

    bzip2:                                                                       
      externals:                                                                 
      - spec: bzip2@1.0.8                                                        
        prefix: /usr                                                             
      buildable: false 

bzip2 is in /usr/bin/bzip2 -- should it be /usr/bin instead? (this file was automatically generated)

chapman39 commented 1 month ago

Either way, it should be able to find it. Could you make elfutils an external package?

e.g.

    elfutils:
      buildable: false
      externals:
      - spec: elfutils@0.187
        prefix: /usr