Skip to content

adios2-config cxxflags output missing "-I" or "-isystem" #4350

@giltirn

Description

@giltirn

Describe the bug
I built [email protected] via spack on Sunspot using the icpx compiler and found adios2-config does not include the "-I" or "-isystem" prefix to the include path:


ckelly@uan-0002:~/bld/chimbuko_spack_env_9_12_24> /home/ckelly/bld/chimbuko_spack_env_9_12_24/spack/opt/spack/linux-sles15-x86_64/oneapi-2024.04.15.002/adios2-2.10.0-cj255dyxpy3joolxnthsq3rlwqrfavfc/bin/adios2-config --cxx-flags
-DADIOS2_USE_MPI /home/ckelly/bld/chimbuko_spack_env_9_12_24/spack/opt/spack/linux-sles15-x86_64/oneapi-2024.04.15.002/adios2-2.10.0-cj255dyxpy3joolxnthsq3rlwqrfavfc/include 

A build with gcc and openmpi in a Docker test environment running on a local machine produces the following


root@fe0859b75c2c:~# /opt/software/linux-ubuntu18.04-broadwell/gcc-7.5.0/adios2-2.10.0-tqtfqjay6ikguvo2bckeoykz7f3i3gfn/bin/adios2-config --cxx-flags
-DADIOS2_USE_MPI -isystem /opt/software/linux-ubuntu18.04-broadwell/gcc-7.5.0/adios2-2.10.0-tqtfqjay6ikguvo2bckeoykz7f3i3gfn/include 

which has the "-isystem" prefix.

This missing prefix is preventing libraries using adios2 from being built with spack.

To Reproduce

Here is a complete spack environment:


spack:
  specs:
  - adios2 % oneapi
  concretizer:
      unify: true
      reuse: false
  compilers:
  - compiler:
      spec: gcc@=12.2.0
      paths:
        cc: /opt/aurora/24.086.0/spack/gcc/0.7.0/install/linux-sles15-x86_64/gcc-7.5.0/gcc-12.2.0-fxd4zwa64mfswv34rol52zamj7c6r3cz/bin/gcc
        cxx: /opt/aurora/24.086.0/spack/gcc/0.7.0/install/linux-sles15-x86_64/gcc-7.5.0/gcc-12.2.0-fxd4zwa64mfswv34rol52zamj7c6r3cz/bin/g++
        f77: /opt/aurora/24.086.0/spack/gcc/0.7.0/install/linux-sles15-x86_64/gcc-7.5.0/gcc-12.2.0-fxd4zwa64mfswv34rol52zamj7c6r3cz/bin/gfortran
        fc: /opt/aurora/24.086.0/spack/gcc/0.7.0/install/linux-sles15-x86_64/gcc-7.5.0/gcc-12.2.0-fxd4zwa64mfswv34rol52zamj7c6r3cz/bin/gfortran
      flags: {}
      operating_system: sles15
      target: x86_64
      modules: []
      environment: {}
      extra_rpaths: []
  - compiler:
      spec: "[email protected] ~envmods"
      paths:
        cc: /opt/aurora/24.086.0/spack/oneapi/0.7.0/oneapi_sym/compiler/2024.04.15.002/bin/icx
        cxx: /opt/aurora/24.086.0/spack/oneapi/0.7.0/oneapi_sym/compiler/2024.04.15.002/bin/icpx
        f77: /opt/aurora/24.086.0/spack/oneapi/0.7.0/oneapi_sym/compiler/2024.04.15.002/bin/ifx
        fc: /opt/aurora/24.086.0/spack/oneapi/0.7.0/oneapi_sym/compiler/2024.04.15.002/bin/ifx
      flags:
        cflags: -fp-model=precise
        cxxflags: -fp-model=precise
        fflags: -fp-model=precise
      operating_system: sles15
      target: x86_64
      modules:
        - intel_compute_runtime/release/821.36
        - oneapi/eng-compiler/2024.04.15.002
        - gcc/12.2.0
      environment: {}
      extra_rpaths: []

  repos: []
  packages:
    all:
      compiler: [oneapi]
      target: [x86_64]
      providers:
        mpi: [mpich]

    intel-oneapi-compilers:
      externals:
        - spec: [email protected] ~envmods %[email protected]
          prefix: /opt/aurora/24.086.0/spack/oneapi/0.7.0/oneapi_sym
          modules:
            - oneapi/eng-compiler/2024.04.15.002
            - gcc/12.2.0
        - spec: [email protected] ~envmods %[email protected]
          prefix: /opt/aurora/24.086.0/spack/oneapi/0.7.0/oneapi_sym
          modules:
            - oneapi/release/2024.1
            - gcc/12.2.0
      buildable: false

    mpich:
      require:
        - spec: "@:20231026 %oneapi pmi=pmix ~hydra"
          when: "%[email protected]"
        - spec: "@:20231026 %oneapi pmi=pmix ~hydra"
          when: "%[email protected]"
      externals:
        - spec: "mpich@20231026 %oneapi pmi=pmix ~hydra"
          prefix: /opt/aurora/24.086.0/CNDA/mpich/20231026/mpich-ofi-all-icc-default-pmix-gpu-drop20231026
          modules:
            - mpich/icc-all-pmix-gpu/20231026
      buildable: false

    oneapi-level-zero:
      require:
        - spec: "@:821.36"
          when: "%[email protected]"
        - spec: "@:803.29"
          when: "%[email protected]"
      externals:
        - spec: "[email protected]"
          prefix: /opt/aurora/24.086.0/intel-gpu-umd/803.29
          modules:
            - intel_compute_runtime/release/803.29
        - spec: "[email protected]"
          prefix: /opt/aurora/24.086.0/intel-gpu-umd/803.45
          modules:
            - intel_compute_runtime/release/803.45
        - spec: "[email protected]"
          prefix: /opt/aurora/24.086.0/intel-gpu-umd/821.30
          modules:
            - intel_compute_runtime/release/821.30
        - spec: "[email protected]"
          prefix: /opt/aurora/24.086.0/intel-gpu-umd/821.35
          modules:
            - intel_compute_runtime/release/821.35
        - spec: "[email protected]"
          prefix: /opt/aurora/24.086.0/intel-gpu-umd/821.36
          modules:
            - intel_compute_runtime/release/821.36
      buildable: false

    libfabric:
      externals:
        - spec: [email protected]
          prefix: /opt/cray/libfabric/1.15.2.0
      buildable: false

    mpi:
      buildable: false

    perl:
      externals:
      - spec: [email protected]
        prefix: /usr
      buildable: false
      version: []

    python:
      version: []
      buildable: false
      externals:
      - modules:
        - python/3.10.11
        spec: [email protected]

    tar:
      externals:
      - spec: [email protected]
        prefix: /usr
      buildable: false
      version: []

    autoconf:
      externals:
      - spec: [email protected]
        prefix: /usr
      buildable: false
      version: []

    automake:
      externals:
      - spec: [email protected]
        prefix: /usr
      buildable: false
      version: []

    openssl:
      externals:
      - spec: [email protected]
        prefix: /usr
      buildable: false
      version: []

    pkg-config:
      externals:
      - spec: [email protected]
        prefix: /usr
      buildable: false
      version: []

    gmake:
      externals:
      - spec: [email protected]
        prefix: /usr
      buildable: false
      version: []

    libtool:
      externals:
      - spec: [email protected]
        prefix: /usr
      buildable: false
      version: []

    m4:
      externals:
      - spec: [email protected]
        prefix: /usr
      buildable: false
      version: []

    boost:
      externals:
      - spec: [email protected]
        prefix: /opt/aurora/24.086.0/spack/oneapi/0.7.0/install/2024.04.15.002/linux-sles15-x86_64/oneapi-2024.04.15.002/boost-1.84.0-kgmlpiv7w2oba3dge2zl7rtotjuorgkr
        modules:
         - boost/1.84.0
      buildable: false
      version: []

    cmake:
      externals:
      - spec: [email protected]
        prefix: /opt/aurora/24.086.0/spack/gcc/0.7.0/install/linux-sles15-x86_64/gcc-12.2.0/cmake-3.27.7-mbl7dvgbiblpavhu53h5cheyrmpaikdz
        modules:
         - cmake/3.27.7

      buildable: false
      version: []

  view: true

Please note that the adios2 binaries will fail to link due to the following issue:


  >> 1142    /usr/bin/ld: ../../../../lib64/libadios2_core.so.2.10.0: undefined reference to `MPI_Abort'
  >> 1143    /usr/bin/ld: ../../../../lib64/libadios2_core.so.2.10.0: undefined reference to `MPI_Bcast'
  >> 1144    /usr/bin/ld: ../../../../lib64/libadios2_core.so.2.10.0: undefined reference to `MPI_Barrier'

suggesting one of the dependent libraries on this system includes MPI symbols for some reason. A workaround is to hack the spack package (var/spack/repos/builtin/packages/adios2/package.py) to include the following
args.append("-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath=/opt/aurora/24.086.0/CNDA/mpich/20231026/mpich-ofi-all-icc-default-pmix-gpu-drop20231026/lib/ -L/opt/aurora/24.086.0/CNDA/mpich/20231026/mpich-ofi-all-icc-default-pmix-gpu-drop20231026/lib/ -lmpi")
when putting together the cmake args.

Expected behavior
The output of "adios2-config --cxx-flags" should include "-I" or "-isystem" before the include path

Desktop:

  • OS/Platform: Sunspot
  • Build: compiler [email protected] cmake [email protected] built via spack with spec [email protected]%[email protected] cflags='-fp-model=precise' cxxflags='-fp-model=precise' fflags='-fp-model=precise' ~aws+blosc2+bzip2~campaign~cuda~dataspaces+fortran~hdf5~ipo~kokkos+libcatalyst~libpressio+mgard+mpi~pic+png~python~rocm+sst~sycl+sz+zfp build_system=cmake build_type=Release generator=make arch=linux-sles15-x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions