Questions tagged [abseil]

Abseil is an open-source utility library available for the Python and C++ languages, maintained and released by Google. The code comes from Google's own code base and existing projects. When using this tag, also include a tag indicating the language in which you are using Abseil utilities (Python or C++).

Abseil's C++ libraries are culled from utilities in Google's internal codebase. Abseil's Python libraries replace the no-longer-maintained google-apputils Python module, which contained useful Python utilities.

Links

  • Github repo for Abseil Common Libraries in C++: abseil-cpp
  • Github repo for Abseil Common Libraries in Python: abseil-py
  • Github organization for Abseil: abseil

The documentation will eventually be at abseil.io but there is currently no documentation available.

59 questions
1
vote
0 answers

Can't use abseil with libtorch, build failed

If i use abseil and libtorch together, and use the function like StrAppend, the build will fail and give errors like undefined reference to `absl::StrCat(absl::AlphaNum const&, absl::AlphaNum const&, absl::AlphaNum const&)' My Cmakelist is…
hanyuu1
  • 11
  • 1
1
vote
0 answers

Multiprocessing in OpenAI Gym with abseil

I am struggling with multiprocessing in OpenAI Gym with the abseil library. Basically, the gym.make seems working. However, I am trying to use gym-super-mario-bros which is not working. Below is a minimal working example: from absl import app import…
ravi
  • 6,140
  • 18
  • 77
  • 154
1
vote
1 answer

absl::flat_hash_map: efficient way to implement `remove_if`

Is there an efficient way to implement remove_if for absl::flat_hash_map? It is my understanding that absl::flat_hash_map doesn't return the iterator to the next element, which is generally used for remove_if's implementation. Does Abseil provide an…
bst
  • 426
  • 3
  • 10
1
vote
1 answer

undefined reference when linking libgrpc.a when building with -std=c++11

We were using grpc 1.15.0 for long time and linked to application compiled with C++11. We try to upgrade grpc to 1.46.5 (base on documentation gRPC C++ 1.46 will be the last release supporting C++11) I had simple test program that only…
1
vote
2 answers

how is 128 bit integer formed in abseil library?

In Abseil library absl::uint128 big = absl::MakeUint128(1, 0); this represents 2^64 , but i don't understand what does '1' and '0' mean here. Can someone explain me how the number is actually formed ?
Anuj
  • 11
  • 2
1
vote
1 answer

Abseil's GetStackTrace function returns back nothing

void show_stackframe() { std::cout << "Show stack frame function from Abseil." << std::endl; void *trace[100]; int i, trace_size = 0; trace_size = absl::GetStackTrace(trace, 100, 0); printf("[bt]…
Aditya A
  • 11
  • 4
1
vote
2 answers

How to set logging file / directory in Abseil Python?

I have a Python script using https://abseil.io/docs/python/guides/logging. Documentation does not specify how to set output file like in PEP 282. I thought that Abseil Logging is built on top of the standard Python logging and I could just set the…
engineer-x
  • 2,173
  • 2
  • 12
  • 25
1
vote
0 answers

tensorflow serving compile Error :absl lib not defined

when i using centos 7 compile tensorflow_serving 2.5.1,something maybe wrong. I using this command to compile tensorflow_serving: bazel build --color=yes --curses=yes --verbose_failures --config=release …
lee sir
  • 11
  • 1
1
vote
0 answers

Could not find a package configuration file provided by "absl" with any of the following names: abslConfig.cmake absl-config.cmake

Trying to run the Google cpu checker: https://github.com/google/cpu-check I get the following error when running cmake .. in the "Building" section: CMake Error at CMakeLists.txt:86 (find_package): By not providing "Findabsl.cmake" in…
xXmahmanXx
  • 21
  • 1
  • 4
1
vote
1 answer

Build Abseil on aarch64 using bazel

I cannot build abseil-cpp with Bazel. I'm building it directly on arm64. Device: NVIDIA Jetson Xavier NX OS: Ubuntu 18.04 CPU: 6-core NVIDIA Carmel ARM®v8.2 64-bit ./example/hello_world.cc #include #include #include…
1
vote
1 answer

Abseil StrCat example results in std::bad_alloc

I tried to use abseil's string library, but already the simple example does not run and fails with terminate called after throwing an instance of 'std::bad_alloc'. The snippet I use #include "absl/strings/str_cat.h" #include "fmt/core.h" int…
andreas777
  • 173
  • 1
  • 5
1
vote
1 answer

Trouble with Abseil random

I'm trying to use some functions from ABSEIL random with Cmake. (like absl::Uniform()) I made all like in this instruction. And all work. Then i want more and started to test absl::Uniform(). ABSEIL RANDOM My hello_word.cc is like #include…
c0nn3ct
  • 155
  • 1
  • 1
  • 7
1
vote
1 answer

Implementing heterogeneous lookup for spans in C++

Heterogeneous lookup means that we can index into a hash map holding keys of type std::string using another compatible type that makes sense, such as absl::string_view. For example, the following code works (I'm using the Abseil library rather than…
Joppy
  • 363
  • 2
  • 12
1
vote
0 answers

Using absl::flat_hash_set with folly::small_vector

I'm trying to create a absl::flat_hash_set of folly::small_vector. The documentation for adding support for a custom type for absl::Hash says: An AbslHashValue overload for a type should only be declared in the same file and namespace as said type.…
Thomas Johnson
  • 10,776
  • 18
  • 60
  • 98
1
vote
0 answers

Specify command line arguments for Python modules in distributed way (like abseil does)

How can I specify command line arguments on a per module base, that are then parsed when the application is run. This is basically how ABSEIL flags work, but I would prefer a more lightweight solution. Can this be achieved with argparse or any other…
jvh
  • 341
  • 3
  • 15