LLNL / axom

CS infrastructure components for HPC applications
BSD 3-Clause "New" or "Revised" License
146 stars 24 forks source link

Compilation issue on lassen clang-ibm-14.0.5 with ~fortran #1233

Open chapman39 opened 7 months ago

chapman39 commented 7 months ago

This is section of code seem to not be used in all required cases. It seems that we need to add this linker flag regardless of whether the fortran variant is on.

https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/axom/package.py#L215-L227

Spec: axom@0.8.1%clang@14.0.5~fortran

Compiler Spec:

  compilers:
    - compiler:
        flags:
          cflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1
          cxxflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1
          ldlibs: -lgfortran
        modules: [clang/ibm-14.0.5]
        operating_system: rhel7
        paths:
          cc: /usr/tce/packages/clang/clang-ibm-14.0.5/bin/clang
          cxx: /usr/tce/packages/clang/clang-ibm-14.0.5/bin/clang++
          f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran
          fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran
        spec: clang@14.0.5
        target: ppc64le

Error:

>> 330    /usr/WS2/meemee/lido-2.0/lido_libs/blueos_3_ppc64le_ib_p9/2023_12_04_14_55_16/spack/var/spack/stage/spack-stage-axom-0.8.1.0-qhydqijqmzn5izueky7iud6nibra5my3/spack-src/src/axom/core/../../axom/core/ArrayBase.hpp:
            22:4: error: "GNU libstdc++ versions less than 5 do not fully support C++11 and are unsupported by Axom."
     331      #error \
chapman39 commented 7 months ago

I believe this is only relevant with the versions of clang that do not have gcc in the name.

rhornung67 commented 6 months ago

https://github.com/Alpine-DAV/ascent/blob/b6f9b3aad1a8d321971ec9111b39442aa787b027/scripts/uberenv_configs/packages/ascent/package.py#L456

rhornung67 commented 6 months ago

https://github.com/Alpine-DAV/spack_configs/blob/104abbe66cf50e9b417fff03e203ed8a2e61cae8/envs/darwin/spack.yaml#L26

chapman39 commented 5 months ago

@rhornung67 I've tried what you suggested and am getting the same error unfortunately.

In spack.yaml:

  compilers:
    - compiler:
        extra_rpaths: [/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8]
        flags:
          cflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1
          cxxflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1
          fflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1
          ldlibs: -lgfortran
        modules: [clang/ibm-14.0.5]
        operating_system: rhel7
        paths:
          cc: /usr/tce/packages/clang/clang-ibm-14.0.5/bin/clang
          cxx: /usr/tce/packages/clang/clang-ibm-14.0.5/bin/clang++
          f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran
          fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran
        spec: clang@14.0.5
        target: ppc64le

In package.py:

        flags = ""
        for _libpath in self.compiler.extra_rpaths:
            if os.path.exists(_libpath):
                flags += " -Wl,-rpath,{0}".format(_libpath)
        if flags != "":
            description = "Adds a missing libstdc++ rpath"
            entries.append(cmake_cache_string("BLT_EXE_LINKER_FLAGS", flags, description))

I'm fairly certain BLT_EXE_LINKER_FLAGS is being set and that the rpath I provided has libstdc++, but maybe isn't being added to the link line somehow. Error:

cd /usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-vdju63filomtzff5wjqvxg5rwqpn64st/spack-build-vdju63f/axom/sidre && /usr/tce/packages/cuda/cuda-12.0.
            0/bin/nvcc -forward-unknown-to-host-compiler -ccbin=/usr/tce/packages/clang/clang-ibm-14.0.5/bin/clang++ -DCAMP_HAVE_CUDA -DH5_BUILT_AS_DYNAMIC_LIB -D_FILE_OFFSET_BITS=64 -
            D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200809L -I/usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-vdju63filomtzff5wjqv
            xg5rwqpn64st/spack-src/src/axom/core/../.. -I/usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-vdju63filomtzff5wjqvxg5rwqpn64st/spack-build-vdju63f/inclu
            de -isystem=/usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-vdju63filomtzff5wjqvxg5rwqpn64st/spack-src/src/thirdparty -isystem=/usr/WS2/meemee/spack/TP
            Ls/linux-rhel7-power9le/clang-14.0.5/camp-2022.10.1-33iqy5anabsclar4igxr7h52uy3kmogw/include -isystem=/usr/WS2/meemee/spack/TPLs/linux-rhel7-power9le/clang-14.0.5/umpire-20
            22.10.0-rj4gssxfyhqyqj7lp4em2f6svyaurgda/include -isystem=/usr/tce/packages/cuda/cuda-12.0.0/include -isystem=/usr/WS2/meemee/spack/TPLs/linux-rhel7-power9le/clang-14.0.5/r
            aja-2022.10.4-rldjxjcrabi5vu2wa3slnwjl6gihfgkp/include -isystem=/usr/WS2/meemee/spack/TPLs/linux-rhel7-power9le/clang-14.0.5/cub-2.1.0-atfa6t2sprds7ecqae4g5veb4qedj57j/incl
            ude -isystem=/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-2020.08.19/include -isystem=/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-14.0.5/includ
            e -isystem=/usr/WS2/meemee/spack/TPLs/linux-rhel7-power9le/clang-14.0.5/conduit-0.8.8-c3mmuwt7ylgfphhf34c2qsnn2wxoqy6q/include -isystem=/usr/WS2/meemee/spack/TPLs/linux-rhe
            l7-power9le/clang-14.0.5/conduit-0.8.8-c3mmuwt7ylgfphhf34c2qsnn2wxoqy6q/include/conduit -isystem=/usr/WS2/meemee/spack/TPLs/linux-rhel7-power9le/clang-14.0.5/hdf5-1.8.23-pu
            h566jpehs6haae4fzstgpcixae4dpy/include -isystem=/usr/WS2/meemee/spack/TPLs/linux-rhel7-power9le/clang-14.0.5/mfem-4.6.0-w7wgcd3vjgd2oqfmbwrv5sy27bobyvrf/include -isystem=/u
            sr/WS2/meemee/spack/TPLs/linux-rhel7-power9le/clang-14.0.5/hypre-2.18.2-nevtubfrxzzbltol44arnokzpc4bvlw4/include -isystem=/usr/WS2/meemee/spack/TPLs/linux-rhel7-power9le/cl
            ang-14.0.5/metis-5.1.0-qbn5z2nacrlwup242vvsfrgvo25srmgk/include -isystem=/usr/WS2/meemee/spack/TPLs/linux-rhel7-power9le/clang-14.0.5/parmetis-4.0.3-pt6vfle2gm6d4yrewcz6r4l
            ck43l6xsu/include -restrict --expt-extended-lambda -arch sm_70  -std=c++14 -O3 -DNDEBUG --generate-code=arch=compute_70,code=[compute_70,sm_70] -Xcompiler=-fPIC -Xcompiler=
            -pthread -Xcompiler -pthread -DCONDUIT_RELAY_IO_MPI_ENABLED -DCONDUIT_BLUEPRINT_MPI_ENABLED -std=c++14 -MD -MT axom/sidre/CMakeFiles/sidre.dir/spio/IOManager.cpp.o -MF CMak
            eFiles/sidre.dir/spio/IOManager.cpp.o.d -x cu -rdc=true -c /usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-vdju63filomtzff5wjqvxg5rwqpn64st/spack-src/s
            rc/axom/sidre/spio/IOManager.cpp -o CMakeFiles/sidre.dir/spio/IOManager.cpp.o
     329    In file included from /usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-vdju63filomtzff5wjqvxg5rwqpn64st/spack-src/src/axom/slam/BitSet.cpp:8:
     330    In file included from /usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-vdju63filomtzff5wjqvxg5rwqpn64st/spack-src/src/axom/core/../../axom/slam/BitSet.h
            pp:16:
     331    In file included from /usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-vdju63filomtzff5wjqvxg5rwqpn64st/spack-src/src/axom/core/../../axom/core/Array.hp
            p:13:
  >> 332    /usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-vdju63filomtzff5wjqvxg5rwqpn64st/spack-src/src/axom/core/../../axom/core/ArrayBase.hpp:22:4: error: "GN
            U libstdc++ versions less than 5 do not fully support C++11 and are unsupported by Axom."
     333      #error \
     334       ^
     335    In file included from In file included from /usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-vdju63filomtzff5wjqvxg5rwqpn64st/spack-src/src/axom/slam/Or
            deredSet.cpp/usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-vdju63filomtzff5wjqvxg5rwqpn64st/spack-src/src/axom/sidre/core/MFEMSidreDataCollection.cpp:
            10::