The Google Concurrency Library (GCL) is an attempt to export several internal C++ Google concurrency libraries in a form that the C++ standard committee may accept for TR2.
cd to the directory into which you've checked out the Google Concurrency Library, and run:
$ make $ make test
make clean
will take you back to a pristine checkout.
I am trying make this project used on nowaday c++ development, since the original project is already archieve. Some function aren't implement as before. It's quite hard for me to make them done.
- master branch: this work
- disable_warning branch: remain project as close to origin as possible. but able to compile (disable warning as error).
- able to compile core,test by gcc11
- cmake support
-
compile sample
- dedup: install
openssl
.- call
make dedup
to build this example.
- call
- blackscholes: source code seems not yet complete.
- dedup: install
-
install by
sudo make install
-
After installed, for any project want to use this lib, plz add following command in your cmake.
-
find_package(gcl CONFIG REQUIRED) target_link_libraries(${your_target} gcl::goocon)
-
-
-
install by
conan
for make
- error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated]
- How to replace dynamic exception specifications: throw(...)
- comment out
/*throw (std::invalid_argument)*/;
- error: catching polymorphic type ‘class std::invalid_argument’ by value [-Werror=catch-value=]
- What is this? catching polymorphic type X by value [-Wcatch-value=]
} catch (std::invalid_argument expected)
-->} catch (std::invalid_argument& expected)
} catch (std::logic_error e)
-->} catch (std::logic_error& e)
} catch (gcl::closed_error expected) {
-->} catch (gcl::closed_error& expected) {
- error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move]
- C++ 函数返回局部变量的std::move()问题?
return std::move(elem);
-->return elem;
- error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
- 'dummy' may be used uninitialized
- gtest-death-test.cc
- will directly specify gtest version by cmake in future. currently, just pass it.
- error: result of ‘(2 << 31)’ requires 34 bits to represent, but ‘int’ only has 32 bits [-Werror=shift-overflow=]
arr[j] = (double)random() / (double)((2 << 31) - 1);
-->arr[j] = (double)random() / (double)(((unsigned long int)2 << 31) - 1);
for make test
all the error from gtest
inlined from ‘const char* testing::internal::posix::StrNCpy(char*, const char*, size_t)’ at ../third_party/googletest/include/gtest/internal/gtest-port.h:1610:17,
- error: ‘char*__builtin_strncpy(char*, const char*, long unsigned int)’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] gtest-port-arch.h
- Teaching googletest How to Print Your Values
- map_reduce_test.cc,
error: ‘class gcl::queue_wrapper<gcl::buffer_queue<int> >’ has no member named ‘begin’
, mr.run(input_wrap.begin(), input_wrap.end()); - move
counter_test.cc
,dynarray_test.cc
,queue_pref_test.cc
to gtest, no need main() function.