Skip to content

Incompatible C++ versions between Abseil and google-cloud-cpp #68

@coryan

Description

@coryan

Issue:

Applications cannot link google-cloud-cpp when compiled in conda because google-cloud-cpp is compiled with C++11 and Abseil is compiled (and assumes) C++17.

google-cloud-cpp defaults to using C++11:

https://github.com/googleapis/google-cloud-cpp/blob/f2f41d1db3f3c401a7d25aae1a498d376b0950d4/CMakeLists.txt#L38

Abseil is compiled with whatever is the compiler's default, in my case seems to have been C++17:

$ nm /opt/conda/envs/arrow/lib/libabsl_strings.so | c++filt | grep std::basic_string_view | head
000000000000b430 T absl::lts_20210324::CHexEscape[abi:cxx11](std::basic_string_view<char, std::char_traits<char> >)
00000000000115b0 T absl::lts_20210324::SimpleAtob(std::basic_string_view<char, std::char_traits<char> >, bool*)
0000000000011260 T absl::lts_20210324::SimpleAtod(std::basic_string_view<char, std::char_traits<char> >, double*)

Furthermore, by default, Abseil changes its ABI depending on whether it is being used from C++11 or C++17:

abseil/abseil-cpp#696

The result is that google-cloud-cpp wants to use Abseil symbols with absl::string_view, but the Abseil symbols are defined with std::string_view. There are probably two ways to solve this problem:

  • Patch google-cloud-cpp to not set the C++ standard and use the default (maybe, this needs testing).
  • Compile google-cloud-cpp with C++17, that requires setting -DCMAKE_CXX_STANDARD=17 in recipe/build.sh
  • Compile abseil-cpp with C++11 and pin its ABI to always use the absl:: types. That seems more risky, though probably is the "Right Thing"[tm] as most toolt

Environment (conda list):
Details
$ conda list
# packages in environment at /opt/conda/envs/arrow:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
abseil-cpp                20210324.2           h9c3ff4c_0    conda-forge
autoconf                  2.69            pl5321hd708f79_11    conda-forge
aws-c-auth                0.6.5                h81f33ac_1    conda-forge
aws-c-cal                 0.5.12               h0f21c99_5    conda-forge
aws-c-common              0.6.15               h7f98852_0    conda-forge
aws-c-compression         0.2.14               hbce265f_5    conda-forge
aws-c-event-stream        0.2.7               h61c1795_28    conda-forge
aws-c-http                0.6.8                h7ea4525_3    conda-forge
aws-c-io                  0.10.12              hf9a76ae_3    conda-forge
aws-c-mqtt                0.7.8                h9111cbe_5    conda-forge
aws-c-s3                  0.1.27               h1ffd50b_4    conda-forge
aws-c-sdkutils            0.1.1                hbce265f_2    conda-forge
aws-checksums             0.1.12               hbce265f_4    conda-forge
aws-crt-cpp               0.17.2               h4087dd4_2    conda-forge
aws-sdk-cpp               1.9.132              h37ff0bb_0    conda-forge
benchmark                 1.6.0                h9c3ff4c_0    conda-forge
binutils                  2.36.1               hdd6e379_2    conda-forge
binutils_impl_linux-64    2.36.1               h193b22a_2    conda-forge
binutils_linux-64         2.36                 hf3e587d_1    conda-forge
boost-cpp                 1.77.0               h312852a_0    conda-forge
brotli                    1.0.9                h7f98852_5    conda-forge
brotli-bin                1.0.9                h7f98852_5    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.18.1               h7f98852_0    conda-forge
c-compiler                1.3.0                h7f98852_0    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
ccache                    4.4.2                haef5404_1    conda-forge
clang                     11.0.0               ha770c72_2    conda-forge
clang-11                  11.0.0          default_ha5c780c_2    conda-forge
cmake                     3.21.3               h8897547_0    conda-forge
compilers                 1.3.0                ha770c72_0    conda-forge
curl                      7.79.1               h2574ce0_1    conda-forge
cxx-compiler              1.3.0                h4bd325d_0    conda-forge
doxygen                   1.9.1                hb166930_1    conda-forge
expat                     2.4.1                h9c3ff4c_0    conda-forge
fortran-compiler          1.3.0                h1990efc_0    conda-forge
gcc                       9.4.0                h192d537_1    conda-forge
gcc_impl_linux-64         9.4.0               h03d3576_11    conda-forge
gcc_linux-64              9.4.0                h391b98a_1    conda-forge
gettext                   0.19.8.1          h73d1719_1008    conda-forge
gflags                    2.2.2             he1b5a44_1004    conda-forge
gfortran                  9.4.0                h2018a41_1    conda-forge
gfortran_impl_linux-64    9.4.0               h0003116_11    conda-forge
gfortran_linux-64         9.4.0                hf0ab688_1    conda-forge
git                       2.33.1          pl5321hc30692c_0    conda-forge
glog                      0.5.0                h48cff8f_0    conda-forge
gmock                     1.10.0               h4bd325d_7    conda-forge
google-cloud-cpp          1.32.1               hd4d1d42_1    conda-forge
grpc-cpp                  1.40.0               h05f19cf_2    conda-forge
gtest                     1.10.0               h4bd325d_7    conda-forge
gxx                       9.4.0                h192d537_1    conda-forge
gxx_impl_linux-64         9.4.0               h03d3576_11    conda-forge
gxx_linux-64              9.4.0                h0316aca_1    conda-forge
icu                       68.1                 h58526e2_0    conda-forge
kernel-headers_linux-64   2.6.32              he073ed8_14    conda-forge
krb5                      1.19.2               hcc1bbae_2    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
libbrotlicommon           1.0.9                h7f98852_5    conda-forge
libbrotlidec              1.0.9                h7f98852_5    conda-forge
libbrotlienc              1.0.9                h7f98852_5    conda-forge
libclang-cpp11            11.0.0          default_ha5c780c_2    conda-forge
libcrc32c                 1.1.2                h9c3ff4c_0    conda-forge
libcurl                   7.79.1               h2574ce0_1    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libevent                  2.1.10               h9b69904_4    conda-forge
libffi                    3.4.2                h9c3ff4c_4    conda-forge
libgcc-devel_linux-64     9.4.0               hd854feb_11    conda-forge
libgcc-ng                 11.2.0              h1d223b6_11    conda-forge
libgfortran-ng            11.2.0              h69a702a_11    conda-forge
libgfortran5              11.2.0              h5c6108e_11    conda-forge
libgomp                   11.2.0              h1d223b6_11    conda-forge
libhiredis                1.0.2                h2cc385e_0    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
libllvm11                 11.0.0               he513fc3_0    conda-forge
libnghttp2                1.43.0               h812cca2_1    conda-forge
libprotobuf               3.18.1               h780b84a_0    conda-forge
libsanitizer              9.4.0               h79bfe98_11    conda-forge
libssh2                   1.10.0               ha56f1ee_2    conda-forge
libstdcxx-devel_linux-64  9.4.0               hd854feb_11    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_11    conda-forge
libthrift                 0.15.0               he6d91bd_0    conda-forge
libutf8proc               2.6.1                h7f98852_0    conda-forge
libuv                     1.42.0               h7f98852_0    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
llvm-tools                11.0.0               he513fc3_0    conda-forge
llvmdev                   11.0.0               he513fc3_0    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
m4                        1.4.18            h516909a_1001    conda-forge
make                      4.3                  hd18ef5c_1    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
ninja                     1.10.2               h4bd325d_1    conda-forge
nlohmann_json             3.10.3               h9c3ff4c_0    conda-forge
openssl                   1.1.1l               h7f98852_0    conda-forge
orc                       1.7.0                h68e2c4e_0    conda-forge
pcre2                     10.37                h032f7d1_0    conda-forge
perl                      5.32.1          1_h7f98852_perl5    conda-forge
pip                       21.3.1             pyhd8ed1ab_0    conda-forge
pkg-config                0.29.2            h36c2ea0_1008    conda-forge
python                    3.9.7           hb7a2778_3_cpython    conda-forge
python_abi                3.9                      2_cp39    conda-forge
rapidjson                 1.1.0             he1b5a44_1002    conda-forge
re2                       2021.09.01           h9c3ff4c_0    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
rhash                     1.4.1                h7f98852_0    conda-forge
s2n                       1.1.2                h9b69904_0    conda-forge
setuptools                58.2.0           py39hf3d152e_0    conda-forge
snappy                    1.1.8                he1b5a44_3    conda-forge
sqlite                    3.36.0               h9cd32fc_2    conda-forge
sysroot_linux-64          2.12                he073ed8_14    conda-forge
thrift-compiler           0.15.0               he6d91bd_0    conda-forge
thrift-cpp                0.15.0               ha770c72_0    conda-forge
tk                        8.6.11               h27826a3_1    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
valgrind                  3.17.0               hf817b99_0    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge
zstd                      1.5.0                ha95c52a_0    conda-forge


Details about conda and system ( conda info ):
Details
$ conda info

     active environment : arrow
    active env location : /opt/conda/envs/arrow
            shell level : 1
       user config file : /root/.condarc
 populated config files : /root/.condarc
          conda version : 4.10.3
    conda-build version : not installed
         python version : 3.9.7.final.0
       virtual packages : __linux=5.10.46=0
                          __glibc=2.27=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /opt/conda  (writable)
      conda av data dir : /opt/conda/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/conda/pkgs
                          /root/.conda/pkgs
       envs directories : /opt/conda/envs
                          /root/.conda/envs
               platform : linux-64
             user-agent : conda/4.10.3 requests/2.26.0 CPython/3.9.7 Linux/5.10.46-5rodete1-amd64 ubuntu/18.04.6 glibc/2.27
                UID:GID : 0:0
             netrc file : None
           offline mode : False

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions