-
Notifications
You must be signed in to change notification settings - Fork 76
how to compile with clang ? #324
Comments
Hi, |
@freboat I strongly recommend to upgrade your compiler, this should fix the issue. However, if you want to use clang 3.6 you can wait until #325 is merged or apply the following patch :
After that, to compile libpmemobj-cpp tests and examples with your clang version please run cmake with: -DCMAKE_CXX_FLAGS=-DLIBPMEMOBJ_CPP_USE_HAS_TRIVIAL_COPY=1. If you want to compile your application with libmemobj-cpp using clang 3.6 you must set LIBPMEMOBJ_CPP_USE_HAS_TRIVIAL_COPY=1 in your code or during compilation. |
@szyrom & @igchor thanks for your kind reply, In file included from /home/brook/pmem/libpmemobj-cpp/tests/string_exceptions/string_exceptions.cpp:35: |
@ALL, i have fixed the error,
|
@freboat Will you submit pull request? Your contribution is more than welcome :) |
i try it like that:
$export CC=/usr/bin/clang-3.6
$export CXX=/usr/bin/clang++-3.6
$cmake ..
$make
but i got a error like below:
In file included from /home/brook/pmem/libpmemobj-cpp/tests/allocator/allocator.cpp:43:
/home/brook/pmem/libpmemobj-cpp/include/libpmemobj++/transaction.hpp:470:29: error: no member named 'is_trivially_copyable' in
namespace 'std'
typename std::enable_if<IS_TRIVIALLY_COPYABLE(T), T>::type * =
^~~~~~~~~~~~~~~~~~~~~~~~
/home/brook/pmem/libpmemobj-cpp/include/libpmemobj++/detail/common.hpp:101:39: note: expanded from macro 'IS_TRIVIALLY_COPYABLE'
#define IS_TRIVIALLY_COPYABLE(T) std::is_trivially_copyable::value
~~~~~^
In file included from /home/brook/pmem/libpmemobj-cpp/tests/allocator/allocator.cpp:43:
/home/brook/pmem/libpmemobj-cpp/include/libpmemobj++/transaction.hpp:470:51: error: 'T' does not refer to a value
typename std::enable_if<IS_TRIVIALLY_COPYABLE(T), T>::type * =
^
/home/brook/pmem/libpmemobj-cpp/include/libpmemobj++/detail/common.hpp:101:61: note: expanded from macro 'IS_TRIVIALLY_COPYABLE'
#define IS_TRIVIALLY_COPYABLE(T) std::is_trivially_copyable::value
^
/home/brook/pmem/libpmemobj-cpp/include/libpmemobj++/transaction.hpp:469:21: note: declared here
template <typename T,
^
/home/brook/pmem/libpmemobj-cpp/include/libpmemobj++/transaction.hpp:470:59: error: no type named 'type' in the global namespace
typename std::enable_if<IS_TRIVIALLY_COPYABLE(T), T>::type * =
~~^
/home/brook/pmem/libpmemobj-cpp/include/libpmemobj++/transaction.hpp:470:66: error: expected member name or ';' after declaration
specifiers
typename std::enable_if<IS_TRIVIALLY_COPYABLE(T), T>::type * =
~~~~~~ ^
/home/brook/pmem/libpmemobj-cpp/include/libpmemobj++/transaction.hpp:404:14: error: use of undeclared identifier 'add_lock'
auto err = add_lock(locks...);
^
/home/brook/pmem/libpmemobj-cpp/tests/allocator/allocator.cpp:95:23: note: in instantiation of function template specialization
'pmem::obj::transaction::run<>' requested here
nvobj::transaction::run(pop, [&] {
^
5 errors generated.
The text was updated successfully, but these errors were encountered: