Fwd: C++20 and newer C++ compiler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



forgot to + ceph-devel

On Thu, Aug 11, 2022 at 1:05 AM Ronen Friedman <rfriedma@xxxxxxxxxx> wrote:
>
> Hi Kefu again...
> An update:
> - manually linking /opt/rh/gcc-toolset-11 to /usr/lib/gcc/x86_64-redhat-linux/11 seems to fix the toolset selection issue for Clang.

yeah, we do the awkward trick in our CI also, see
https://github.com/ceph/ceph-build/blob/c3903556266a9ab49c53d45927c5e2bcfc5acb69/ceph-perf-pull-requests/config/definitions/ceph-perf-pull-requests.yml#L182-L183

otherwise clang cannot find stdlibc++ provided by the gcc-toolset-11.
Clang has probably improved in this area, see
https://github.com/llvm/llvm-project/blob/e8578968f684997840f680ed62bff5cad0accc13/clang/lib/Driver/ToolChains/Gnu.cpp#L2140-L2167.

> - the spaceship operator now compiles (although I still have link issues). might want to pass -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld to cmake ?
>
> Ronen
>
>
>
>
> On Wed, Aug 10, 2022 at 6:50 PM Ronen Friedman <rfriedma@xxxxxxxxxx> wrote:
>>
>> Hi Kefu,
>>
>> Seems like getting it right on Centos stream 8 isn't that easy:
>> - install-deps.sh is broken (as it tries to install centos-release-scl)

i think it has been fixed by https://github.com/ceph/ceph/pull/47548.

>> - no llvm-toolset-12 package (or -14 for that matter)
>> - no gcc-toolset-12 package

you don't need all of them for compiling the tree. gcc-toolset-11
alone would suffice. you'd have access to llvm-toolset-14 on centos 8
stream if you enable appstream, see
https://centos.pkgs.org/8-stream/centos-appstream-x86_64/llvm-toolset-14.0.0-1.module_el8.7.0+1142+5343df54.x86_64.rpm.html
.

>>
>> My configuration:
>> -- The C compiler identification is GNU 11.2.1
>> -- The CXX compiler identification is Clang 14.0.0

i'd suggest use the same toolchain instead using the combination of
GCC and Clang. Clang + libstdc++ is okay.

>> -- Check for working C compiler: /opt/rh/gcc-toolset-11/root/usr/bin/gcc - skipped
>>
>> I am not sure which toolset is used by clang.
>> Here is what I get when compiling:
>>
>> [139/1040] Building CXX object src/common/CMakeFiles/common-common-objs.dir/FastCDC.cc.o
>> FAILED: src/common/CMakeFiles/common-common-objs.dir/FastCDC.cc.o
>> /usr/lib64/ccache/clang++ -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -DCEPH_INSTALL_DATADIR=\"/usr/local/share/ceph\" -DCEPH_INSTALL_FULL_PKGLIBDIR=\"/usr/local/lib64/ceph\" -DCMAKE_INSTALL_LIBDIR=\"lib64\" -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -D__CEPH__ -D__STDC_FORMAT_MACROS -D__linux__ -Isrc/include -I../src -isystem boost/include -isystem include -isystem ../src/xxHash -isystem ../src/rapidjson/include -isystem ../src/fmt/include -fno-omit-frame-pointer -O2 -g -DNDEBUG -fPIC -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -ftemplate-depth-1024 -Wpessimizing-move -Wredundant-move -Wno-inconsistent-missing-override -Wno-mismatched-tags -Wno-unused-private-field -Wno-address-
 of-packed-member -Wno-unused-function -Wno-unused-local-typedef -Wno-varargs -Wno-gnu-designator -Wno-missing-braces -Wno-parentheses -Wno-deprecated-register -fdiagnostics-color=auto -std=c++20 -MD -MT src/common/CMakeFiles/common-common-objs.dir/FastCDC.cc.o -MF src/common/CMakeFiles/common-common-objs.dir/FastCDC.cc.o.d -o src/common/CMakeFiles/common-common-objs.dir/FastCDC.cc.o -c ../src/common/FastCDC.cc
>> In file included from ../src/common/FastCDC.cc:6:
>> In file included from ../src/common/FastCDC.h:6:
>> In file included from ../src/common/CDC.h:9:
>> In file included from ../src/include/types.h:58:
>> ../src/include/object.h:44:8: warning: explicitly defaulted three-way comparison operator is implicitly deleted [-Wdefaulted-function-deleted]
>>   auto operator<=>(const object_t&) const noexcept = default;
>>        ^
>> ../src/include/object.h:34:15: note: defaulted 'operator<=>' is implicitly deleted because there is no viable three-way comparison function for member 'name'
>>   std::string name;
>>               ^
>> ../src/include/object.h:154:8: warning: explicitly defaulted three-way comparison operator is implicitly deleted [-Wdefaulted-function-deleted]
>>   auto operator<=>(const sobject_t&) const noexcept = default;
>>        ^
>> ../src/include/object.h:148:12: note: defaulted 'operator<=>' is implicitly deleted because it would invoke a deleted comparison function for member 'oid'
>>   object_t oid;
>>            ^
>> ../src/include/object.h:44:8: note: explicitly defaulted function was implicitly deleted here
>>   auto operator<=>(const object_t&) const noexcept = default;
>>        ^
>> ../src/include/object.h:34:15: note: defaulted 'operator<=>' is implicitly deleted because there is no viable three-way comparison function for member 'name'
>>   std::string name;
>>               ^
>>
>>
>> Thanks for any help
>> Ronen
>>>
>>>
>>> --
>>> Regards
>>> Kefu Chai
>>> _______________________________________________
>>> Dev mailing list -- dev@xxxxxxx
>>> To unsubscribe send an email to dev-leave@xxxxxxx
>>>


--
Regards
Kefu Chai


-- 
Regards
Kefu Chai
_______________________________________________
Dev mailing list -- dev@xxxxxxx
To unsubscribe send an email to dev-leave@xxxxxxx



[Index of Archives]     [CEPH Users]     [Ceph Devel]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux