RFE: libstdc++ enforcement for PGI and NVHPC compilers

Issue #348 resolved
Paul Hargrove created an issue

Issue 347 requests improvements to how we detect/enforce the minimum required g++ (for its libstdc++) with Intel compilers. Meanwhile, we have no detection at all for PGI or NVHPC compilers (failing instead when building libupcxx.a).

Comments (11)

  1. Paul Hargrove reporter

    There are no __GNUC__ markings in the preprocessed output of pgcc/pgc++.

    So far I see only means to query the header and library search paths.
    However, determining a g++ version from than requires knowing the layout of a GCC install.
    So, no immediate plans to approach things from that direction.

  2. Paul Hargrove reporter

    There are no GNUC markings in the preprocessed output of pgcc/pgc++.

    Actually, it appears that __pgnu_vsn is precisely the preprocessor token we need.
    It is 60400 when the underlying gcc and g++ are version 6.4.0, 80300 for GCC version 8.3.0, etc.
    I does appear that this version can "lag", such that "too new" GCC versions will be labeled as the newest that the installer knows about. However, that does not impair the use as a means to detect "too old" libstdc++ since the PGI compilers older than GCC 6.4.0 are unacceptable for other reasons.

    PGI/NVHPC compilers are not at the top of my priority list at the moment. So I am not pursuing a PR to implement this RFE. However, something roughly like the following could be added to utils/system_checks.sh if/when this is again important to us:

      cat >conftest.cpp <<_EOF
       #if (__pgnu_vsn < $((MIN_GNU_MAJOR*10000+MIN_GNU_MINOR*100+MIN_GNU_PATCH)))
       const char msg[] = "BAD VERSION"
       #endif
     _EOF
      if [[ $(eval $CXX -E conftest.cpp) =~ (BAD VERSION) ]]; then
        COMPILER_BAD=1
      fi
    
  3. Paul Hargrove reporter

    This is no longer under consideration for the 2021.9.0 release. Rolling over to 2022.3.0.

  4. Paul Hargrove reporter

    configure: enforce libstdc++ version for PGI/NVHPC

    This commit adds a configure time probes for the GCC version specified when an PGI or NVHPC compiler package was installed. This provides us with the means to reject installations with a too-old libstdc++.

    The probe has been confirmed effective for a range of PGI compilers from our current floor through the final release. Similarly, the first and current releases of NVHPC are correctly probed. However, to defend against the possible future renaming of the (probably undocumented) identifier being probed, a failure to probe the version will only generate a warning.

    Resolves issue #348 RFE: libstdc++ enforcement for PGI compilers

    → <<cset f157a3933f8f>>

  5. Log in to comment